code wiki / (root) / nx_tls12_probe.nx

nx_tls12_probe.nx

buildroot/runtime/nx_tls12_probe.nx

11925 B209 linesdepth 6pulls 13 transitivereach 0 importersview sourcekind probetopic tls12
docsdependenciesstructsconstsfunctions

about

nx_tls12_probe.nx -- INCREMENT 1 of the sovereign TLS-1.2 client (the keystone that gets nx_gpu_ctl + Porkbun off curl/wsl and onto sovereign APIs; Vast's console.vast.ai + Porkbun are TLS-1.2-ONLY and our shipped stack is TLS-1.3-only). This probe proves the WIRE + PARSE layer: TCP-connect, send a real TLS-1.2 ClientHello offering TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xC02F) + secp256r1, then read+parse the server's flight (ServerHello / Certificate / ServerKeyExchange / ServerHelloDone) and print what we recovered: negotiated cipher, server_random, cert-chain length, and the server's ECDHE public key. Composes the SAME connect primitive the 1.3 client uses (nx_https_url_connect) so the transport is identical; TLS-1.2 handshake records are PLAINTEXT until ChangeCipherSpec, so the probe reads them raw. Increment 2 adds ECDHE+PRF+Finished; 3 adds GCM records. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_csprng.nx nx_https_url_for_fetch.nx nx_https_url_connect.nx nx_tls12_probe.nx

imports: nx_syscalls.nxnx_csprng.nxnx_https_url_for_fetch.nxnx_https_url_connect.nx

imported by: nobody (leaf or entry point)

structs

none

consts

14const P12_MAGIC_1024: i64 = 1024
15const P12_MAGIC_2048: i64 = 2048
16const P12_MAGIC_65536: i64 = 65536
18const P12_HS: i64 = 22 // record type handshake
19const P12_ALERT: i64 = 21

functions

21func p12_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
calls 1: sys_write
22func p12_putn(v: i64) -> i64
28func p12_puthex(byte: i64) -> i64
32func p12_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
35func p12_b1(d: *u8, o: i64, v: i64) -> i64 { d[o]=(v & 0xff) as u8; return o+1 }
36func p12_b2(d: *u8, o: i64, v: i64) -> i64 { d[o]=((v>>8)&0xff) as u8; d[o+1]=(v&0xff) as u8; return o+2 }
37func p12_b3(d: *u8, o: i64, v: i64) -> i64 { d[o]=((v>>16)&0xff) as u8; d[o+1]=((v>>8)&0xff) as u8; d[o+2]=(v&0xff) as u8; return o+3 }
38func p12_bytes(d: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64=0; while i<n { d[o+i]=s[i]; i=i+1 } return o+n }
42func p12_build_client_hello(host: *u8, hlen: i64, cr_out: *u8, out: *u8) -> i64
87func p12_write_all(fd: i64, buf: *u8, n: i64) -> i64
calls 1: sys_write
93func main(argc: i64, argv: *i64) -> i64