code wiki / (root) / nx_tls13_server_session_run_mtls.nx

nx_tls13_server_session_run_mtls.nx

buildroot/runtime/nx_tls13_server_session_run_mtls.nx

11841 B207 linesdepth 14pulls 71 transitivereach 2 importersview sourcekind tooltopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_server_session_run_mtls.nx -- R7: the live-terminator mTLS handshake run loop (Ed25519 server cert path). Composes the proven server stones + the gated mTLS rungs into the full mutual-TLS handshake: recv ClientHello -> ServerHello -> derive -> EncryptedExtensions -> CertificateRequest (rung 7a, request-NOT-require) -> server Certificate -> server CertificateVerify(Ed25519) -> server Finished -> [snapshot th_app = transcript THROUGH ServerFinished -- the app-key context] -> client Certificate (rung 7b logic, EMPTY-cert aware) [-> client CertificateVerify+verify (rung 7c)] -> client Finished (mTLS-aware: MAC over THROUGH-CLIENT-CV, app keys over th_app) -> CONNECTED out_auth: 0 = client presented NO cert (handshake still completes -> caller falls back to the X-Nishi-Session header path: NEVER-LOCKOUT), 1 = a client cert was presented + its CertificateVerify VERIFIED (the identity is in out_client_cert), -1 = a cert was presented but verification FAILED (deny). Because the request is not-require, a no-cert or bad-cert client never breaks the handshake -- it just gets no mTLS identity. NOT in-process gateable (there is no Nishi mTLS CLIENT to loopback-present a cert); its live behavior -- the browser's empty-cert response + the dual-snapshot key schedule -- is verified against a real browser presenting one of the provisioned .p12 files. Deploy is request-not-require + backup/rollback => safe: every NON-cert client completes exactly as today. license_tier: ORIGINAL

dependencies 15 imports · 2 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_record.nx nx_tls13_transcript.nx nx_tls13_kdf.nx nx_hmac.nx nx_hkdf.nx nx_tls13_server_session.nx nx_tls13_read_record_from_fd.nx nx_tls13_server_session_run.nx nx_tls13_server_session_run_mt nx_aw_mtls_proxy.nx nx_mtls_test_daemon.nx

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

imports: nx_syscalls.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_transcript.nxnx_tls13_kdf.nxnx_hmac.nxnx_hkdf.nxnx_tls13_server_session.nxnx_tls13_read_record_from_fd.nxnx_tls13_server_session_run.nxnx_tls13_server_session_emit_certreq.nxnx_tls13_auth.nxnx_tls13_server_recv_client_cv.nxnx_tls13_mtls_finished.nxnx_tls13_mtls_recv_cert.nx

imported by: nx_aw_mtls_proxy.nxnx_mtls_test_daemon.nx

structs

none

consts

36const NX_MRUN_CV_LEN: i64 = 32
37const NX_MRUN_REC_HEADER: i64 = 5
38const NX_MRUN_REC_TAG: i64 = 16
39const NX_MRUN_BUF: i64 = 16645

functions

41func _mrun_write(fd: i64, buf: *u8, n: i64) -> i64
48func _mrun_read_hs(fd: i64, buf: *u8, cap: i64) -> i64
68func nx_tls13_server_session_run_ed25519_mtls(
140func nx_tls13_server_session_run_ecdsa_mtls(
207func main() -> i64 { return 0 }