aboutsummaryrefslogtreecommitdiff
path: root/src/login/static_provider.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-19 15:14:36 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-19 15:14:36 +0200
commit1dcb11643c783096e1b52bf48d6b76121504e6bd (patch)
tree658f1db34d0e4f91331dabcab85a5898a95d4ad4 /src/login/static_provider.rs
parent6be90936a108d971e0cfa3ddaa9c2d54557e30f3 (diff)
downloadaerogramme-1dcb11643c783096e1b52bf48d6b76121504e6bd.tar.gz
aerogramme-1dcb11643c783096e1b52bf48d6b76121504e6bd.zip
CLI skeleton
Diffstat (limited to 'src/login/static_provider.rs')
-rw-r--r--src/login/static_provider.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/login/static_provider.rs b/src/login/static_provider.rs
index d7d791a..3ef8d89 100644
--- a/src/login/static_provider.rs
+++ b/src/login/static_provider.rs
@@ -58,19 +58,24 @@ impl LoginProvider for StaticLoginProvider {
.ok_or(anyhow!("Invalid master key"))?;
let secret_key = SecretKey::from_slice(&base64::decode(m)?)
.ok_or(anyhow!("Invalid secret key"))?;
- CryptoKeys::open_without_password(&storage, &master_key, &secret_key)?
+ CryptoKeys::open_without_password(&storage, &master_key, &secret_key).await?
}
(None, None) => {
- CryptoKeys::open(&storage, password)?
+ CryptoKeys::open(&storage, password).await?
}
_ => bail!("Either both master and secret key or none of them must be specified for user"),
};
- Ok(Credentials {
- storage,
- keys,
- })
+ Ok(Credentials { storage, keys })
}
}
}
}
+
+pub fn hash_password(password: &str) -> String {
+ unimplemented!()
+}
+
+pub fn verify_password(password: &str, hash: &str) -> bool {
+ unimplemented!()
+}