code wiki / (root) / nx_tls13_server_session_run.nx

nx_tls13_server_session_run.nx

buildroot/runtime/nx_tls13_server_session_run.nx

16325 B353 linesdepth 13pulls 60 transitivereach 14 importersview sourcekind tooltopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_server_session_run.nx -- top-level TLS 1.3 server-side handshake orchestrator. The server-side analogue to nx_tls13_client_session_run. Composes the 10 shipped stones over a connected TCP fd to drive a session from INIT to CONNECTED. Pipeline (client → server arrows + arrowed-out server emits): <-- client ClientHello (TLSPlaintext record) [stone 2] recv_ch INIT -> CH_RECEIVED [stone 3] emit_sh + wrap as TLSPlaintext CH_RECEIVED -> SH_SENT --> server ServerHello (TLSPlaintext) [stone 4] derive_hs_secrets SH_SENT -> EE_SENT [stone 5] derive_traffic (no state change) [stone 6] emit_ee (already TLSCiphertext) EE_SENT -> CERT_SENT --> ChangeCipherSpec compatibility record (skipped per RFC 8446 §D.4) --> EncryptedExtensions [stone 6.5] emit_certificate (state stays CERT_SENT) --> Certificate [stone 7.5] emit_cv CERT_SENT -> CV_SENT --> CertificateVerify [stone 7] emit_sf CV_SENT -> SF_SENT --> ServerFinished <-- client Finished (TLSCiphertext) [stone 8] recv_cf SF_SENT -> CONNECTED [derive_app] (already inside recv_cf per stone 8) Public API: nx_tls13_server_session_run(fd, cert_der, cert_der_len, ecdsa_priv_be) -> *Tls13ServerSession (positive cast to i64) on CONNECTED -> negative -(NX_TLS13_SRUN_*) verdict on failure After this returns OK, the caller uses nx_tls13_server_session_app_send / _app_recv to exchange encrypted application_data records. Per Cardinals 9 (single-responsibility: just drive the handshake; app data is a separate layer), 22 (composition only). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_8446 lineage_id: nishi_tls13_server_session_run_q1

dependencies 16 imports · 13 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.nx nx_andelinwest_daemon.nx nx_aw_mtls_proxy.nx nx_aw_tlsproxy.nx nx_cms_tls_front.nx nx_opaque_login_tls_daemon.nx nx_sites_daemon.nx nx_sites_daemon_v2.nx nx_sites_reconciled.nx nx_sites_sni_cert_gate.nx nx_tls13_ed25519_test_daemon.nx

diagram shows first 10 each side; +6 more imports, +3 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_certificate.nxnx_tls13_server_session_emit_cv.nxnx_tls13_server_session_emit_sf.nxnx_tls13_server_session_recv_cf.nx

imported by: nx_andelinwest_daemon.nxnx_aw_mtls_proxy.nxnx_aw_tlsproxy.nxnx_cms_tls_front.nxnx_opaque_login_tls_daemon.nxnx_sites_daemon.nxnx_sites_daemon_v2.nxnx_sites_reconciled.nxnx_sites_sni_cert_gate.nxnx_tls13_ed25519_test_daemon.nxnx_tls13_server_session_run_mtls.nxnx_wiki_https_daemon.nxnx_wiki_https_daemon_mv.nx

structs

none

consts

58const NX_TLS13_SRUN_OK: i64 = 1
59const NX_TLS13_SRUN_READ_CH_FAIL: i64 = 2
60const NX_TLS13_SRUN_RECV_CH_FAIL: i64 = 3
61const NX_TLS13_SRUN_EMIT_SH_FAIL: i64 = 4
62const NX_TLS13_SRUN_WRITE_SH_FAIL: i64 = 5
63const NX_TLS13_SRUN_DERIVE_HS_FAIL: i64 = 6
64const NX_TLS13_SRUN_DERIVE_TRAFFIC_FAIL: i64 = 7
65const NX_TLS13_SRUN_EMIT_EE_FAIL: i64 = 8
66const NX_TLS13_SRUN_WRITE_EE_FAIL: i64 = 9
67const NX_TLS13_SRUN_EMIT_CERT_FAIL: i64 = 10
68const NX_TLS13_SRUN_WRITE_CERT_FAIL: i64 = 11
69const NX_TLS13_SRUN_EMIT_CV_FAIL: i64 = 12
70const NX_TLS13_SRUN_WRITE_CV_FAIL: i64 = 13
71const NX_TLS13_SRUN_EMIT_SF_FAIL: i64 = 14
72const NX_TLS13_SRUN_WRITE_SF_FAIL: i64 = 15
73const NX_TLS13_SRUN_READ_CF_FAIL: i64 = 16
74const NX_TLS13_SRUN_RECV_CF_FAIL: i64 = 17
75const NX_TLS13_SRUN_EMIT_HRR_FAIL: i64 = 18
76const NX_TLS13_SRUN_WRITE_HRR_FAIL: i64 = 19
77const NX_TLS13_SRUN_VERDICT_N: i64 = 20
79const NX_TLS13_SRUN_CH_BUF_BYTES: i64 = 16645
80const NX_TLS13_SRUN_OUT_BUF_BYTES: i64 = 16645
81const NX_TLS13_SRUN_MAX_HS_RECORDS: i64 = 4

functions

83func nx_tls13_srun_verdict_is_valid(v: i64) -> i64
90func _srun_write_n(fd: i64, buf: *u8, n: i64) -> i64
106func _srun_recv_client_hello(fd: i64, s: *Tls13ServerSession) -> i64
162func nx_tls13_server_session_run(
279func nx_tls13_server_session_run_ed25519(
351func main() -> i64