nx_tls13_ext.nx
buildroot/runtime/nx_tls13_ext.nx
about
nx_tls13_ext.nx -- TLS 1.3 extension emitters + ServerHello parsers.
Phase 0b §F.1 of the Nishi TLS 1.3 stack per
docs/NISHI_TLS13_GAP_AUDIT.md. The byte-level emit functions
for the 5 extensions a minimum-credible TLS 1.3 ClientHello
MUST carry, plus parse functions for the two extensions a
ServerHello echoes back (supported_versions + key_share).
Per RFC 8446 §9.2: any TLS 1.3 ClientHello MUST contain
supported_versions, supported_groups, key_share, and
signature_algorithms. We add server_name (RFC 6066 §3) so
we can talk to TLS-vhosted servers, and we make ALPN
trivially extendable.
Wire format per extension is:
uint16 extension_type
uint16 extension_data_length
opaque extension_data[extension_data_length]
What it does today:
Client emit:
- server_name (SNI, RFC 6066 §3, host_name only)
- supported_versions client-variant TLS 1.3 only (§4.2.1)
- supported_groups X25519 + secp256r1 (§4.2.7)
- signature_algorithms ed25519 + rsa_pss_rsae_sha256 +
rsa_pss_rsae_sha384 + ecdsa_secp256r1_sha256 (§4.2.3)
- key_share client X25519 only (§4.2.8)
Server parse:
- supported_versions server-variant (single u16) (§4.2.1)
- key_share server-variant (single KeyShareEntry) (§4.2.8)
What it doesn't do yet:
- ALPN emit/parse (queued; single-protocol case is trivial,
multi-protocol needs a more general list helper)
- psk_key_exchange_modes (queued with Gap M resumption)
- pre_shared_key (queued with Gap M)
- cookie (HRR path; queued with Gap G)
- additional cert chain extensions (status_request, SCT)
- additional named groups (P-384, P-521, Kyber, X25519+Kyber768)
- additional signature schemes (ecdsa_secp384r1_sha384,
dependencies 2 imports · 17 importers
diagram shows first 10 each side; +0 more imports, +7 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tls13.nx
imported by: nx_h2_conformance.nxnx_https_get_happy_test.nxnx_https_loopback_test.nxnx_p256_keyshare_test.nxnx_sni_extract_gate.nxnx_sni_router_gate.nxnx_tls12_hello.nxnx_tls13_alpn_test.nxnx_tls13_ext_test.nxnx_tls13_full_tcp_test.nxnx_tls13_handshake_io.nxnx_tls13_handshake_tcp_test.nxnx_tls13_hello.nxnx_tls13_hello_test.nxnx_tls13_loopback_test.nxnx_tls13_server_session_emit_ee_alpn.nxnx_tls13_server_session_emit_sh.nx
structs
| none |
consts
| 63 | const NX_MAGIC_65535: i64 = 65535 |
| 66 | const NX_TLS13_EXT_VERDICT_OK: i64 = 1 |
| 67 | const NX_TLS13_EXT_VERDICT_BUF_OVERFLOW: i64 = 2 |
| 68 | const NX_TLS13_EXT_VERDICT_BAD_FORMAT: i64 = 3 |
| 69 | const NX_TLS13_EXT_VERDICT_TRUNCATED: i64 = 4 |
| 70 | const NX_TLS13_EXT_VERDICT_UNSUPPORTED: i64 = 5 |
| 71 | const NX_TLS13_EXT_VERDICT_N: i64 = 6 |
| 74 | const NX_TLS13_SNI_NAME_TYPE_HOST: i64 = 0 |
functions
| 91 | func tls13_ext_emit_server_name( |
| 121 | func tls13_ext_emit_supported_versions_tls13(out: *u8, out_cap: i64) -> i64 |
| 161 | func tls13_ext_emit_alpn_http11(out: *u8, out_cap: i64) -> i64 |
| 196 | func tls13_ext_emit_alpn_h2_http11(out: *u8, out_cap: i64) -> i64 |
| 240 | func tls13_ext_emit_alpn_h2_only(out: *u8, out_cap: i64) -> i64 called by 3: maintls13_client_hello_emit2_h2onlynx_tls13_server_session_emit_ee_alpn calls 1: tls_write_u16_be |
| 272 | func tls13_ext_parse_alpn_selected( |
| 300 | func tls13_ext_emit_supported_groups(out: *u8, out_cap: i64) -> i64 |
| 323 | func tls13_ext_emit_signature_algorithms(out: *u8, out_cap: i64) -> i64 |
| 355 | func tls13_ext_emit_key_share_x25519( |
| 387 | func tls13_ext_emit_key_share_dual( |
| 423 | func tls13_ext_emit_key_share_p256( |
| 449 | func tls13_ext_parse_supported_versions_server( |
| 464 | func tls13_ext_parse_key_share_server( |
| 481 | func nx_tls13_ext_verdict_is_valid(v: i64) -> i64 called by 1: main |