From: Katie Hockman Date: Mon, 18 May 2020 20:49:04 +0000 (-0400) Subject: crypto/tls: remove version check when unmarshaling sessionState X-Git-Tag: go1.15beta1~136 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=185c3d46109fe067abf1d4ad4d4812006a55dbe2;p=gostls13.git crypto/tls: remove version check when unmarshaling sessionState This was causing issues when fuzzing with TestMarshalUnmarshal since the test would occassionally set the version to VersionTLS13, which would fail when unmarshaling. The check doesn't add much in practice, and there is no harm in removing it to de-flake the test. Fixes #38902 Change-Id: I0906c570e9ed69c85fdd2c15f1b52f9e372c62e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/234486 Run-TryBot: Katie Hockman TryBot-Result: Gobot Gobot Reviewed-by: Filippo Valsorda --- diff --git a/src/crypto/tls/ticket.go b/src/crypto/tls/ticket.go index 38b01fc25c..6c1d20da20 100644 --- a/src/crypto/tls/ticket.go +++ b/src/crypto/tls/ticket.go @@ -54,7 +54,6 @@ func (m *sessionState) unmarshal(data []byte) bool { *m = sessionState{usedOldKey: m.usedOldKey} s := cryptobyte.String(data) if ok := s.ReadUint16(&m.vers) && - m.vers != VersionTLS13 && s.ReadUint16(&m.cipherSuite) && readUint64(&s, &m.createdAt) && readUint16LengthPrefixed(&s, &m.masterSecret) &&