From 3433d1847943666522ad220b3e6d7849de528907 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 5 Jul 2021 14:24:56 -0400 Subject: use totp-lite instead of oath oath appears to be unmaintained --- src/bin/rbw/commands.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/bin/rbw/commands.rs') diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs index 53310d7..ee767c7 100644 --- a/src/bin/rbw/commands.rs +++ b/src/bin/rbw/commands.rs @@ -1500,9 +1500,13 @@ fn parse_totp_secret(secret: &str) -> anyhow::Result> { fn generate_totp(secret: &str) -> anyhow::Result { let key = parse_totp_secret(secret)?; - Ok(format!( - "{:06}", - oath::totp_raw_now(&key, 6, 0, 30, &oath::HashType::SHA1) + Ok(totp_lite::totp_custom::( + totp_lite::DEFAULT_STEP, + 6, + &key, + std::time::SystemTime::now() + .duration_since(std::time::SystemTime::UNIX_EPOCH)? + .as_secs(), )) } -- cgit v1.2.3