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

Method marshalWithoutBinders

handshake_messages.go:306–315  ·  view source on GitHub ↗

marshalWithoutBinders returns the ClientHello through the PreSharedKeyExtension.identities field, according to RFC 8446, Section 4.2.11.2. Note that m.pskBinders must be set to slices of the correct length.

()

Source from the content-addressed store, hash-verified

304// PreSharedKeyExtension.identities field, according to RFC 8446, Section
305// 4.2.11.2. Note that m.pskBinders must be set to slices of the correct length.
306func (m *clientHelloMsg) marshalWithoutBinders() []byte {
307 bindersLen := 2 // uint16 length prefix
308 for _, binder := range m.pskBinders {
309 bindersLen += 1 // uint8 length prefix
310 bindersLen += len(binder)
311 }
312
313 fullMessage := m.marshal()
314 return fullMessage[:len(fullMessage)-bindersLen]
315}
316
317// updateBinders updates the m.pskBinders field, if necessary updating the
318// cached marshaled representation. The supplied binders must have the same

Callers 4

updateBindersMethod · 0.95
loadSessionMethod · 0.80
checkForResumptionMethod · 0.80

Calls 1

marshalMethod · 0.95

Tested by

no test coverage detected