Repository navigation
feat(stack-encrypt): v2 sealed leaf naming the key backend and key mode (CIP-5305) - #1524
Conversation
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true |
Mutation testing (cargo-mutants,
|
| caught | missed | unviable | timeout |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
cargo-mutants exited 4 with no surviving mutants recorded. The run may not have completed cleanly; check the workflow run logs.
8a5f036 to
d6c5305
Compare
bb8fc9d to
15163ba
Compare
…at track it Checked on 8 November 2026 against next at e4990e4, which has not moved since the plan's last check. Also: ExpectedContext already exists on next; the frozen fixtures predate the rc.3 tag; the three stacked conformance pull requests are in review; #1503 adds Zeroizing; the nonexistent #1326 is no longer cited; and draft #1524 claims the same envelope version byte as the key request items, recorded as a conflict and an open question.
|
Issue #1566 plans to use the |
d6c5305 to
cd77cf8
Compare
15163ba to
22594ee
Compare
Add ADR-0009 (two key modes), ADR-0010 (v2 leaf with backend and mode) and ADR-0011 (hand-written vendor clients, signed in the guest). Widen the Keyset term and add the key backend terms to CONTEXT.md.
Add the seams a key vendor backend needs:
- KeyLifetime and LoadedIndexKey, returned by the new provided method
IndexKeySource::load_index_key_with_lifetime. The default is
UntilEvicted, the ZeroKMS behaviour.
- Error::Backend { vendor, kind, source } with BackendErrorKind, and
Error::ZeroKmsOnly { vendor, feature }.
- ZeroKmsFeature, ZeroKmsExtensions and refuse_zerokms_extensions, so a
key vendor backend refuses a context, a decryption policy or an
unverified context and never ignores it.
- IndexKey::from_key_bytes, a public constructor from raw key material.
The Go guest maps the two new error variants to statuses.
BREAKING CHANGE: stack_kms::Error has two new variants. An exhaustive
match on it must handle them.
…304) The cipher loads index keys with load_index_key_with_lifetime. A key for one settle only is never cached, a key with a TTL is evicted when the TTL ends, and a ZeroKMS key stays until evicted. init refuses a default keyset whose key the cipher may not keep (Error::DefaultKeysetLifetime). A key vendor backend's NotFound now counts as keyset not found, and Descriptor::MAX_LEN no longer reads a ZeroKMS constant.
…(CIP-5305) Add KeyBackend (ZeroKMS or a key vendor backend), KeyVendor and KeyMode. KeyVendor and KeyMode have stable bytes for the v2 sealed leaf; 0 is invalid for both. DataKeySource::key_backend says which backend a source is, and defaults to ZeroKMS.
…backend (CIP-5305) A v2 leaf is 0x02 ‖ backend ‖ mode ‖ keyset_id ‖ iv ‖ tag_len ‖ tag ‖ ct. The leaf AAD binds the three header bytes. A v1 leaf, its AAD and its serde form do not change, and ZeroKMS still writes v1. A cipher refuses a leaf that names another key backend than its own with Error::ForeignBackend, before any key call. A key vendor backend cannot seal yet (Error::SealUnsupported); CIP-5306 wires that path. Add a v1 known-answer test, v2 layout pins, header-byte tamper tests, v2 fuzz seeds, an eql-bindings pass-through test, and the Go guest status for ForeignBackend.
22594ee to
dbdc34e
Compare
8036d19 to
fb05412
Compare
|
Closed by the scope reduction. The v2 sealed leaf is dropped: The plan is |
Layer 3 of the CIP-5203 stack. Implements CIP-5305 (ADR-0010).
0x02 ‖ backend ‖ mode ‖ keyset_id ‖ iv ‖ tag_len ‖ tag ‖ ct. The header is bound by the leaf AAD. v1 does not change, and a known-answer test pins it.KeyBackend,KeyVendorandKeyModehave stable byte values.Error::ForeignBackendrefuses a leaf from another backend before any key call.Decisions are in
docs/plans/2026-11-05-key-vendor-backends-decisions.md(CIP-5305 section).