Skip to content

Commit

Permalink
crypto/tls: reject change_cipher_spec record after handshake in TLS 1…
Browse files Browse the repository at this point in the history
  • Loading branch information
RPRX committed Mar 8, 2023
1 parent 88b6acd commit 92986c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ func (c *Conn) readRecordOrCCS(expectChangeCipherSpec bool) error {
// 5, a server can send a ChangeCipherSpec before its ServerHello, when
// c.vers is still unset. That's not useful though and suspicious if the
// server then selects a lower protocol version, so don't allow that.
if c.vers == VersionTLS13 {
if c.vers == VersionTLS13 && !handshakeComplete {
return c.retryReadRecord(expectChangeCipherSpec)
}
if !expectChangeCipherSpec {
Expand Down

0 comments on commit 92986c9

Please sign in to comment.