mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-03 20:17:36 +03:00
crypto/tls: add support for AES_256_GCM_SHA384 cipher suites specified in RFC5289
Generalizes PRF calculation for TLS 1.2 to support arbitrary hashes (SHA-384 instead of SHA-256). Testdata were all updated to correspond with the new cipher suites in the handshake. Change-Id: I3d9fc48c19d1043899e38255a53c80dc952ee08f Reviewed-on: https://go-review.googlesource.com/3265 Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
parent
531f0d0055
commit
01861d435c
31 changed files with 1185 additions and 968 deletions
|
@ -168,7 +168,7 @@ NextCipherSuite:
|
|||
serverHello: serverHello,
|
||||
hello: hello,
|
||||
suite: suite,
|
||||
finishedHash: newFinishedHash(c.vers),
|
||||
finishedHash: newFinishedHash(c.vers, suite.tls12Hash),
|
||||
session: session,
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ func (hs *clientHandshakeState) doFullHandshake() error {
|
|||
c.writeRecord(recordTypeHandshake, certVerify.marshal())
|
||||
}
|
||||
|
||||
hs.masterSecret = masterFromPreMasterSecret(c.vers, preMasterSecret, hs.hello.random, hs.serverHello.random)
|
||||
hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite.tls12Hash, preMasterSecret, hs.hello.random, hs.serverHello.random)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ func (hs *clientHandshakeState) establishKeys() error {
|
|||
c := hs.c
|
||||
|
||||
clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
|
||||
keysFromMasterSecret(c.vers, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
|
||||
keysFromMasterSecret(c.vers, hs.suite.tls12Hash, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
|
||||
var clientCipher, serverCipher interface{}
|
||||
var clientHash, serverHash macFunction
|
||||
if hs.suite.cipher != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue