[vault] Signing: the Android grant (v0.19.0) #25
Reference in New Issue
Block a user
Delete Branch "feature/android-grant"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mark, 2026-11-21: "the custos should have pre approved standing aproval for android swigning as well". About a dozen Domi apps are about to ship their first APK. Each would stop on a card that makes its
<app>-androidkey's first signature, then on another to store the standing approval, then again for each new app. A standing approval cannot cover this: it names one repository and one key, and never a key's first signature.What it adds (core 0.19.0, docs/SIGNING.md "The Android grant", docs/FORMAT.md):
signing.android: one grant per vault.repos: 1–64 patterns, eachowner/nameorowner/*.o,c: the subject of the certificates it makes.uses,lastUsed, andmade(the ids of the keys it made).android_key_id(repo):mnovak/Culina→culina-android.android_grant_fits(req): true only when all of these hold:apkfrom this PC's pipe (vialocal), with a run, in the key's scope, pipelinerelease;release;A key's first signature fits.
signing_sign(Approval::Standing)uses a standing approval first, then the grant. The outcome isstanding, and the use is counted on whichever fitted.android_grant_make_key(repo, pipeline, via)makes the app key for a covered repository, under the same conditions: local,release, not paused, no key under that id yet. It is RSA-4096 withCN=<Name>and the grant's O and C. It writes the new security actionandroid-key-made.android_grant_set/android_grant_revokewritestanding-granted/standing-revokedwith the grant's words. Setting is refused while Sign only with a card is ticked.grant_okon load: a grant thatandroid_grant_setcould not have written makes the vaultCorrupted. That covers bad patterns, duplicates, a bad subject, and bad ids inmade.Format: older cores ignore and drop
signing.android, so the grant is lost, never widened. A vault in which the grant made a key carriesandroid-key-madeand needs core 0.19.0.Tests:
tests/android_grant.rs, 8 tests:owner/name, made twice, paused, no grant;a_broken_android_grant_makes_the_vault_refuse_to_open: 7 edits to the stored grant.cargo test --workspace --release). The new tests were written before the code but never run against stubs, so none was seen failing first.Self-review (adversarial):
android-key-madeentry;standingaudit entry with the file's sha256 and commit;make_keyboth refusevia: remote, so it can neither sign nor make keys.*,*/*andmnovak/Cu*are refused, andowner/*never matches another owner. Repository names are compared exactly, as the scope check reads them.*), or a key whose id does not follow the repository, is never the grant's, so a hand-made key with a wider scope keeps asking.Not done here: the app's UI and pipe wiring (Custos repo); which programs may ask is the app's
fabrica/grant, as for standing approvals.