MCPcopy Create free account
hub / github.com/HyBuildNet/quic-relay / parseFrames

Function parseFrames

internal/proxy/parser.go:533–548  ·  view source on GitHub ↗

parseFrames extracts CRYPTO frames from QUIC frames. Returns all CRYPTO frames found, sorted by offset.

(data []byte)

Source from the content-addressed store, hash-verified

531// parseFrames extracts CRYPTO frames from QUIC frames.
532// Returns all CRYPTO frames found, sorted by offset.
533func 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
551func extractCryptoFrames(data []byte) []CryptoFrame {

Callers

nothing calls this directly

Calls 3

extractCryptoFramesFunction · 0.85
reassembleCryptoDataFunction · 0.85
parseTLSClientHelloFunction · 0.85

Tested by

no test coverage detected