From 465d1c61685db9e249d77db7d4ceca578f400b27 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 17 Aug 2018 18:03:55 +0700 Subject: [PATCH] crypto/tls: fix ServerHello SCT test 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 Reviewed-by: Brad Fitzpatrick --- src/crypto/tls/handshake_messages_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/tls/handshake_messages_test.go b/src/crypto/tls/handshake_messages_test.go index 37eb748eea7..4a4a4667681 100644 --- a/src/crypto/tls/handshake_messages_test.go +++ b/src/crypto/tls/handshake_messages_test.go @@ -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) } }