Repository navigation
feat(guest-agent): select key epochs in v0 GetKey - #1630
Merged
Merged
Conversation
Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
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.
Problem
v0
GetKeyalways derives from the CVM's current app root key. After a KMS root key rotation or an app epoch advance, every v0 key (including theSignkey at pathvms) silently changes, and there is no way to reach the old one: v0 has no epoch selector, and v1'sGetKeyepochs derive under a different KDF, so they never return the old v0 key. v0 apps holding assets under a key have no migration path.Fix
GetKeyArgsgainsoptional uint32 root_epoch = 4/app_epoch = 5. Unset keeps today's behaviour (current epochs). Older epochs are fetched from the KMS through the sameapp_rootpath v1 uses.GetKeyResponsereportsroot_epoch = 3/app_epoch = 4, so clients can detect an older agent that ignored the selectors.docs/guest-api-v0.mdand the pinnedfrozen_surfacedigests are updated.Tappd.DeriveK256KeysharesGetKeyArgsand honours the selectors too.Backport: #1631