From 9888507d162d0c77858363afbb8290524d254bc3 Mon Sep 17 00:00:00 2001 From: muji Date: Thu, 10 Feb 2022 17:00:33 +0800 Subject: [PATCH 1/2] Add notes to doc comments. --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 3b54d65..1ca07dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,11 @@ //! This library permits the creation of 2FA authentification tokens per TOTP, the verification of said tokens, with configurable time skew, validity time of each token, algorithm and number of digits! Default features are kept as low-dependency as possible to ensure small binaries and short compilation time //! +//! Be aware that some authenticator apps will accept the `SHA256` +//! and `SHA512` algorithms but silently fallback to `SHA1` which will +//! make the `check()` function fail due to mismatched algorithms. +//! +//! Use the `SHA1` algorithm to avoid this problem. +//! //! # Examples //! //! ```rust From 8db59df6c859816463cbda95df3b521e6391a5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9o=20Rebert?= Date: Thu, 10 Feb 2022 10:34:28 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d6f7ce1..e782d28 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ This library permits the creation of 2FA authentification tokens per TOTP, the verification of said tokens, with configurable time skew, validity time of each token, algorithm and number of digits! Default features are kept as lightweight as possible to ensure small binaries and short compilation time +Be aware that some authenticator apps will accept the `SHA256` and `SHA512` algorithms but silently fallback to `SHA1` which will make the `check()` function fail due to mismatched algorithms. + ## Features --- ### qr