Compare commits
2 Commits
8b22d4ac9b
...
e16b4275a7
Author | SHA1 | Date | |
---|---|---|---|
e16b4275a7 | |||
e5c6f0d372 |
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -3397,12 +3397,14 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.16.0"
|
||||
version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
|
||||
checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d"
|
||||
dependencies = [
|
||||
"getrandom 0.3.2",
|
||||
"js-sys",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -19,7 +19,7 @@ serde_yaml = "0.9.34"
|
||||
env_logger = "0.11.8"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
bcrypt = "0.17.0"
|
||||
uuid = { version = "1.16.0", features = ["v4"] }
|
||||
uuid = { version = "1.17.0", features = ["v4"] }
|
||||
mime_guess = "2.0.5"
|
||||
askama = "0.14.0"
|
||||
futures-util = "0.3.30"
|
||||
|
@ -1,5 +1,3 @@
|
||||
use std::io::ErrorKind;
|
||||
|
||||
use base32::Alphabet;
|
||||
use rand::Rng;
|
||||
use totp_rfc6238::{HashAlgorithm, TotpGenerator};
|
||||
@ -90,8 +88,7 @@ impl TotpKey {
|
||||
|
||||
let key = match base32::decode(BASE32_ALPHABET, &self.encoded) {
|
||||
None => {
|
||||
return Err(Box::new(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(Box::new(std::io::Error::other(
|
||||
"Failed to decode base32 secret!",
|
||||
)));
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
use std::io::ErrorKind;
|
||||
use std::sync::Arc;
|
||||
|
||||
use actix_web::web;
|
||||
@ -109,15 +108,13 @@ impl WebAuthManager {
|
||||
) -> Res<WebauthnPubKey> {
|
||||
let state: RegisterKeyOpaqueData = self.crypto_wrapper.decrypt(opaque_state)?;
|
||||
if state.user_id != user.uid {
|
||||
return Err(Box::new(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(Box::new(std::io::Error::other(
|
||||
"Invalid user for pubkey!",
|
||||
)));
|
||||
}
|
||||
|
||||
if state.expire < time() {
|
||||
return Err(Box::new(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(Box::new(std::io::Error::other(
|
||||
"Challenge has expired!",
|
||||
)));
|
||||
}
|
||||
@ -157,15 +154,13 @@ impl WebAuthManager {
|
||||
) -> Res {
|
||||
let state: AuthStateOpaqueData = self.crypto_wrapper.decrypt(opaque_state)?;
|
||||
if &state.user_id != user_id {
|
||||
return Err(Box::new(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(Box::new(std::io::Error::other(
|
||||
"Invalid user for pubkey!",
|
||||
)));
|
||||
}
|
||||
|
||||
if state.expire < time() {
|
||||
return Err(Box::new(std::io::Error::new(
|
||||
ErrorKind::Other,
|
||||
return Err(Box::new(std::io::Error::other(
|
||||
"Challenge has expired!",
|
||||
)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user