-
Notifications
You must be signed in to change notification settings - Fork 11
[PM-22845] Add account key rotation #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Great job, no security vulnerabilities found in this Pull Request |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #313 +/- ##
==========================================
- Coverage 71.75% 71.61% -0.15%
==========================================
Files 224 225 +1
Lines 18385 18426 +41
==========================================
+ Hits 13193 13196 +3
- Misses 5192 5230 +38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f72b76e
to
4becfdd
Compare
|
} | ||
|
||
/// Re-encrypts the user's keys with the provided symmetric key for a v2 user. | ||
pub fn get_v2_rotated_account_keys<Ids: crate::KeyIds>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Key rotation feels very application bound and not like a low level cryptographic primitive? I think this is further enhanced by bitwarden-core just acting as a wrapper around this function.
I presume this was done to avoid making get_asymetric_key
and `get_signing_key public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes;
As far as I understand we do not want any further new uses that expose keys out of bitwarden-crypto
, so this had to go into the crypto crate to achieve that. Is there another pattern we can use here? (Maybe we do allow (non-deprecated) getting wrapped(encrypted) keys out of a context?)
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-22845
📔 Objective
The decrypted signing key is never available to Typescript, and we need key-rotation to re-encrypt the signing key. This PR implements a part of key-rotation in the crypto crate - specifically re-encrypting the private and signing key.
Long-term, the key-rotation could should be ported at higher levels to the crypto crate.
⏰ Reminders before review
team
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes