Commit 465d1c61 authored by Marten Seemann's avatar Marten Seemann Committed by Filippo Valsorda

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/129755Reviewed-by: 's avatarFilippo Valsorda <filippo@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent ccc337d8
...@@ -188,7 +188,7 @@ func (*serverHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value { ...@@ -188,7 +188,7 @@ func (*serverHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
numSCTs := rand.Intn(4) numSCTs := rand.Intn(4)
m.scts = make([][]byte, numSCTs) m.scts = make([][]byte, numSCTs)
for i := range m.scts { for i := range m.scts {
m.scts[i] = randomBytes(rand.Intn(500), rand) m.scts[i] = randomBytes(rand.Intn(500)+1, rand)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment