Browse Source

crypto/tls: check that client cipher suite matches version

v1.2.3
Peter Wu 7 years ago
parent
commit
857c7243c9
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      handshake_client.go

+ 6
- 0
handshake_client.go View File

@@ -186,6 +186,12 @@ NextCipherSuite:
c.sendAlert(alertHandshakeFailure)
return errors.New("tls: server chose an unconfigured cipher suite")
}
// Check that the chosen cipher suite matches the protocol version.
if c.vers >= VersionTLS13 && suite.flags&suiteTLS13 == 0 ||
c.vers < VersionTLS13 && suite.flags&suiteTLS13 != 0 {
c.sendAlert(alertHandshakeFailure)
return errors.New("tls: server chose an inappropriate cipher suite")
}

hs := &clientHandshakeState{
c: c,


Loading…
Cancel
Save