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

Function encodeInnerClientHello

ech.go:221–237  ·  view source on GitHub ↗
(inner *clientHelloMsg, maxNameLength int)

Source from the content-addressed store, hash-verified

219}
220
221func encodeInnerClientHello(inner *clientHelloMsg, maxNameLength int) ([]byte, error) {
222 h, err := inner.marshalMsg(true)
223 if err != nil {
224 return nil, err
225 }
226 h = h[4:] // strip four byte prefix
227
228 var paddingLen int
229 if inner.serverName != "" {
230 paddingLen = max(0, maxNameLength-len(inner.serverName))
231 } else {
232 paddingLen = maxNameLength + 9
233 }
234 paddingLen = 31 - ((len(h) + paddingLen - 1) % 32)
235
236 return append(h, make([]byte, paddingLen)...), nil
237}
238
239func skipUint8LengthPrefixed(s *cryptobyte.String) bool {
240 var skip uint8

Callers 1

Calls 1

marshalMsgMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…