1
0
mirror of https://github.com/golang/go synced 2024-09-29 17:24:34 -06:00

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 <filippo@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Marten Seemann 2018-08-17 18:03:55 +07:00 committed by Filippo Valsorda
parent ccc337d8ee
commit 465d1c6168

View 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)
}
}