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.
()
| 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. |
| 382 | func (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. |
no test coverage detected