aboutsummaryrefslogtreecommitdiffstats
path: root/src/actions.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-18 18:20:46 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-18 18:20:46 -0400
commit80688313eddf2111fbdbd2b897bc2159d699a6d1 (patch)
tree98aedd9d5ed776d1c96a3e1344fc381df8b9be17 /src/actions.rs
parent766057750f35671fce5b6b1b98542dd60bcf8a48 (diff)
downloadrbw-80688313eddf2111fbdbd2b897bc2159d699a6d1.tar.gz
rbw-80688313eddf2111fbdbd2b897bc2159d699a6d1.zip
better error messages for incorrect passwords
Diffstat (limited to 'src/actions.rs')
-rw-r--r--src/actions.rs7
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(