illegalClientHelloChange reports whether the two ClientHello messages are different, with the exception of the changes allowed before and after a HelloRetryRequest. See RFC 8446, Section 4.1.2.
(ch, ch1 *clientHelloMsg)
| 457 | // different, with the exception of the changes allowed before and after a |
| 458 | // HelloRetryRequest. See RFC 8446, Section 4.1.2. |
| 459 | func illegalClientHelloChange(ch, ch1 *clientHelloMsg) bool { |
| 460 | if len(ch.supportedVersions) != len(ch1.supportedVersions) || |
| 461 | len(ch.cipherSuites) != len(ch1.cipherSuites) || |
| 462 | len(ch.supportedCurves) != len(ch1.supportedCurves) || |
| 463 | len(ch.supportedSignatureAlgorithms) != len(ch1.supportedSignatureAlgorithms) || |
| 464 | len(ch.supportedSignatureAlgorithmsCert) != len(ch1.supportedSignatureAlgorithmsCert) || |
| 465 | len(ch.alpnProtocols) != len(ch1.alpnProtocols) { |
| 466 | return true |
| 467 | } |
| 468 | for i := range ch.supportedVersions { |
| 469 | if ch.supportedVersions[i] != ch1.supportedVersions[i] { |
| 470 | return true |
| 471 | } |
| 472 | } |
| 473 | for i := range ch.cipherSuites { |
| 474 | if ch.cipherSuites[i] != ch1.cipherSuites[i] { |
| 475 | return true |
| 476 | } |
| 477 | } |
| 478 | for i := range ch.supportedCurves { |
| 479 | if ch.supportedCurves[i] != ch1.supportedCurves[i] { |
| 480 | return true |
| 481 | } |
| 482 | } |
| 483 | for i := range ch.supportedSignatureAlgorithms { |
| 484 | if ch.supportedSignatureAlgorithms[i] != ch1.supportedSignatureAlgorithms[i] { |
| 485 | return true |
| 486 | } |
| 487 | } |
| 488 | for i := range ch.supportedSignatureAlgorithmsCert { |
| 489 | if ch.supportedSignatureAlgorithmsCert[i] != ch1.supportedSignatureAlgorithmsCert[i] { |
| 490 | return true |
| 491 | } |
| 492 | } |
| 493 | for i := range ch.alpnProtocols { |
| 494 | if ch.alpnProtocols[i] != ch1.alpnProtocols[i] { |
| 495 | return true |
| 496 | } |
| 497 | } |
| 498 | return ch.vers != ch1.vers || |
| 499 | !bytes.Equal(ch.random, ch1.random) || |
| 500 | !bytes.Equal(ch.sessionId, ch1.sessionId) || |
| 501 | !bytes.Equal(ch.compressionMethods, ch1.compressionMethods) || |
| 502 | ch.serverName != ch1.serverName || |
| 503 | ch.ocspStapling != ch1.ocspStapling || |
| 504 | !bytes.Equal(ch.supportedPoints, ch1.supportedPoints) || |
| 505 | ch.ticketSupported != ch1.ticketSupported || |
| 506 | !bytes.Equal(ch.sessionTicket, ch1.sessionTicket) || |
| 507 | ch.secureRenegotiationSupported != ch1.secureRenegotiationSupported || |
| 508 | !bytes.Equal(ch.secureRenegotiation, ch1.secureRenegotiation) || |
| 509 | ch.scts != ch1.scts || |
| 510 | !bytes.Equal(ch.cookie, ch1.cookie) || |
| 511 | !bytes.Equal(ch.pskModes, ch1.pskModes) |
| 512 | } |
| 513 | |
| 514 | func (hs *serverHandshakeStateTLS13) sendServerParameters() error { |
| 515 | c := hs.c |
no outgoing calls
no test coverage detected
searching dependent graphs…