[auto-rotation feature] feat(rekey): Manual rotation for all key types + test vectors#969
Merged
Merged
Conversation
- Implement KMIP ReKey for symmetric keys with name transfer per §4.4 - Support re-wrapping dependent keys when a wrapping key is rekeyed - Add find_wrapped_by() to ObjectsStore trait (SQLite, PostgreSQL, MySQL) - Fix: transfer Name attribute from old to new key during ReKey - Fix: error on self-wrap when wrapping_key_id is user-supplied - Fix: bypass ownership check for server-configured KEK Tested with 37 vector tests (9 symmetric + 27 keypair + 1 security)
Manuthor
added a commit
that referenced
this pull request
May 29, 2026
…s + test vectors (#969) * feat(rekey): implement symmetric key ReKey with wrapping key re-wrap - Implement KMIP ReKey for symmetric keys with name transfer per §4.4 - Support re-wrapping dependent keys when a wrapping key is rekeyed - Add find_wrapped_by() to ObjectsStore trait (SQLite, PostgreSQL, MySQL) - Fix: transfer Name attribute from old to new key during ReKey - Fix: error on self-wrap when wrapping_key_id is user-supplied - Fix: bypass ownership check for server-configured KEK Tested with 37 vector tests (9 symmetric + 27 keypair + 1 security) * fix: consolidate rekey operations using trait * feat: consolidate Recertify operation
Manuthor
added a commit
that referenced
this pull request
May 31, 2026
…s + test vectors (#969) * feat(rekey): implement symmetric key ReKey with wrapping key re-wrap - Implement KMIP ReKey for symmetric keys with name transfer per §4.4 - Support re-wrapping dependent keys when a wrapping key is rekeyed - Add find_wrapped_by() to ObjectsStore trait (SQLite, PostgreSQL, MySQL) - Fix: transfer Name attribute from old to new key during ReKey - Fix: error on self-wrap when wrapping_key_id is user-supplied - Fix: bypass ownership check for server-configured KEK Tested with 37 vector tests (9 symmetric + 27 keypair + 1 security) * fix: consolidate rekey operations using trait * feat: consolidate Recertify operation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements manual key rotation (
Re-Key) for symmetric keys, including the three-phase wrapping-key rotation that re-wraps all dependent wrapped keys atomically.This is PR 2 of 5 in the key auto-rotation feature stack (depends on PR 1: #968):
What's included
Core operation —
crate/server/src/core/operations/rekey.rsrekey()— top-level KMIPRe-KeyhandlerReplacementObjectLink/ReplacedObjectLinkchainWrappingKeyLinkpoints to the old wrapping key, unwrap each with the old key, re-wrap with the new key, updateWrappingKeyLinkDatabase —
ObjectsStoreadditionsfind_wrapped_by(wrapping_key_uid)— returns all Active keys wrapped by a given UID (SQLite, PostgreSQL, MySQL backends)Rotation metadata
x-rotate-generationincremented on the new keyx-rotate-dateset to rotation timestamp on the new keyx-rotate-intervalset to0on the old key (disables future auto-rotation on it); inherited on the new keyx-rotate-intervalon the new key (operator must re-arm explicitly — see spec)Test vectors
New vectors under
test_data/vectors/covering:Breaking changes
None.
Re-Keywas already a KMIP 2.1 operation; this PR completes its implementation.Reviewer notes
x-rotate-interval = 0on the old key after manual rekey is intentional — see the attribute table in the spec (PR 1).