code wiki / (root) / nx_tls13_clientauth_ecdsa.nx

nx_tls13_clientauth_ecdsa.nx

buildroot/runtime/nx_tls13_clientauth_ecdsa.nx

7765 B143 linesdepth 12pulls 35 transitivereach 0 importersview sourcekind tooltopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_clientauth_ecdsa.nx -- TLS 1.3 server-side CLIENT authentication, ECDSA-P256 path (RFC 8446 ยง4.4.3). mTLS rung R5c (the ECDSA half of R3): verify a presented ECDSA-P256 client cert's CertificateVerify over the handshake transcript -- the path R7's live server runs when a browser presents an ECDSA client cert (Chrome/Edge/Windows). Sibling of nx_tls13_server_clientauth (the Ed25519 path). Signature scheme ecdsa_secp256r1_sha256 (0x0403): the client signs SHA-256(content); nx_x509_verify_ecdsa_p256 re-hashes. Signed content is the same 130-byte layout (64*0x20 || "TLS 1.3, client CertificateVerify" || 0x00 || hash). Composes nx_x509 (parse) + nx_x509_verify_ecdsa_p256, and (gate only) hub/nx_x509_build + nx_p256_ecdh to mint a real ECDSA cert + sign a real CertificateVerify. license_tier: ORIGINAL expect_exit: 0

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_x509_build.nx nx_p256_ecdh.nx nx_x509.nx nx_x509_verify_ecdsa.nx nx_tls13_clientauth_ecdsa.nx

imports: nx_syscalls.nxnx_x509_build.nxnx_p256_ecdh.nxnx_x509.nxnx_x509_verify_ecdsa.nx

imported by: nobody (leaf or entry point)

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

main cae_w sys_write sys_mmap u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write ↻ sys_exit sys_mmap ↻ cae_mint sys_mmap ↻ p256_ecdh_derive_priv sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ u256_alloc ↻ u256_load_be p256_modn_load_n u256_cmp u256_sub_with_borrow u256_is_zero u256_store_be u256_load_be ↻ p256_point_alloc nx_scratch ↻

structs

none

consts

16const NX_MAGIC_4096: i64 = 4096
18const NX_CAE_OK: i64 = 0
19const NX_CAE_BAD_CERT: i64 = 1
20const NX_CAE_BAD_SIG: i64 = 2
21const NX_CAE_SS_ECDSA_P256: i64 = 0x0403 // SignatureScheme ecdsa_secp256r1_sha256

functions

24func cae_cv_content(transcript_hash_32: *u8, out_130: *u8) -> i64
38func tls13_verify_client_auth_ecdsa(
61func cae_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: cae_rowmain calls 1: sys_write
62func cae_row(name: *u8, ok: i64) -> i64 { if ok == 1 { cae_w(" PASS " as *u8) } else { cae_w(" FAIL " as *u8) } cae_w(name); cae_w("\n" as *u8); return ok }
called by 1: main calls 1: cae_w
63func cae_hex(src: *u8, n: i64, out: *u8) -> i64 { let hx: *u8 = "0123456789abcdef" as *u8; var i: i64 = 0; while i < n { let c: i64 = src[i] as i64; out[i*2] = hx[(c>>4)&15]; out[i*2+1] = hx[c&15]; i = i + 1 } return n*2 }
called by 1: cae_mint
66func cae_mint(ek: *u8, uid: *u8, out_cert: *u8, cap: i64, out_cl: *i64, out_priv_limbs: *i64) -> i64
80func main() -> i64