aliro_stepup.h
Aliro step-up (Access Document) phase: builds the mdoc DeviceRequest, unwraps and decrypts the…
Overview
Aliro step-up (Access Document) phase: builds the mdoc DeviceRequest, unwraps and decrypts the SessionData DeviceResponse, decodes the CBOR document per spec 7.2/8.4.2, and runs the six-step Access Document verification of spec 7.4. Reference-completeness codec + verifier; the verdict is logged and stored, never gates the unlock (the provisioned trust store remains the sole gate).
depends on aliro_crypto.h · used by aliro_reader.c aliro_stepup.c aliro_stepup_parse.c
API
Cstruct aliro_stepup_digest
Step-up credential element digest: SHA-256 hash of a disclosed IssuerSignedItem, with its digest_id for verification.
Cstruct aliro_stepup_item
Single disclosed IssuerSignedItem from a Step-up document: digest_id (which digest to check against), tagged (24(bstr(IssuerSignedItem)) bytes for hashing), elem_id (element name).
Cstruct aliro_stepup_doc
Parsed Step-up access document (ISO/IEC 18013-5 mDoc): have_document (0 if device declined), status (DeviceResponse "3" code), doc_type and name_space (issuer namespace), IssuerAuth COSE_Sign1 components (protected header, kid, x5chain, payload=24(bstr(MSO)), signature r||s), MobileSecurityObject (digest algorithm, doc type, disclosed digests), validity dates (signed/valid_from/valid_until as epoch seconds, with flags), and disclosed IssuerSignedItems (elem_id, tagged bytes, digest_id for matching against MSO).
Cstruct aliro_stepup_issuer
---- verifier (§7.4) ----
Cstruct aliro_stepup_verify_ctx
Context for Step-up document verification: issuers (trust store), time_valid/now_epoch (clock state), access_iteration (stored iteration for replay check), expected_doctype, ecdsa_verify callback (ES256 over message, takes 65-byte pub, message, 64-byte r||s sig, returns 0 on valid).
Cstruct aliro_stepup_verdict
Verdict of Step-up document verification (ISO/IEC 18013-5 §7.4): valid (all passed steps + >=1 valid element), reject_step (0=accepted, else step 1-6 that failed), issuer_key_found/issuer_chain_validated/sig_ok/digests_ok/doctype_ok/time_ok/iteration_ok (per-step flags), valid_elements (count of disclosed items with verified digest).
Cstruct aliro_stepup_job
---- ESP worker seam (implemented per-platform; see aliro_stepup_worker.c) ---- Copies the collected SessionData response + keys + verify inputs and runs aliro_stepup_run() off the BLE-host task, so parse/verify never touches the auth segment or the ranging arm window. Returns 0 if queued.