prov_shell.c
API
Fstatic bool all_zero(const uint8_t *p, size_t len)
Return true if all bytes in the buffer are zero.
cmd_prov, dead_blob_reasonFstatic const char *dead_blob_reason(const struct aliro_reader_identity *id, const struct aliro_trust_store *ts)
The three ways a syntactically valid blob is still useless, named rather than left for the walk-up to discover. Same three tools/aliro_blob.py reports on a flash dump, checked again here because a hex string can arrive by any route. Returns a reason, or NULL when the blob will actually unlock.
cmd_import, cmd_prov · calls all_zeroFstatic int cmd_prov(const struct shell *sh, size_t argc, char **argv)
Shell command: display the reader's provisioning state — whether it is provisioned, its reader ID, GRK status, enrolled anchors, and usability verdict.
all_zero, dead_blob_reasonFstatic int cmd_import(const struct shell *sh, size_t argc, char **argv)
Deserialize a hex-encoded identity blob, reject it if syntactically valid but useless (no identity, expired, or no trust anchors), then import it to settings storage if safe.
dead_blob_reasonFstatic int cmd_export(const struct shell *sh, size_t argc, char **argv)
Serialize and print the reader identity and trust store as hex after confirming with "aliro export yes"; the resulting string holds the private key and can impersonate the lock.
Fstatic int cmd_erase(const struct shell *sh, size_t argc, char **argv)
Erase the reader identity and all trust anchors after confirming with "aliro erase yes", returning to the DEV identity with no anchors.
Fstatic int cmd_heap(const struct shell *sh, size_t argc, char **argv)
Run this straight after an import: the commit path does a software P-256
derive, which is the reader's heaviest single crypto step, and the peak is
cumulative since boot so one reading covers the whole command.