code wiki / (root) / nx_tls13_server_session_run_h2.nx

nx_tls13_server_session_run_h2.nx

buildroot/runtime/nx_tls13_server_session_run_h2.nx

14450 B295 linesdepth 13pulls 61 transitivereach 6 importersview sourcekind tooltopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_server_session_run_h2.nx -- TUTOR-BOOTSTRAP SCAFFOLD (Claude, authored under the B1 rung(3) ALPN-h2 SERVER workflow of the R4-H2 HTTP/2-transport ladder), NOT credited as team self-authoring. THE ALPN-h2-SELECTING TLS 1.3 server handshake orchestrator. It is the byte-for-byte twin of nx_tls13_server_session_run.nx (the ECDSA path) EXCEPT the EncryptedExtensions it emits SELECTS ALPN "h2" (via the new nx_tls13_server_session_emit_ee_alpn) instead of the base empty no-ext EE. Consequence (RFC 7301 §3.2 / RFC 8446 §4.3.1): an h2-only sovereign client (nx_tls13_client_session_run_h2) that advertised ALPN ["h2"] sees its protocol SELECTED in the encrypted EE, so a CONNECTED session here means the application-data channel IS HTTP/2 -- the server half of "TLS ALPN selects h2". FOUNDED ON (composes, does NOT reinvent -- anti-orphan law; each imported EXACTLY ONCE, the RC6 double-import landmine avoided): - the SAME 10 server stones nx_tls13_server_session_run imports (recv_ch/emit_sh/emit_hrr/derive_hs/derive_traffic/emit_certificate/emit_cv/ emit_sf/recv_cf) -- the handshake body is identical to the proven base run. - nx_tls13_server_session_emit_ee_alpn (B1 rung(3), NEW): the ALPN-h2 EE stone, called at the EE step IN PLACE of the base emit_ee. We still import nx_tls13_server_session_emit_ee too (the base no-ext stone) so a caller may pick either, AND because the linker include-guards it (it is also pulled transitively) -- importing it once here is the single canonical import. This module deliberately does NOT import nx_tls13_server_session_run.nx (that would double-define _srun_write_n etc.); helpers carry a _srunh2_ prefix and the verdict consts an _H2 namespace so a caller may import BOTH this and the base server run with no symbol clash. BACK-FILL: the team RE-AUTHORS this from the DATA spec via the emitter-of-emitters (X-AUT-006c/e/f); this hand scaffold is the sanctioned one-time bootstrap only (meter-integrity, mirror nx_tls13_server_session_run.nx:1-39 / nx_tls13_client_h2run.nx:1-33). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_8446 + ietf/rfc_7301 + ietf/rfc_9113 lineage_id: nishi_tls13_server_session_run_h2_b1r3

dependencies 17 imports · 3 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_record.nx nx_tls13_read_record_from_fd.nx nx_tls13_transcript.nx nx_tls13_server_session.nx nx_tls13_server_session_recv_ch.nx nx_tls13_server_session_emit_sh.nx nx_tls13_server_session_emit_hrr.n nx_tls13_server_session_derive_hs. nx_tls13_server_session_run_h2 _h2_serve_loopback_gate.nx nx_h2_serve.nx nx_h2_serve_multi.nx

diagram shows first 10 each side; +7 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_read_record_from_fd.nxnx_tls13_transcript.nxnx_tls13_server_session.nxnx_tls13_server_session_recv_ch.nxnx_tls13_server_session_emit_sh.nxnx_tls13_server_session_emit_hrr.nxnx_tls13_server_session_derive_hs.nxnx_tls13_server_session_derive_traffic.nxnx_tls13_server_session_emit_ee.nxnx_tls13_server_session_emit_ee_alpn.nxnx_tls13_server_session_emit_certificate.nxnx_tls13_server_session_emit_cv.nxnx_tls13_server_session_emit_sf.nxnx_tls13_server_session_recv_cf.nx

imported by: _h2_serve_loopback_gate.nxnx_h2_serve.nxnx_h2_serve_multi.nx

structs

none

consts

56const NX_TLS13_SRUNH2_OK: i64 = 1
57const NX_TLS13_SRUNH2_RECV_CH_FAIL: i64 = 3
58const NX_TLS13_SRUNH2_EMIT_SH_FAIL: i64 = 4
59const NX_TLS13_SRUNH2_WRITE_SH_FAIL: i64 = 5
60const NX_TLS13_SRUNH2_DERIVE_HS_FAIL: i64 = 6
61const NX_TLS13_SRUNH2_DERIVE_TRAFFIC_FAIL: i64 = 7
62const NX_TLS13_SRUNH2_EMIT_EE_FAIL: i64 = 8
63const NX_TLS13_SRUNH2_WRITE_EE_FAIL: i64 = 9
64const NX_TLS13_SRUNH2_EMIT_CERT_FAIL: i64 = 10
65const NX_TLS13_SRUNH2_WRITE_CERT_FAIL: i64 = 11
66const NX_TLS13_SRUNH2_EMIT_CV_FAIL: i64 = 12
67const NX_TLS13_SRUNH2_WRITE_CV_FAIL: i64 = 13
68const NX_TLS13_SRUNH2_EMIT_SF_FAIL: i64 = 14
69const NX_TLS13_SRUNH2_WRITE_SF_FAIL: i64 = 15
70const NX_TLS13_SRUNH2_READ_CF_FAIL: i64 = 16
71const NX_TLS13_SRUNH2_RECV_CF_FAIL: i64 = 17
72const NX_TLS13_SRUNH2_EMIT_HRR_FAIL: i64 = 18
73const NX_TLS13_SRUNH2_WRITE_HRR_FAIL: i64 = 19
74const NX_TLS13_SRUNH2_READ_CH_FAIL: i64 = 2
76const NX_TLS13_SRUNH2_CH_BUF_BYTES: i64 = 16645
77const NX_TLS13_SRUNH2_OUT_BUF_BYTES: i64 = 16645
78const NX_TLS13_SRUNH2_MAX_HS_RECORDS: i64 = 4

functions

81func _srunh2_write_n(fd: i64, buf: *u8, n: i64) -> i64
94func _srunh2_recv_client_hello(fd: i64, s: *Tls13ServerSession) -> i64
135func nx_tls13_server_session_run_h2(
220func nx_tls13_server_session_run_h2_ed25519(
293func main() -> i64