code wiki / (root) / nx_tls13_server_session_recv_cf_test.nx

nx_tls13_server_session_recv_cf_test.nx

buildroot/runtime/nx_tls13_server_session_recv_cf_test.nx

6983 B188 linesdepth 12pulls 45 transitivereach 0 importersview sourcekind gate/prooftopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_server_session_recv_cf_test.nx -- close the loopback-class TLS 1.3 server handshake. Smoke construction: 1. Drive server through emit_sf (state == SF_SENT) 2. Snapshot the transcript hash AT THAT POINT (this is what the client would have computed for its Finished) 3. Construct the client Finished record: finished_key_c = HKDF-Expand-Label(c_hs_traffic_secret, "finished", "", 32) verify_data = HMAC-SHA256(finished_key_c, th) plaintext = HT_FINISHED + u24_len + verify_data record = AEAD-encrypt(c_hs_traffic_key, c_hs_iv, client_seq=0, plaintext, CT_HANDSHAKE) 4. Feed the record to recv_cf 5. Assert state == CONNECTED + app keys derived Closed-form invariants: (a) Wrong state -> BAD_STATE (b) Tampered Finished bytes -> PROTOCOL_ERR (HMAC mismatch caught) (c) Honest client Finished -> OK (d) State advances to CONNECTED (e) App traffic secrets + keys + IVs derived (6 non-zero buffers) expect_exit: 0 license_tier: ORIGINAL

dependencies 17 imports · 0 importers

nx_syscalls.nx nx_x25519.nx nx_x25519_ephemeral.nx nx_hmac.nx nx_tls13.nx nx_tls13_hello.nx nx_tls13_kdf.nx nx_tls13_record.nx nx_tls13_transcript.nx nx_tls13_server_session.nx nx_tls13_server_session_recv_c

diagram shows first 10 each side; +7 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_x25519.nxnx_x25519_ephemeral.nxnx_hmac.nxnx_tls13.nxnx_tls13_hello.nxnx_tls13_kdf.nxnx_tls13_record.nxnx_tls13_transcript.nxnx_tls13_server_session.nxnx_tls13_server_session_recv_ch.nxnx_tls13_server_session_emit_sh.nxnx_tls13_server_session_derive_hs.nxnx_tls13_server_session_derive_traffic.nxnx_tls13_server_session_emit_ee.nxnx_tls13_server_session_emit_sf.nxnx_tls13_server_session_recv_cf.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap x25519_keypair_public sys_mmap ↻ x25519_base_point x25519 nx_scratch_save nx_scratch_init sys_mmap ↻ nx_scratch nx_scratch_init ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ fe_alloc nx_scratch ↻ fe_from_bytes fe_one fe_zero fe_zero ↻ fe_copy x25519_ladder_step fe_cswap nx_scratch_save ↻ fe_alloc ↻ fe_add fe_sq fe_mul fe_sub fe_mul ↻ fe_mul_a24 nx_scratch_save ↻ fe_alloc ↻ fe_mul ↻ nx_scratch_restore nx_scratch_restore ↻ fe_cswap ↻ fe_invert nx_scratch_save ↻

structs

none

consts

none

functions

50func build_client_finished_record(
91func main() -> i64