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

Function signedMessage

auth.go:82–95  ·  view source on GitHub ↗

signedMessage returns the pre-hashed (if necessary) message to be signed by certificate keys in TLS 1.3. See RFC 8446, Section 4.4.3.

(sigHash crypto.Hash, context string, transcript hash.Hash)

Source from the content-addressed store, hash-verified

80// signedMessage returns the pre-hashed (if necessary) message to be signed by
81// certificate keys in TLS 1.3. See RFC 8446, Section 4.4.3.
82func signedMessage(sigHash crypto.Hash, context string, transcript hash.Hash) []byte {
83 if sigHash == directSigning {
84 b := &bytes.Buffer{}
85 b.Write(signaturePadding)
86 io.WriteString(b, context)
87 b.Write(transcript.Sum(nil))
88 return b.Bytes()
89 }
90 h := sigHash.New()
91 h.Write(signaturePadding)
92 io.WriteString(h, context)
93 h.Write(transcript.Sum(nil))
94 return h.Sum(nil)
95}
96
97// typeAndHashFromSignatureScheme returns the corresponding signature type and
98// crypto.Hash for a given TLS SignatureScheme.

Callers 4

readServerCertificateMethod · 0.85
sendClientCertificateMethod · 0.85
sendServerCertificateMethod · 0.85
readClientCertificateMethod · 0.85

Calls 3

BytesMethod · 0.80
WriteMethod · 0.65
SumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…