Increase totp secret size (#3061)

This commit is contained in:
Firstyear 2024-09-30 17:45:43 +10:00 committed by GitHub
parent 4049cb0a3a
commit e4f5c2313d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,8 +10,9 @@ use rand::prelude::*;
use crate::be::dbvalue::{DbTotpAlgoV1, DbTotpV1}; use crate::be::dbvalue::{DbTotpAlgoV1, DbTotpV1};
use crate::repl::proto::{ReplTotpAlgoV1, ReplTotpV1}; use crate::repl::proto::{ReplTotpAlgoV1, ReplTotpV1};
// This is 64 bits of entropy, as the examples in https://tools.ietf.org/html/rfc6238 show. // Update to match advice that totp hmac key should be the same
const SECRET_SIZE_BYTES: usize = 8; // number of bytes as the output.
const SECRET_SIZE_BYTES: usize = 32;
pub const TOTP_DEFAULT_STEP: u64 = 30; pub const TOTP_DEFAULT_STEP: u64 = 30;
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, PartialEq, Eq)]