Skip to content

Commit 190cb11

Browse files
authored
test(quic): add extended coverage tests for crypto module (#1002)
Adds 88 deterministic, public-API-only unit tests targeting the lower-coverage branches in src/protocols/quic/crypto.cpp. Covers: - HKDF extract/expand/expand_label edge cases including empty-salt and empty-IKM error paths, zero-length expand, and label/context isolation - initial_keys::derive for QUIC v1 and v2 salts, version divergence, empty and max-length DCIDs, and secret propagation into keys - derive_keys with the is_client_keys flag verified as no-op - Packet protection AEAD round-trip across many packet numbers, empty and large payloads, and varying header sizes - Unprotect failure paths: truncated packet, modified header, wrong packet number, wrong key, wrong IV, corrupted tag, corrupted ciphertext - Header protection mask: short-sample rejection, key/sample isolation, determinism - Header protection protect/unprotect round-trip across long and short headers with packet number lengths 1-4, self-inverse XOR - quic_crypto public surface: set_keys monotonic level raising, ALPN wire-format rejection of overlong protocols, 0-RTT ticket and early-data gates, update_keys pre-handshake rejection, move semantics preserving keys - quic_keys / key_pair is_valid, clear, and equality operators All tests run in under one second total with no real network IO and no TLS handshake. Closes #993
1 parent df04502 commit 190cb11

2 files changed

Lines changed: 1289 additions & 0 deletions

File tree

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4649,6 +4649,7 @@ message(STATUS "WebSocket socket unit tests enabled (Issue #968)")
46494649
add_network_test(network_session_ticket_store_test unit/session_ticket_store_test.cpp)
46504650
add_network_test(network_quic_pmtud_controller_test unit/quic_pmtud_controller_test.cpp)
46514651
add_network_test(network_quic_crypto_module_test unit/quic_crypto_test.cpp)
4652+
add_network_test(network_quic_crypto_extended_test unit/quic_crypto_extended_test.cpp)
46524653
add_network_test(network_quic_connection_module_test unit/quic_connection_test.cpp)
46534654
add_network_test(network_quic_connection_extended_test unit/quic_connection_extended_test.cpp)
46544655
add_network_test(network_quic_socket_construction_test unit/quic_socket_construction_test.cpp)

0 commit comments

Comments
 (0)