mirror of https://github.com/cbeuw/Cloak
Fix server reply certificate length
This commit is contained in:
parent
6a83c58143
commit
285b966326
|
|
@ -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...)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue