Skip to content

Commit a766ab9

Browse files
authored
Merge branch 'main' into km/cose-key-rotation
2 parents 4becfdd + 17866c0 commit a766ab9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

crates/bitwarden-core/src/key_management/crypto.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,12 @@ pub fn make_user_signing_keys_for_enrollment(
595595

596596
// Make new keypair and sign the public key with it
597597
let signature_keypair = SigningKey::make(SignatureAlgorithm::Ed25519);
598+
let temporary_signature_keypair_id = SigningKeyId::Local("temporary_key_for_rotation");
599+
#[allow(deprecated)]
600+
ctx.set_signing_key(temporary_signature_keypair_id, signature_keypair.clone())?;
598601
let signed_public_key = ctx.make_signed_public_key(
599602
AsymmetricKeyId::UserPrivateKey,
600-
SigningKeyId::UserSigningKey,
603+
temporary_signature_keypair_id,
601604
)?;
602605

603606
Ok(MakeUserSigningKeysResponse {

crates/bitwarden-core/src/key_management/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ key_ids! {
3434
#[signing]
3535
pub enum SigningKeyId {
3636
UserSigningKey,
37+
#[local]
38+
Local(&'static str),
3739
}
3840

3941
pub KeyIds => SymmetricKeyId, AsymmetricKeyId, SigningKeyId;

0 commit comments

Comments
 (0)