MCPcopy
hub / github.com/XTLS/REALITY / masterFromPreMasterSecret

Function masterFromPreMasterSecret

prf.go:112–118  ·  view source on GitHub ↗

masterFromPreMasterSecret generates the master secret from the pre-master secret. See RFC 5246, Section 8.1.

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

Source from the content-addressed store, hash-verified

110// masterFromPreMasterSecret generates the master secret from the pre-master
111// secret. See RFC 5246, Section 8.1.
112func masterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, clientRandom, serverRandom []byte) []byte {
113 seed := make([]byte, 0, len(clientRandom)+len(serverRandom))
114 seed = append(seed, clientRandom...)
115 seed = append(seed, serverRandom...)
116
117 return prfForVersion(version, suite)(preMasterSecret, masterSecretLabel, seed, masterSecretLength)
118}
119
120// extMasterFromPreMasterSecret generates the extended master secret from the
121// pre-master secret. See RFC 7627.

Callers 2

doFullHandshakeMethod · 0.85
doFullHandshakeMethod · 0.85

Calls 1

prfForVersionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…