File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
bitwarden-core/src/key_management Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -602,6 +602,8 @@ pub struct EnrollUserCryptoV2Response {
602
602
603
603
/// The user's signed security state
604
604
signed_security_state : SignedSecurityState ,
605
+ /// The security state's version
606
+ security_version : u64 ,
605
607
}
606
608
607
609
/// Initializes the user's cryptographic state for v2 users.
@@ -673,6 +675,7 @@ pub fn make_keys_for_user_crypto_v2(
673
675
verifying_key : STANDARD . encode ( signing_key. to_verifying_key ( ) . to_cose ( ) ) ,
674
676
675
677
signed_security_state,
678
+ security_version : security_state. version ( ) ,
676
679
} )
677
680
}
678
681
Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ impl SecurityState {
69
69
signing_key. sign ( self , & SigningNamespace :: SecurityState ) ?,
70
70
) )
71
71
}
72
+
73
+ /// Returns the version of the security state
74
+ pub fn version ( & self ) -> u64 {
75
+ self . version
76
+ }
72
77
}
73
78
74
79
/// Signs the `SecurityState` with the provided signing key ID from the context.
@@ -183,6 +188,6 @@ mod tests {
183
188
) ,
184
189
user_id
185
190
) ;
186
- assert_eq ! ( verified_security_state. version, 1 ) ;
191
+ assert_eq ! ( verified_security_state. version( ) , 1 ) ;
187
192
}
188
193
}
You can’t perform that action at this time.
0 commit comments