From 4511f0f5c71e01069cfdbff4275a8b9122f913ff Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Thu, 27 Apr 2023 11:44:49 +0200 Subject: [PATCH] Increase TOPT secret length --- src/data/totp_key.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/totp_key.rs b/src/data/totp_key.rs index 80348e5..00725ca 100644 --- a/src/data/totp_key.rs +++ b/src/data/totp_key.rs @@ -21,7 +21,7 @@ pub struct TotpKey { impl TotpKey { /// Generate a new TOTP key pub fn new_random() -> Self { - let random_bytes = rand::thread_rng().gen::<[u8; 10]>(); + let random_bytes = rand::thread_rng().gen::<[u8; 20]>(); Self { encoded: base32::encode(BASE32_ALPHABET, &random_bytes), }