diff options
Diffstat (limited to 'src/actions.rs')
-rw-r--r-- | src/actions.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/actions.rs b/src/actions.rs index 0fea7df..4dbe4ca 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -38,9 +38,12 @@ pub async fn unlock( let protected_key = crate::cipherstring::CipherString::new(protected_key)?; - let master_keys = protected_key.decrypt_locked(&identity.keys)?; - Ok(crate::locked::Keys::new(master_keys)) + match protected_key.decrypt_locked(&identity.keys) { + Ok(master_keys) => Ok(crate::locked::Keys::new(master_keys)), + Err(Error::InvalidMac) => Err(Error::IncorrectPassword), + Err(e) => Err(e), + } } pub async fn sync( |