Compare commits

...

6 Commits

Author SHA1 Message Date
085851e169 Update Rust crate webauthn-rs to 0.5.2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-05 00:06:32 +00:00
e3e4e8280c Update Rust crate uuid to 1.17.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-11 00:19:10 +00:00
03c538cc96 Update Rust crate clap to 4.5.40
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-10 00:19:27 +00:00
77d3e49a94 Update Rust crate futures-util to 0.3.31
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-09 00:19:16 +00:00
df40e5e6be Update Rust crate clap to 4.5.39
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-07 00:18:47 +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
4 changed files with 37 additions and 59 deletions

70
Cargo.lock generated
View File

@ -574,12 +574,12 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3"
[[package]]
name = "base64urlsafedata"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f0ad38ce7fbed55985ad5b2197f05cff8324ee6eb6638304e78f0108fae56c"
checksum = "e5913e643e4dfb43d5908e9e6f1386f8e0dfde086ecef124a6450c6195d89160"
dependencies = [
"base64 0.21.7",
"paste",
"pastey",
"serde",
]
@ -816,9 +816,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.38"
version = "4.5.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000"
checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f"
dependencies = [
"clap_builder",
"clap_derive",
@ -826,9 +826,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.38"
version = "4.5.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120"
checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e"
dependencies = [
"anstream",
"anstyle",
@ -838,9 +838,9 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.32"
version = "4.5.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce"
dependencies = [
"heck",
"proc-macro2",
@ -871,23 +871,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "compact_jwt"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12bbab6445446e8d0b07468a01d0bfdae15879de5c440c5e47ae4ae0e18a1fba"
dependencies = [
"base64 0.21.7",
"base64urlsafedata",
"hex",
"openssl",
"serde",
"serde_json",
"tracing",
"url",
"uuid",
]
[[package]]
name = "const-oid"
version = "0.9.6"
@ -2286,9 +2269,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "openssl-sys"
version = "0.9.106"
version = "0.9.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
dependencies = [
"cc",
"libc",
@ -2344,10 +2327,10 @@ dependencies = [
]
[[package]]
name = "paste"
version = "1.0.15"
name = "pastey"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
checksum = "b3a8cb46bdc156b1c90460339ae6bfd45ba0394e5effbaa640badb4987fdc261"
[[package]]
name = "pem-rfc7468"
@ -3397,12 +3380,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]]
@ -3539,12 +3524,13 @@ dependencies = [
[[package]]
name = "webauthn-attestation-ca"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29e77e8859ecb93b00e4a8e56ae45f8a8dd69b1539e3d32cf4cce1db9a3a0b99"
checksum = "384e43534efe4e8f56c4eb1615a27e24d2ff29281385c843cf9f16ac1077dbdc"
dependencies = [
"base64urlsafedata",
"openssl",
"openssl-sys",
"serde",
"tracing",
"uuid",
@ -3552,9 +3538,9 @@ dependencies = [
[[package]]
name = "webauthn-rs"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b44347ee0d66f222043663a6aaf5ec78022b9b11c3a9ed488c21f2bd5680856"
checksum = "ed1f861a94557baeb0cf711e3e55d623c46b68f4aab7aa932562f785b8b5f1ab"
dependencies = [
"base64urlsafedata",
"serde",
@ -3566,17 +3552,17 @@ dependencies = [
[[package]]
name = "webauthn-rs-core"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ef48f07ed8f3dfe304d6c48e85317feba0439675f31a13063b2936c9b4eaf0d"
checksum = "269c210cd5f183aaca860bb5733187d1dd110ebed54640f8fc1aca31a04aa4dc"
dependencies = [
"base64 0.21.7",
"base64urlsafedata",
"compact_jwt",
"der-parser",
"hex",
"nom",
"openssl",
"openssl-sys",
"rand 0.8.5",
"rand_chacha 0.3.1",
"serde",
@ -3593,9 +3579,9 @@ dependencies = [
[[package]]
name = "webauthn-rs-proto"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14e1367f70e7dc7b83afc971ce8a54d578f4fdf488ea093021180e073744a69f"
checksum = "144dbee9abb4bfad78fd283a2613f0312a0ed5955051b7864cfc98679112ae60"
dependencies = [
"base64 0.21.7",
"base64urlsafedata",

View File

@ -11,7 +11,7 @@ actix-identity = "0.8.0"
actix-web = "4.11.0"
actix-session = { version = "0.10.1", features = ["cookie-session"] }
actix-remote-ip = "0.1.0"
clap = { version = "4.5.38", features = ["derive", "env"] }
clap = { version = "4.5.40", features = ["derive", "env"] }
include_dir = "0.7.4"
log = "0.4.27"
serde_json = "1.0.140"
@ -19,10 +19,10 @@ 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"
futures-util = "0.3.31"
urlencoding = "2.1.3"
rand = "0.9.1"
base64 = "0.22.1"
@ -33,7 +33,7 @@ lazy-regex = "3.4.1"
totp_rfc6238 = "0.6.1"
base32 = "0.5.1"
qrcode-generator = "5.0.0"
webauthn-rs = { version = "0.5.1", features = ["danger-allow-state-serialisation"] }
webauthn-rs = { version = "0.5.2", features = ["danger-allow-state-serialisation"] }
url = "2.5.4"
light-openid = { version = "1.0.4", features = ["crypto-wrapper"] }
bincode = "2.0.1"

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