code wiki / (root) / nx_tls13_client_validate_certificate.nx

nx_tls13_client_validate_certificate.nx

buildroot/runtime/nx_tls13_client_validate_certificate.nx

7614 B166 linesdepth 15pulls 75 transitivereach 507 importersview sourcekind tooltopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_client_validate_certificate.nx -- the FORMAL bridge between the TLS 1.3 client state machine's WAIT_CERT state and the X.509 cert pipeline shipped earlier today. Phase 0b §L sub-3 of the TLS client arc, AND Arc A step 3 of the nx_https_client wiring roadmap. The existing nx_tls13_client dispatcher (commit pre-dating this session) has an explicit STUB at line 154-157 of nx_tls13_client.nx: // STUB: cert validation deferred to Gap I. We currently // accept ANY presented certificate, which means this client // is NOT safe to use against an untrusted network until // Gap I lands. We BUILT Gap I today: nx_https_cert_pipeline_verify_with_store (commit f294961e) does full RFC 5280 path validation against a TrustStore. This primitive is the SHIM that lets the TLS dispatcher close that stub. API: struct TlsValidationContext { store: *TrustStore, sni_host: *u8, sni_host_len: i64, now_epoch: i64, } nx_tls13_client_validate_certificate( cert_msg_bytes, cert_msg_len, val_ctx ) -> verdict nx_tls13_client_cv_verdict_is_valid(v) -> 0|1 Sealed verdict enum: NX_TLS13_CLIENT_CV_OK chain valid + SAN matches SNI NX_TLS13_CLIENT_CV_CERT_MSG_BAD Cert message format error NX_TLS13_CLIENT_CV_NOT_YET_VALID leaf cert not yet valid NX_TLS13_CLIENT_CV_EXPIRED leaf cert expired NX_TLS13_CLIENT_CV_HOSTNAME_FAIL no SAN entry matches SNI

dependencies 3 imports · 87 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_https_cert_pipeline.nx nx_tls13_client_validate_certi _dlr_probe.nx _h2_fetch_google.nx _h2_fetch_rumble.nx _h2_probe_imgsearch.nx _h2_probe_imgsearch_ua.nx _h2_reach_probe.nx nx_acme_directory_live.nx nx_acme_directory_live_real_ca_tes nx_acme_http.nx nx_app_monitor.nx

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

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_https_cert_pipeline.nx

imported by: _dlr_probe.nx_h2_fetch_google.nx_h2_fetch_rumble.nx_h2_probe_imgsearch.nx_h2_probe_imgsearch_ua.nx_h2_reach_probe.nxnx_acme_directory_live.nxnx_acme_directory_live_real_ca_test.nxnx_acme_http.nxnx_app_monitor.nxnx_aw_verify_gate.nxnx_browser_own_site_live_test.nxnx_cad_verify_gate.nxnx_cert_autorenew.nxnx_cms_tls_gate.nxnx_connect_live_verify.nxnx_crew_live_verify.nxnx_dev_api_build_probe.nxnx_edge_probe.nxnx_fetch_jellyfin_test.nxnx_funcheck.nxnx_gallery_auth_research_fetch.nxnx_hf_probe.nxnx_hifigan_stream_fetch.nxnx_hls_live_probe.nxnx_https_fetch.nxnx_https_fetch_file.nxnx_https_fetch_follow.nxnx_https_fetch_lib.nxnx_https_get.nxnx_https_get_cli.nxnx_https_get_cli2.nxnx_https_get_happy_test.nxnx_https_get_live_demo_test.nxnx_https_get_live_google_test.nxnx_https_get_live_real_ca_test.nxnx_https_ka_probe.nxnx_hub_lib_verify_gate.nxnx_hub_verify_gate.nxnx_iot_fetch_probe.nxnx_iot_verify_gate.nxnx_kaprobe.nxnx_lib_fetch.nxnx_library_fetch.nxnx_login_e2e_probe.nxnx_model_fetch.nxnx_night_fetch_test.nxnx_nist_verify_gate.nxnx_office_live_verify.nxnx_onsite_frontier_fetch.nxnx_onsite_research_fetch.nxnx_orch_verify_gate.nxnx_porkbun_ping_probe.nxnx_research_fetch_wiki_test.nxnx_research_ka.nxnx_room_live_gate.nxnx_room_perf_gate.nxnx_scilib_verify_gate.nxnx_sclass_ux_research_fetch.nxnx_semantic_research_fetch.nxnx_site_probe.nxnx_survey_live_verify.nxnx_tls12_client.nxnx_tls12_client_session.nxnx_tls12_handshake_gate.nxnx_tls12_mutant.nxnx_tls13_cert_cache_gate.nxnx_tls13_client_dispatch_with_validation.nxnx_tls13_client_dispatch_with_validation_test.nxnx_tls13_client_h2run.nxnx_tls13_client_session_recv_hs.nxnx_tls13_client_session_recv_hs_test.nxnx_tls13_client_session_run.nxnx_tls13_client_session_run_test.nxnx_tls13_client_validate_certificate_test.nxnx_tls_cert_cache.nxnx_tlsprobe.nxnx_torrent_live_probe.nxnx_url_probe.nxnx_url_truth_gate.nxnx_uxf_fetch_avro.nxnx_uxf_fetch_protobuf.nxnx_web_crawl_breadth.nxnx_web_crawl_index.nxnx_webpub_fetch.nxnx_ws_client_session.nxnx_zerodt_fetch.nx

structs

82struct TlsValidationContext

consts

72const NX_TLS13_CLIENT_CV_OK: i64 = 1
73const NX_TLS13_CLIENT_CV_CERT_MSG_BAD: i64 = 2
74const NX_TLS13_CLIENT_CV_NOT_YET_VALID: i64 = 3
75const NX_TLS13_CLIENT_CV_EXPIRED: i64 = 4
76const NX_TLS13_CLIENT_CV_HOSTNAME_FAIL: i64 = 5
77const NX_TLS13_CLIENT_CV_CHAIN_FAIL: i64 = 6
78const NX_TLS13_CLIENT_CV_NO_TRUST: i64 = 7
79const NX_TLS13_CLIENT_CV_OTHER: i64 = 8
80const NX_TLS13_CLIENT_CV_VERDICT_N: i64 = 9

functions

99func nx_tls13_client_cv_verdict_is_valid(v: i64) -> i64
called by 1: main
115func nx_tls13_cv_memeq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
122func nx_tls13_client_validate_certificate(
164func main() -> i64