aboutsummaryrefslogtreecommitdiff
path: root/src/login/mod.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-12-12 09:17:59 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-12-12 09:17:59 +0100
commit47e25cd7f710fcd82356377cf48eccf9f65d31cc (patch)
treeb847e1b83b6608047d666acc4856113604fc0dbd /src/login/mod.rs
parent23f918fd0edb224668fb775c770075eb4f44ce4d (diff)
downloadaerogramme-47e25cd7f710fcd82356377cf48eccf9f65d31cc.tar.gz
aerogramme-47e25cd7f710fcd82356377cf48eccf9f65d31cc.zip
WIP
Diffstat (limited to 'src/login/mod.rs')
-rw-r--r--src/login/mod.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/login/mod.rs b/src/login/mod.rs
index a9b9efe..f7a81c2 100644
--- a/src/login/mod.rs
+++ b/src/login/mod.rs
@@ -169,9 +169,20 @@ impl CryptoKeys {
}
pub async fn open(
- storage: &Builders,
password: &str,
+ root_blob: &str,
) -> Result<Self> {
+ let kdf_salt = &password_blob[..32];
+ let password_openned = try_open_encrypted_keys(kdf_salt, password, &password_blob[32..])?;
+
+ let keys = Self::deserialize(&password_openned)?;
+ if keys.public != expected_public {
+ bail!("Password public key doesn't match stored public key");
+ }
+
+ Ok(keys)
+
+ /*
let k2v = storage.row_store()?;
let (ident_salt, expected_public) = Self::load_salt_and_public(&k2v).await?;
@@ -208,6 +219,7 @@ impl CryptoKeys {
}
Ok(keys)
+ */
}
pub async fn open_without_password(