MCPcopy Create free account
hub / github.com/XTLS/Go / exportKeyingMaterial

Method exportKeyingMaterial

key_schedule.go:94–102  ·  view source on GitHub ↗

exportKeyingMaterial implements RFC5705 exporters for TLS 1.3 according to RFC 8446, Section 7.5.

(masterSecret []byte, transcript hash.Hash)

Source from the content-addressed store, hash-verified

92// exportKeyingMaterial implements RFC5705 exporters for TLS 1.3 according to
93// RFC 8446, Section 7.5.
94func (c *cipherSuiteTLS13) exportKeyingMaterial(masterSecret []byte, transcript hash.Hash) func(string, []byte, int) ([]byte, error) {
95 expMasterSecret := c.deriveSecret(masterSecret, exporterLabel, transcript)
96 return func(label string, context []byte, length int) ([]byte, error) {
97 secret := c.deriveSecret(expMasterSecret, label, nil)
98 h := c.hash.New()
99 h.Write(context)
100 return c.expandLabel(secret, "exporter", h.Sum(nil), length), nil
101 }
102}
103
104// ecdheParameters implements Diffie-Hellman with either NIST curves or X25519,
105// according to RFC 8446, Section 4.2.8.2.

Callers 2

readServerFinishedMethod · 0.80
sendServerFinishedMethod · 0.80

Calls 4

deriveSecretMethod · 0.95
expandLabelMethod · 0.95
WriteMethod · 0.45
SumMethod · 0.45

Tested by

no test coverage detected