code wiki / (root) / nx_trust_store_load_from_certdata.nx

nx_trust_store_load_from_certdata.nx

buildroot/runtime/nx_trust_store_load_from_certdata.nx

6289 B143 linesdepth 6pulls 8 transitivereach 459 importersview sourcekind tooltopic trust
docsdependenciesstructsconstsfunctions

about

nx_trust_store_load_from_certdata.nx -- BOOT-TIME CA TRUST STORE LOADER from a Mozilla NSS `certdata.txt` file on disk. Step 6 of the nx_https_client wiring arc -- the convenience wrapper that turns 3 shipped substrate primitives + 1 syscall helper into ONE boot-time call. After this primitive lands, the only remaining gap to first-byte-of-real-public-HTTPS is the actual Mozilla bundle file drop. Composes: 1. sys_read_file -- slurp the whole certdata.txt 2. nx_nss_certdata_parse -- text -> wire-format bundle 3. trust_store_alloc -- allocate the TrustStore 4. nx_x509_trust_store_load -- wire bundle -> populated store Plus internal: caller-tunable intermediate-buffer cap (the parsed wire-format bundle is held in RAM between the parse step and the load step; the buffer is sized at call time). Public API: nx_trust_store_load_from_certdata( path: *u8, NUL-terminated path to certdata.txt max_anchors: i64, trust_store_alloc capacity hint (typical Mozilla bundle ~150 CAs) parse_buf_cap: i64 intermediate wire-bundle buffer cap (typical Mozilla bundle ~250KB DER) ) -> POSITIVE store pointer (cast to i64) | NEGATIVE -verdict nx_trust_store_load_from_certdata_verdict_is_valid(v) -> 0|1 Sealed verdict enum: NX_TS_LOAD_CD_OK store loaded + ready to use NX_TS_LOAD_CD_FILE_FAIL sys_read_file returned empty (file missing / permission / IO) NX_TS_LOAD_CD_PARSE_FAIL nx_nss_certdata_parse returned non-OK (malformed/truncated text) NX_TS_LOAD_CD_LOAD_FAIL nx_x509_trust_store_load returned non-OK (bad DER / store full) NX_TS_LOAD_CD_ZERO_CERTS parse succeeded but 0 certs

dependencies 4 imports · 330 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_x509_trust_store_load.nx nx_nss_certdata_parse.nx nx_trust_store_load_from_certd _h2_fetch_google.nx _h2_fetch_rumble.nx _h2_probe_imgsearch.nx _h2_probe_imgsearch_ua.nx _h2_reach_probe.nx nishi.nx nx_access_research_fetch.nx nx_acme_directory_live.nx nx_acme_directory_live_real_ca_tes nx_acme_dns01_propagation_gate.nx

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

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_x509_trust_store_load.nxnx_nss_certdata_parse.nx

imported by: _h2_fetch_google.nx_h2_fetch_rumble.nx_h2_probe_imgsearch.nx_h2_probe_imgsearch_ua.nx_h2_reach_probe.nxnishi.nxnx_access_research_fetch.nxnx_acme_directory_live.nxnx_acme_directory_live_real_ca_test.nxnx_acme_dns01_propagation_gate.nxnx_acme_http.nxnx_adnet_research_fetch.nxnx_agentcap_sota_fetch.nxnx_apertus_mirror_nas.nxnx_apertus_shards_pull.nxnx_apertus_smallfiles.nxnx_apertus_tree_fetch.nxnx_api_sota_fetch.nxnx_apimcp_research_fetch.nxnx_app_monitor.nxnx_archive_capture_demo.nxnx_archive_daemon.nxnx_archive_live.nxnx_archive_media_fetch.nxnx_archive_site_viewer.nxnx_archive_viewer.nxnx_archive_xcapture_fetch.nxnx_asr_research_fetch.nxnx_aw_verify_gate.nxnx_award_ui_research_fetch.nxnx_barcheck.nxnx_battery_research_fetch.nxnx_bench_fetch.nxnx_bench_warc.nxnx_bf_live.nxnx_brand_exceed_research_fetch.nxnx_brand_research_fetch.nxnx_browse.nxnx_browser.nxnx_browser_fetch_probe.nxnx_browser_own_site_live_test.nxnx_bulk_index.nxnx_cad_verify_gate.nxnx_cadtwin_research.nxnx_cadtwin_research2.nxnx_cc_datahost_probe.nxnx_cc_ingest.nxnx_cc_record_fetch.nxnx_cc_warc_fetch.nxnx_cdnaccess_research_fetch.nxnx_cert_autorenew.nxnx_cf_access_probe.nxnx_chain_pipeline_real_test.nxnx_chrome_fetch_probe.nxnx_claim_verify.nxnx_clean_serve_daemon.nxnx_cleanview.nxnx_cleanwatch_serve.nxnx_click_test.nxnx_codec_research_fetch.nxnx_commoncrawl_probe.nxnx_commoncrawl_query.nxnx_compare_instrument_verify.nxnx_compare_registry_assemble.nxnx_connect_live_verify.nxnx_connect_research_fetch.nxnx_corpus_fetch.nxnx_crawl_preserve.nxnx_crawl_web.nxnx_crew_live_verify.nxnx_dev_api_build_probe.nxnx_dev_api_live_check.nxnx_dist_verify.nxnx_dlperf_research_fetch.nxnx_dm_research_fetch.nxnx_dmn_research_fetch.nxnx_doc_research_fetch.nxnx_docpub_research_fetch.nxnx_doctor_research_fetch.nxnx_doh_probe.nxnx_download_research_fetch.nxnx_dr_research_fetch.nxnx_eco_research_fetch.nxnx_eda_tooling_research_fetch.nxnx_edge_probe.nxnx_edge_watchdog.nxnx_effbench_research_fetch.nxnx_elara_ref_fetch.nxnx_emit_sota_fetch.nxnx_entity_card.nxnx_ereader_sota_fetch.nxnx_erotica_research_fetch.nxnx_evidence_research_fetch.nxnx_fabric_research_fetch.nxnx_feedfetch.nxnx_fetch.nxnx_fetch_any.nxnx_fetch_jellyfin_test.nxnx_fetch_print.nxnx_fetch_to_file.nx +230 more (shown cap 100 declared)

structs

none

consts

81const NX_TS_LOAD_CD_OK: i64 = 1
82const NX_TS_LOAD_CD_FILE_FAIL: i64 = 2
83const NX_TS_LOAD_CD_PARSE_FAIL: i64 = 3
84const NX_TS_LOAD_CD_LOAD_FAIL: i64 = 4
85const NX_TS_LOAD_CD_ZERO_CERTS: i64 = 5
86const NX_TS_LOAD_CD_VERDICT_N: i64 = 6

functions

88func nx_trust_store_load_from_certdata_verdict_is_valid(v: i64) -> i64
called by 1: main
97func nx_trust_store_load_from_certdata(
141func main() -> i64