MCPcopy
hub / github.com/tjfoc/gmsm / masterFromPreMasterSecret

Function masterFromPreMasterSecret

gmtls/prf.go:170–178  ·  view source on GitHub ↗

masterFromPreMasterSecret generates the master secret from the pre-master secret. See http://tools.ietf.org/html/rfc5246#section-8.1

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

Source from the content-addressed store, hash-verified

168// masterFromPreMasterSecret generates the master secret from the pre-master
169// secret. See http://tools.ietf.org/html/rfc5246#section-8.1
170func masterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, clientRandom, serverRandom []byte) []byte {
171 seed := make([]byte, 0, len(clientRandom)+len(serverRandom))
172 seed = append(seed, clientRandom...)
173 seed = append(seed, serverRandom...)
174
175 masterSecret := make([]byte, masterSecretLength)
176 prfForVersion(version, suite)(masterSecret, preMasterSecret, masterSecretLabel, seed)
177 return masterSecret
178}
179
180// keysFromMasterSecret generates the connection keys from the master
181// secret, given the lengths of the MAC key, cipher key and IV, as defined in

Callers 6

doFullHandshakeMethod · 0.85
doFullHandshakeMethod · 0.85
doFullHandshakeMethod · 0.85
doFullHandshakeMethod · 0.85
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…