File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
bitwarden-core/src/client Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,7 @@ impl EncryptionSettings {
66
66
// state to be missing, because they are *always* present when the user key is an
67
67
// XChaCha20Poly1305Key. Thus, the server or network cannot lie about the presence of these,
68
68
// because otherwise the entire user account will fail to decrypt.
69
- let is_v2_user = if let SymmetricCryptoKey :: XChaCha20Poly1305Key ( _) = user_key {
70
- true
71
- } else {
72
- false
73
- } ;
74
-
69
+ let is_v2_user = matches ! ( user_key, SymmetricCryptoKey :: XChaCha20Poly1305Key ( _) ) ;
75
70
if is_v2_user {
76
71
// For v2 users, we mandate the signing key and security state to be present
77
72
// The private key must also be valid.
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ pub fn sign<Ids: KeyIds>(
72
72
ctx : & mut KeyStoreContext < Ids > ,
73
73
) -> Result < SignedSecurityState , CryptoError > {
74
74
let signing_key = ctx. get_signing_key ( signing_key_id) ?;
75
- security_state. sign ( & signing_key)
75
+ security_state. sign ( signing_key)
76
76
}
77
77
78
78
impl SignedSecurityState {
@@ -81,9 +81,9 @@ impl SignedSecurityState {
81
81
self ,
82
82
verifying_key : & VerifyingKey ,
83
83
) -> Result < SecurityState , CryptoError > {
84
- Ok ( self
84
+ self
85
85
. 0
86
- . verify_and_unwrap ( verifying_key, & SigningNamespace :: SecurityState ) ? )
86
+ . verify_and_unwrap ( verifying_key, & SigningNamespace :: SecurityState )
87
87
}
88
88
}
89
89
You can’t perform that action at this time.
0 commit comments