nx_tls13_auth.nx
buildroot/runtime/nx_tls13_auth.nx
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
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
| 73 | const NX_TLS13_AUTH_VERDICT_OK: i64 = 1 |
| 74 | const NX_TLS13_AUTH_VERDICT_BAD_HEADER: i64 = 2 |
| 75 | const NX_TLS13_AUTH_VERDICT_TRUNCATED: i64 = 3 |
| 76 | const NX_TLS13_AUTH_VERDICT_EMPTY_CHAIN: i64 = 4 |
| 77 | const NX_TLS13_AUTH_VERDICT_TOO_LONG: i64 = 5 |
| 78 | const NX_TLS13_AUTH_VERDICT_TOO_MANY_CERTS: i64 = 6 |
| 79 | const NX_TLS13_AUTH_VERDICT_N: i64 = 7 |
| 84 | const NX_TLS13_AUTH_MAX_MESSAGE: i64 = 16384 |
functions
| 89 | func tls13_auth_check_handshake(buf: *u8, n: i64, expected_type: i64) -> i64 |
| 104 | func tls13_parse_encrypted_extensions( called by 2: maintls13_client_dispatch_handshake_message calls 2: tls13_auth_check_handshaketls_read_u16_be |
| 131 | func tls13_parse_certificate_chain_first( |
| 182 | func tls13_parse_certificate_verify( |
| 218 | func tls13_parse_certificate_chain_all( |
| 270 | func nx_tls13_auth_verdict_is_valid(v: i64) -> i64 called by 1: main |