From 505569fa222096ef63dbb777033f655ea1e04eb8 Mon Sep 17 00:00:00 2001 From: timvisee Date: Tue, 3 Jan 2023 11:52:43 +0100 Subject: [PATCH] Remove issuer and account name colon check in TOTP::new method --- src/lib.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1708d14..94024f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -242,12 +242,10 @@ impl TOTP { /// ``` /// * `digits`: MUST be between 6 & 8 /// * `secret`: Must have bitsize of at least 128 - /// * `account_name`: Must not contain `:` - /// * `issuer`: Must not contain `:` /// /// # Errors /// - /// Will return an error in case issuer or label contain the character ':' + /// Will return an error if the `digit` or `secret` size is invalid pub fn new( algorithm: Algorithm, digits: usize, @@ -259,12 +257,6 @@ impl TOTP { ) -> Result { crate::rfc::assert_digits(&digits)?; crate::rfc::assert_secret_length(secret.as_ref())?; - if issuer.is_some() && issuer.as_ref().unwrap().contains(':') { - return Err(TotpUrlError::Issuer(issuer.as_ref().unwrap().to_string())); - } - if account_name.contains(':') { - return Err(TotpUrlError::AccountName(account_name)); - } Ok(Self::new_unchecked( algorithm, digits, @@ -323,7 +315,7 @@ impl TOTP { /// /// # Errors /// - /// Will return an error in case issuer or label contain the character ':' + /// Will return an error if the `digit` or `secret` size is invalid pub fn new( algorithm: Algorithm, digits: usize,