]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: fix ServerHello SCT test
authorMarten Seemann <martenseemann@gmail.com>
Fri, 17 Aug 2018 11:03:55 +0000 (18:03 +0700)
committerFilippo Valsorda <filippo@golang.org>
Tue, 9 Oct 2018 04:45:54 +0000 (04:45 +0000)
According to https://tools.ietf.org/html/rfc6962#section-3.3, the SCT
must be at least one byte long. The parsing code correctly checks for
this condition, but rarely the test does generate an empty SCT.

Change-Id: If36a34985b4470a5a9f96affc159195c04f6bfad
Reviewed-on: https://go-review.googlesource.com/c/129755
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/tls/handshake_messages_test.go

index 37eb748eea7b40684a9eb22fae05ba7d0706d622..4a4a466768197e8a904733514712587df4da3cd3 100644 (file)
@@ -188,7 +188,7 @@ func (*serverHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
                numSCTs := rand.Intn(4)
                m.scts = make([][]byte, numSCTs)
                for i := range m.scts {
-                       m.scts[i] = randomBytes(rand.Intn(500), rand)
+                       m.scts[i] = randomBytes(rand.Intn(500)+1, rand)
                }
        }