aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rbw-agent/actions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/rbw-agent/actions.rs')
-rw-r--r--src/bin/rbw-agent/actions.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bin/rbw-agent/actions.rs b/src/bin/rbw-agent/actions.rs
index e24d044..3ca6d51 100644
--- a/src/bin/rbw-agent/actions.rs
+++ b/src/bin/rbw-agent/actions.rs
@@ -115,6 +115,14 @@ pub async fn unlock(
"failed to find protected key in db"
));
};
+ let protected_private_key =
+ if let Some(protected_private_key) = db.protected_private_key {
+ protected_private_key
+ } else {
+ return Err(anyhow::anyhow!(
+ "failed to find protected private key in db"
+ ));
+ };
for i in 1u8..=3 {
let err = if i > 1 {
@@ -135,11 +143,15 @@ pub async fn unlock(
&password,
iterations,
&protected_key,
+ &protected_private_key,
+ &db.protected_org_keys,
)
.await;
match res {
- Ok(keys) => {
- state.write().await.priv_key = Some(keys);
+ Ok((keys, org_keys)) => {
+ let mut state = state.write().await;
+ state.priv_key = Some(keys);
+ state.org_keys = org_keys;
break;
}
Err(rbw::error::Error::IncorrectPassword) => {