MCPcopy Create free account
hub / github.com/pion/dtls / valueKeyMessage

Function valueKeyMessage

crypto.go:29–43  ·  view source on GitHub ↗
(clientRandom, serverRandom, publicKey []byte, namedCurve elliptic.Curve)

Source from the content-addressed store, hash-verified

27}
28
29func valueKeyMessage(clientRandom, serverRandom, publicKey []byte, namedCurve elliptic.Curve) []byte {
30 serverECDHParams := make([]byte, 4)
31 serverECDHParams[0] = 3 // named curve
32 binary.BigEndian.PutUint16(serverECDHParams[1:], uint16(namedCurve))
33 //nolint:gosec // G115, no risk of overflow, the biggest supported curve is 97 bytes.
34 serverECDHParams[3] = byte(len(publicKey))
35
36 plaintext := []byte{}
37 plaintext = append(plaintext, clientRandom...)
38 plaintext = append(plaintext, serverRandom...)
39 plaintext = append(plaintext, serverECDHParams...)
40 plaintext = append(plaintext, publicKey...)
41
42 return plaintext
43}
44
45// validateSignatureAlgOID validates that the signature scheme matches the
46// certificate's public key algorithm OID. This is required by RFC 8446 Section 4.2.3:

Callers 6

initializeCipherSuiteFunction · 0.85
generateKeySignatureFunction · 0.85
TestRSAPSSVsPKCS1v15Function · 0.85
TestRSAPSSRSAEVariantsFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestRSAPSSVsPKCS1v15Function · 0.68
TestRSAPSSRSAEVariantsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…