crypto/tls: reject change_cipher_spec record after handshake in TLS 1.3

https://github.com/golang/go/pull/58912
This commit is contained in:
RPRX
2023-03-07 15:19:08 +00:00
committed by GitHub
parent 6f8fa90c03
commit 15efa424b2
+1 -1
View File
@@ -762,7 +762,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 {