MCPcopy Index your code
hub / github.com/XTLS/Go / masterFromPreMasterSecret

Function masterFromPreMasterSecret

prf.go:108–116  ·  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

106// masterFromPreMasterSecret generates the master secret from the pre-master
107// secret. See RFC 5246, Section 8.1.
108func masterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, clientRandom, serverRandom []byte) []byte {
109 seed := make([]byte, 0, len(clientRandom)+len(serverRandom))
110 seed = append(seed, clientRandom...)
111 seed = append(seed, serverRandom...)
112
113 masterSecret := make([]byte, masterSecretLength)
114 prfForVersion(version, suite)(masterSecret, preMasterSecret, masterSecretLabel, seed)
115 return masterSecret
116}
117
118// keysFromMasterSecret generates the connection keys from the master
119// secret, given the lengths of the MAC key, cipher key and IV, as defined in

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…