]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: fix clientHelloMsg fuzzer not to generate the RI SCSV
authorEKR <ekr@rtfm.com>
Wed, 11 Jan 2017 21:46:27 +0000 (13:46 -0800)
committerAdam Langley <agl@golang.org>
Sat, 9 Sep 2017 19:24:12 +0000 (19:24 +0000)
It was causing mysterious fuzzing failure because it affects the
unmarshaling of the secureNegotiationSupported field.

Change-Id: Id396b84eab90a3b22fb6e306b10bdd7e39707012
Reviewed-on: https://go-review.googlesource.com/60912
Run-TryBot: Filippo Valsorda <hi@filippo.io>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/tls/handshake_messages_test.go

index 7add97c32c1071041e426b3b9a2a11283b0d1641..49c13eecf216218def8366834ac94f0c456ad350 100644 (file)
@@ -116,7 +116,11 @@ func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
        m.sessionId = randomBytes(rand.Intn(32), rand)
        m.cipherSuites = make([]uint16, rand.Intn(63)+1)
        for i := 0; i < len(m.cipherSuites); i++ {
-               m.cipherSuites[i] = uint16(rand.Int31())
+               cs := uint16(rand.Int31())
+               if cs == scsvRenegotiation {
+                       cs += 1
+               }
+               m.cipherSuites[i] = cs
        }
        m.compressionMethods = randomBytes(rand.Intn(63)+1, rand)
        if rand.Intn(10) > 5 {