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

Function signedMessage

auth.go:81–94  ·  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

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

Callers 4

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

Calls 2

WriteMethod · 0.45
SumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…