MCPcopy Index your code
hub / github.com/XTLS/REALITY / marshalWithoutBinders

Method marshalWithoutBinders

handshake_messages.go:382–400  ·  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

380// PreSharedKeyExtension.identities field, according to RFC 8446, Section
381// 4.2.11.2. Note that m.pskBinders must be set to slices of the correct length.
382func (m *clientHelloMsg) marshalWithoutBinders() ([]byte, error) {
383 bindersLen := 2 // uint16 length prefix
384 for _, binder := range m.pskBinders {
385 bindersLen += 1 // uint8 length prefix
386 bindersLen += len(binder)
387 }
388
389 var fullMessage []byte
390 if m.original != nil {
391 fullMessage = m.original
392 } else {
393 var err error
394 fullMessage, err = m.marshal()
395 if err != nil {
396 return nil, err
397 }
398 }
399 return fullMessage[:len(fullMessage)-bindersLen], nil
400}
401
402// updateBinders updates the m.pskBinders field. The supplied binders must have
403// the same length as the current m.pskBinders.

Callers 2

computeAndUpdatePSKFunction · 0.80
checkForResumptionMethod · 0.80

Calls 1

marshalMethod · 0.95

Tested by

no test coverage detected