nx_tls12_probe.nx
buildroot/runtime/nx_tls12_probe.nx
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
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
| 14 | const P12_MAGIC_1024: i64 = 1024 |
| 15 | const P12_MAGIC_2048: i64 = 2048 |
| 16 | const P12_MAGIC_65536: i64 = 65536 |
| 18 | const P12_HS: i64 = 22 // record type handshake |
| 19 | const P12_ALERT: i64 = 21 |
functions
| 21 | func 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 |
| 22 | func p12_putn(v: i64) -> i64 |
| 28 | func p12_puthex(byte: i64) -> i64 |
| 32 | func p12_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 35 | func p12_b1(d: *u8, o: i64, v: i64) -> i64 { d[o]=(v & 0xff) as u8; return o+1 } called by 1: p12_build_client_hello |
| 36 | func 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 } called by 1: p12_build_client_hello |
| 37 | func 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 } called by 1: p12_build_client_hello |
| 38 | func 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 } called by 1: p12_build_client_hello |
| 42 | func p12_build_client_hello(host: *u8, hlen: i64, cr_out: *u8, out: *u8) -> i64 |
| 87 | func p12_write_all(fd: i64, buf: *u8, n: i64) -> i64 calls 1: sys_write |
| 93 | func main(argc: i64, argv: *i64) -> i64 |