Compare commits

..

2 Commits

Author SHA1 Message Date
23336c9310 Update Rust crate futures-util to 0.3.31
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-06-07 00:18:54 +00:00
e5c6f0d372 Fix cargo clippy issues (#407)
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #407
2025-06-06 06:11:07 +00:00
2 changed files with 5 additions and 13 deletions

View File

@ -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!",
)));
}

View File

@ -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!",
)));
}