code wiki / (root) / nx_x509_verify_under_issuer.nx

nx_x509_verify_under_issuer.nx

buildroot/runtime/nx_x509_verify_under_issuer.nx

14503 B291 linesdepth 12pulls 64 transitivereach 522 importersview sourcekind tooltopic x509
docsdependenciesstructsconstsfunctions

about

nx_x509_verify_under_issuer.nx -- per-cert outer-signature verify against an issuer's pubkey, dispatching by sig_alg + pubkey_alg. Phase 0b §I.4 piece 5 of the chain-walker arc. This is the per-cert step the chain walker repeats from leaf to root: for each (cert, issuer) pair in the chain: nx_x509_verify_under_issuer(buf, cert, issuer_buf, issuer_cert) Dispatch: 1. Identify cert's outer sig_alg from cert.sig_alg_off/_len 2. Identify issuer's pubkey_alg from issuer.pubkey_alg_off/_len 3. Assert the sig_alg and pubkey_alg pair is consistent (e.g., ECDSA-P256-SHA-256 sig requires EC-P256 pubkey). 4. Extract issuer's pubkey via the alg-specific extractor. 5. Verify cert.tbs's outer sig under that pubkey via the alg-specific verifier. Composes 6 substrate primitives: nx_x509_sig_alg.nx (sig_alg OID identify) nx_x509_pubkey_alg.nx (pubkey_alg OID identify) nx_x509_pubkey_ec.nx (extract EC P-256 X, Y) nx_x509_pubkey_ed.nx (extract Ed25519 32-byte key) nx_x509_verify_ecdsa.nx (verify ECDSA-P256+SHA-256) nx_x509_validate.nx (verify Ed25519 raw sig) Sealed verdict enum (one for the whole pipeline): NX_X509_VUI_OK verify succeeded NX_X509_VUI_SIG_ALG_UNSUPPORTED cert sig_alg not recognized NX_X509_VUI_PUB_ALG_UNSUPPORTED issuer pubkey_alg not recognized NX_X509_VUI_ALG_MISMATCH sig_alg requires different pubkey alg NX_X509_VUI_PUBKEY_EXTRACT_FAIL pubkey extractor returned non-OK NX_X509_VUI_VERIFY_FAIL verifier returned non-OK Per Cardinals 9 (single-responsibility -- this is JUST dispatch + orchestration; each step has its own primitive), 12 (defensive at boundaries -- algorithm pairing check is the boundary), 22 (composition -- 6 primitives compose), 23 (preamble names every dispatch case). license_tier: INDEPENDENT_REDERIVE

dependencies 20 imports · 7 importers

nx_syscalls.nx nx_u256.nx nx_u384.nx nx_x509.nx nx_x509_sig_alg.nx nx_x509_pubkey_alg.nx nx_x509_pubkey_ec.nx nx_x509_pubkey_ed.nx nx_x509_verify_ecdsa.nx nx_x509_verify_ecdsa_p384.nx nx_x509_verify_under_issuer.nx nx_chain_full_real_test.nx nx_chain_pair_leaf_real_test.nx nx_chain_pair_real_diag_test.nx nx_ecdsa_p384_real_bisect_test.nx nx_x509_chain_verify.nx nx_x509_chain_verify_test.nx nx_x509_verify_under_issuer_test.n

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

imports: nx_syscalls.nxnx_u256.nxnx_u384.nxnx_x509.nxnx_x509_sig_alg.nxnx_x509_pubkey_alg.nxnx_x509_pubkey_ec.nxnx_x509_pubkey_ed.nxnx_x509_verify_ecdsa.nxnx_x509_verify_ecdsa_p384.nxnx_x509_verify_rsa_pkcs1_sha256.nxnx_x509_pubkey_rsa.nxnx_u2048.nxnx_u4096.nxnx_x509_pubkey_rsa_4096.nxnx_x509_verify_rsa_pkcs1_sha256_4096.nxnx_rsa_pkcs1_v1_5_sha384.nxnx_rsa_pkcs1_v1_5_k.nxnx_x509_validate.nxnx_ed25519_signature.nx

imported by: nx_chain_full_real_test.nxnx_chain_pair_leaf_real_test.nxnx_chain_pair_real_diag_test.nxnx_ecdsa_p384_real_bisect_test.nxnx_x509_chain_verify.nxnx_x509_chain_verify_test.nxnx_x509_verify_under_issuer_test.nx

structs

none

consts

79const NX_MAGIC_4096: i64 = 4096
80const NX_MAGIC_2048: i64 = 2048
82const NX_X509_VUI_OK: i64 = 1
83const NX_X509_VUI_SIG_ALG_UNSUPPORTED: i64 = 2
84const NX_X509_VUI_PUB_ALG_UNSUPPORTED: i64 = 3
85const NX_X509_VUI_ALG_MISMATCH: i64 = 4
86const NX_X509_VUI_PUBKEY_EXTRACT_FAIL: i64 = 5
87const NX_X509_VUI_VERIFY_FAIL: i64 = 6
88const NX_X509_VUI_VERDICT_N: i64 = 7

functions

90func nx_x509_vui_verdict_is_valid(v: i64) -> i64
called by 1: main
101func nx_x509_verify_under_issuer(buf: *u8, cert: *X509Cert,
289func main() -> i64