MCPcopy Index your code
hub / github.com/XTLS/REALITY / extMasterFromPreMasterSecret

Function extMasterFromPreMasterSecret

prf.go:122–130  ·  view source on GitHub ↗

extMasterFromPreMasterSecret generates the extended master secret from the pre-master secret. See RFC 7627.

(version uint16, suite *cipherSuite, preMasterSecret, transcript []byte)

Source from the content-addressed store, hash-verified

120// extMasterFromPreMasterSecret generates the extended master secret from the
121// pre-master secret. See RFC 7627.
122func extMasterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, transcript []byte) []byte {
123 prf, hash := prfAndHashForVersion(version, suite)
124 if version == VersionTLS12 {
125 // Use the FIPS 140-3 module only for TLS 1.2 with EMS, which is the
126 // only TLS 1.0-1.2 approved mode per IG D.Q.
127 return tls12.MasterSecret(hash.New, preMasterSecret, transcript)
128 }
129 return prf(preMasterSecret, extendedMasterSecretLabel, transcript, masterSecretLength)
130}
131
132// keysFromMasterSecret generates the connection keys from the master
133// secret, given the lengths of the MAC key, cipher key and IV, as defined in

Callers 2

doFullHandshakeMethod · 0.85
doFullHandshakeMethod · 0.85

Calls 2

MasterSecretFunction · 0.92
prfAndHashForVersionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…