mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-05 04:57:35 +03:00
crypto/tls: marshal sessionState using cryptobyte
Change-Id: I95a60b837e19d0c4bf45ea74baa5843a8244a186 Reviewed-on: https://go-review.googlesource.com/c/go/+/231218 Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
parent
b65e9fa492
commit
24d8c7c748
2 changed files with 43 additions and 76 deletions
|
@ -308,11 +308,9 @@ func (*sessionState) Generate(rand *rand.Rand, size int) reflect.Value {
|
|||
s := &sessionState{}
|
||||
s.vers = uint16(rand.Intn(10000))
|
||||
s.cipherSuite = uint16(rand.Intn(10000))
|
||||
s.masterSecret = randomBytes(rand.Intn(100), rand)
|
||||
numCerts := rand.Intn(20)
|
||||
s.certificates = make([][]byte, numCerts)
|
||||
for i := 0; i < numCerts; i++ {
|
||||
s.certificates[i] = randomBytes(rand.Intn(10)+1, rand)
|
||||
s.masterSecret = randomBytes(rand.Intn(100)+1, rand)
|
||||
for i := 0; i < rand.Intn(20); i++ {
|
||||
s.certificates = append(s.certificates, randomBytes(rand.Intn(500)+1, rand))
|
||||
}
|
||||
return reflect.ValueOf(s)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue