code wiki / (root) / nx_tls13_auth.nx

nx_tls13_auth.nx

buildroot/runtime/nx_tls13_auth.nx

11648 B274 linesdepth 2pulls 3 transitivereach 531 importersview sourcekind librarytopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_auth.nx -- TLS 1.3 auth-related handshake message parsers. Phase 0b §H of the Nishi TLS 1.3 stack per docs/NISHI_TLS13_GAP_AUDIT.md. Pure-byte parsers for the three server-side handshake messages that follow ServerHello in a TLS 1.3 1-RTT flow: 1. EncryptedExtensions (RFC 8446 §4.3.1) Just an extensions blob; carries server-side extensions that the spec wants encrypted (max_fragment_length, ALPN pick, etc.). 2. Certificate (RFC 8446 §4.4.2) certificate_request_context: opaque<0..255> (1 byte len) certificate_list: per entry: opaque cert_data<1..2^24-1> (3 byte len) Extension extensions<0..2^16-1> (2 byte len) 3. CertificateVerify (RFC 8446 §4.4.3) SignatureScheme algorithm (2 bytes) opaque signature<0..2^16-1> (2 byte len) All three sit inside the standard Handshake wrapper (msg_type + uint24 length). This module does NO cryptographic validation -- signature verification, cert chain validation, hostname matching all live in Gap I (nx_x509_validate, queued). Here we just turn bytes into structure offsets the caller can hand to the verifier. What it does today: - parse EncryptedExtensions; expose extensions blob offsets - parse Certificate; expose FIRST cert's DER bytes + extensions offsets (most TLS 1.3 deployments use a 1-3 cert chain; iterating beyond the first is queued) - parse CertificateVerify; expose scheme + signature offsets - sealed verdict on every failure path What it doesn't do yet: - iterate every cert in chain (caller can re-call into the chain after the first; tls13_parse_certificate_chain_at queued)

dependencies 2 imports · 9 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_auth.nx nx_https_cert_pipeline.nx nx_porkbun_ping_probe.nx nx_tls13_auth_test.nx nx_tls13_client.nx nx_tls13_client_verify_cv.nx nx_tls13_mtls_recv_cert.nx nx_tls13_server_recv_client_cert.n nx_tls13_server_recv_client_cv.nx nx_tls13_server_session_run_mtls.n

imports: nx_syscalls.nxnx_tls13.nx

imported by: nx_https_cert_pipeline.nxnx_porkbun_ping_probe.nxnx_tls13_auth_test.nxnx_tls13_client.nxnx_tls13_client_verify_cv.nxnx_tls13_mtls_recv_cert.nxnx_tls13_server_recv_client_cert.nxnx_tls13_server_recv_client_cv.nxnx_tls13_server_session_run_mtls.nx

structs

none

consts

73const NX_TLS13_AUTH_VERDICT_OK: i64 = 1
74const NX_TLS13_AUTH_VERDICT_BAD_HEADER: i64 = 2
75const NX_TLS13_AUTH_VERDICT_TRUNCATED: i64 = 3
76const NX_TLS13_AUTH_VERDICT_EMPTY_CHAIN: i64 = 4
77const NX_TLS13_AUTH_VERDICT_TOO_LONG: i64 = 5
78const NX_TLS13_AUTH_VERDICT_TOO_MANY_CERTS: i64 = 6
79const NX_TLS13_AUTH_VERDICT_N: i64 = 7
84const NX_TLS13_AUTH_MAX_MESSAGE: i64 = 16384

functions

89func tls13_auth_check_handshake(buf: *u8, n: i64, expected_type: i64) -> i64
104func tls13_parse_encrypted_extensions(
131func tls13_parse_certificate_chain_first(
182func tls13_parse_certificate_verify(
218func tls13_parse_certificate_chain_all(
270func nx_tls13_auth_verdict_is_valid(v: i64) -> i64
called by 1: main