aboutsummaryrefslogtreecommitdiff
path: root/src/login/static_provider.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-23 17:31:53 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-23 17:31:53 +0200
commitcb9b64a184470c7f332eb2c20bf64d53e84406f1 (patch)
tree992ae5d5cc8c22d7e9a4974028f914e9b3ba50ce /src/login/static_provider.rs
parent378cbd76d0ce97e24941a81ff57c210c0342bd01 (diff)
downloadaerogramme-cb9b64a184470c7f332eb2c20bf64d53e84406f1.tar.gz
aerogramme-cb9b64a184470c7f332eb2c20bf64d53e84406f1.zip
Add user secret in mix to encrypt keys with password
Diffstat (limited to 'src/login/static_provider.rs')
-rw-r--r--src/login/static_provider.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/login/static_provider.rs b/src/login/static_provider.rs
index fb8ec68..cc6ffb6 100644
--- a/src/login/static_provider.rs
+++ b/src/login/static_provider.rs
@@ -60,7 +60,11 @@ impl LoginProvider for StaticLoginProvider {
CryptoKeys::open_without_password(&storage, &master_key, &secret_key).await?
}
(None, None) => {
- CryptoKeys::open(&storage, password).await?
+ let user_secrets = UserSecrets {
+ user_secret: u.user_secret.clone(),
+ alternate_user_secrets: u.alternate_user_secrets.clone(),
+ };
+ CryptoKeys::open(&storage, &user_secrets, password).await?
}
_ => bail!("Either both master and secret key or none of them must be specified for user"),
};