nx_tls13_full_tcp_test.nx
buildroot/runtime/nx_tls13_full_tcp_test.nx
about
nx_tls13_full_tcp_test.nx -- full TLS 1.3 handshake over real TCP
with AEAD-protected EE/Cert/CV/SF/CF records using the
handshake-derived traffic keys.
Wire bytes (from ServerHello onward) bit-identical to real TLS 1.3.
Built per F6 friction-catalog discipline: every function <10 lets
+ <6 params + single-line call args, no monolithic run_client.
expect_exit: 0
license_tier: ORIGINAL
dependencies 13 imports · 0 importers
diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_connect.nxnx_x25519.nxnx_tls13.nxnx_tls13_ext.nxnx_tls13_hello.nxnx_tls13_finished.nxnx_tls13_transcript.nxnx_tls13_handshake.nxnx_tls13_schedule.nxnx_tls13_client.nxnx_tls13_server.nxnx_tls13_record.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 27 | const TEST_PORT: i64 = 19446 |
functions
| 31 | func build_addr(out: *u8, port: i64) -> i64 called by 1: main |
| 41 | func read_n(fd: i64, buf: *u8, n: i64) -> i64 |
| 51 | func send_plain(fd: i64, buf: *u8, n: i64) -> i64 |
| 62 | func recv_plain(fd: i64, buf: *u8, cap: i64) -> i64 |
| 73 | func send_aead(fd: i64, key: *u8, iv: *u8, seq: i64, payload: *u8, payload_len: i64) -> i64 called by 2: run_client_finishserver_send_encrypted_flight calls 3: sys_mmapnx_tls13_record_encryptsys_write |
| 85 | func recv_aead(fd: i64, key: *u8, iv: *u8, seq: i64, out: *u8, out_cap: i64) -> i64 |
| 105 | func setup_keypair(priv: *u8, pub: *u8) -> i64 |
| 114 | func fill_client_priv(out: *u8) -> i64 called by 1: run_client |
| 126 | func fill_server_priv(out: *u8) -> i64 called by 1: run_server |
| 138 | func fill_empty_hash(out: *u8) -> i64 |
| 150 | func fill_client_random(out: *u8) -> i64 called by 1: emit_and_send_ch |
| 156 | func fill_server_random(out: *u8) -> i64 called by 1: run_server |
| 162 | func fill_sni_example_com(out: *u8) -> i64 called by 1: emit_and_send_ch |
| 172 | func alloc_key_bundle() -> *u8 |
| 184 | func bundle_ptr(bundle: *u8, slot: i64) -> *u8 |
| 190 | func derive_handshake_keys(my_priv: *u8, peer_pub: *u8, th: *u8, eh: *u8, bundle: *u8) -> i64 |
| 203 | func emit_and_send_ch(fd: i64, c_pub: *u8, ch_out: *u8, ch_cap: i64) -> i64 called by 1: run_client calls 5: sys_mmapfill_client_randomfill_sni_example_comtls13_client_hello_emitsend_plain |
| 216 | func parse_sh_recover_pub(sh: *u8, sh_len: i64, pub_out_slot: *i64) -> i64 |
| 233 | func build_transcript_th(ch: *u8, ch_len: i64, sh: *u8, sh_len: i64, th_out: *u8, tx_out_slot: *i64) -> i64 |
| 243 | func aead_dispatch(fd: i64, key: *u8, iv: *u8, seq: i64, st: i64, shts: *u8, tx: *u8) -> i64 |
| 255 | func run_client_finish(fd: i64, bundle: *u8, tx: *u8) -> i64 called by 1: run_client calls 6: bundle_ptraead_dispatchsys_mmaptls13_client_emit_finishedsend_aeadread_n |
| 285 | func run_client(cfd: i64) -> i64 called by 1: main calls 11: sys_mmapfill_client_privsetup_keypairemit_and_send_chrecv_plainparse_sh_recover_pub+5 |
| 318 | func parse_ch_recover_pub(ch: *u8, ch_len: i64, sid_off_out: *i64, sid_len_out: *i64, pub_out_slot: *i64) -> i64 |
| 334 | func build_canned_payloads(ee: *u8, cert: *u8, cv: *u8) -> i64 called by 1: server_send_encrypted_flight |
| 357 | func compute_sf(s_tx: *u8, shts: *u8, sf_out: *u8) -> i64 |
| 371 | func server_send_encrypted_flight(fd: i64, bundle: *u8, s_tx: *u8) -> i64 |
| 395 | func server_recv_cf_and_ack(fd: i64, bundle: *u8, s_tx: *u8) -> i64 called by 1: run_server calls 5: bundle_ptrsys_mmaprecv_aeadtls13_server_dispatch_client_finishedsys_write |
| 413 | func run_server(cfd: i64) -> i64 called by 1: main calls 14: sys_mmapfill_server_privsetup_keypairrecv_plainparse_ch_recover_pubfill_server_random+8 |
| 451 | func main() -> i64 |