From: sigoden Date: Thu, 21 Jul 2022 03:47:47 +0000 (+0800) Subject: feat: adjust digest auth timeout to 1day (#110) X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=9cfd66dab96a1dd04a98c3b6d28c82c5a027c722;p=ozva-cloud feat: adjust digest auth timeout to 1day (#110) --- diff --git a/src/auth.rs b/src/auth.rs index 424d48e..37f1d66 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -12,6 +12,7 @@ use crate::utils::encode_uri; use crate::BoxResult; const REALM: &str = "DUFS"; +const DIGEST_AUTH_TIMEOUT: u32 = 86400; lazy_static! { static ref NONCESTARTHASH: Context = { @@ -317,8 +318,7 @@ fn validate_nonce(nonce: &[u8]) -> Result { h.consume(secs_nonce.to_be_bytes()); let h = format!("{:x}", h.compute()); if h[..26] == n[8..34] { - return Ok(dur < 300); // from the last 5min - //Authentication-Info ? + return Ok(dur < DIGEST_AUTH_TIMEOUT); } } }