Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial TOTP implementation #392

Merged
merged 9 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove debug print
Hinton committed Dec 4, 2023
commit c7567ac41258a1df95d8d96ebd22c5d0670b2b7b
7 changes: 3 additions & 4 deletions crates/bitwarden/src/vault/totp.rs
Original file line number Diff line number Diff line change
@@ -99,10 +99,9 @@ impl Totp {
fn derive_otp(&self, time: i64) -> Result<String> {
let time = time / self.period as i64;

let secret = BASE32.decode(self.secret.as_ref()).map_err(|e| {
println!("{:?}", e);
Error::Internal("Unable to decode secret")
})?;
let secret = BASE32
dani-garcia marked this conversation as resolved.
Show resolved Hide resolved
.decode(self.secret.as_ref())
.map_err(|e| Error::Internal("Unable to decode secret"))?;

let hash = self
.algorithm