parseFrames extracts CRYPTO frames from QUIC frames. Returns all CRYPTO frames found, sorted by offset.
(data []byte)
| 531 | // parseFrames extracts CRYPTO frames from QUIC frames. |
| 532 | // Returns all CRYPTO frames found, sorted by offset. |
| 533 | func parseFrames(data []byte) (*handler.ClientHello, error) { |
| 534 | frames := extractCryptoFrames(data) |
| 535 | |
| 536 | if len(frames) == 0 { |
| 537 | return nil, errors.New("no crypto data found") |
| 538 | } |
| 539 | |
| 540 | // Reassemble CRYPTO data from frames |
| 541 | cryptoData := reassembleCryptoData(frames) |
| 542 | |
| 543 | if len(cryptoData) == 0 { |
| 544 | return nil, errors.New("no crypto data after reassembly") |
| 545 | } |
| 546 | |
| 547 | return parseTLSClientHello(cryptoData) |
| 548 | } |
| 549 | |
| 550 | // extractCryptoFrames extracts all CRYPTO frames from decrypted packet data |
| 551 | func extractCryptoFrames(data []byte) []CryptoFrame { |
nothing calls this directly
no test coverage detected