Skip to content

Commit 15efa42

Browse files
authored
crypto/tls: reject change_cipher_spec record after handshake in TLS 1.3
golang/go#58912
1 parent 6f8fa90 commit 15efa42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ func (c *Conn) readRecordOrCCS(expectChangeCipherSpec bool) error {
762762
// 5, a server can send a ChangeCipherSpec before its ServerHello, when
763763
// c.vers is still unset. That's not useful though and suspicious if the
764764
// server then selects a lower protocol version, so don't allow that.
765-
if c.vers == VersionTLS13 {
765+
if c.vers == VersionTLS13 && !handshakeComplete {
766766
return c.retryReadRecord(expectChangeCipherSpec)
767767
}
768768
if !expectChangeCipherSpec {

0 commit comments

Comments
 (0)