Fix server reply certificate length

This commit is contained in:
Andy Wang 2020-04-06 15:55:22 +01:00
parent 6a83c58143
commit 285b966326
1 changed files with 1 additions and 1 deletions

View File

@ -211,7 +211,7 @@ func composeReply(clientHelloSessionId []byte, sharedSecret []byte, sessionKey [
// we can use sessionKey as a seed here to ensure consistency // we can use sessionKey as a seed here to ensure consistency
possibleCertLengths := []int{42, 27, 68, 59, 36, 44, 46} possibleCertLengths := []int{42, 27, 68, 59, 36, 44, 46}
rand.Seed(int64(sessionKey[0])) rand.Seed(int64(sessionKey[0]))
cert := make([]byte, rand.Intn(len(possibleCertLengths))) cert := make([]byte, possibleCertLengths[rand.Intn(len(possibleCertLengths))])
util.CryptoRandRead(cert) util.CryptoRandRead(cert)
encryptedCertBytes := addRecordLayer(cert, []byte{0x17}, TLS12) encryptedCertBytes := addRecordLayer(cert, []byte{0x17}, TLS12)
ret := append(shBytes, ccsBytes...) ret := append(shBytes, ccsBytes...)