diff --git a/src/crypto/tls/handshake_messages.go b/src/crypto/tls/handshake_messages.go index 40c54cca58b..b3840f6c10f 100644 --- a/src/crypto/tls/handshake_messages.go +++ b/src/crypto/tls/handshake_messages.go @@ -248,7 +248,7 @@ func (m *clientHelloMsg) marshal() ([]byte, error) { }) }) } - if len(m.keyShares) > 0 { + if m.keyShares != nil { // RFC 8446, Section 4.2.8 exts.AddUint16(extensionKeyShare) exts.AddUint16LengthPrefixed(func(exts *cryptobyte.Builder) {