summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-29 23:04:23 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-29 23:04:23 +0200
commita16b1544ffb8d5a62fb06795abfd9490c6a4376c (patch)
tree33e88a6c35450bc38009c22de562e143ac5e3fef
parent58daaedd2a27aa8a5ff36e5e9f2943d8f1680881 (diff)
downloadanastasis-a16b1544ffb8d5a62fb06795abfd9490c6a4376c.tar.gz
anastasis-a16b1544ffb8d5a62fb06795abfd9490c6a4376c.tar.bz2
anastasis-a16b1544ffb8d5a62fb06795abfd9490c6a4376c.zip
-use 8 digits
-rw-r--r--src/authorization/anastasis_authorization_plugin_totp.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_totp.c b/src/authorization/anastasis_authorization_plugin_totp.c
index 68e8def..0934910 100644
--- a/src/authorization/anastasis_authorization_plugin_totp.c
+++ b/src/authorization/anastasis_authorization_plugin_totp.c
@@ -191,17 +191,8 @@ compute_totp (int time_off,
for (int count = 0; count < 4; count++)
code |= hmac[offset + 3 - count] << (8 * count);
code &= 0x7fffffff;
-
-#if VAR_DIGITS
- if (digits == 6)
- code = code % 1000000;
- else if (digits == 7)
- code = code % 10000000;
- else if (digits == 8)
- code = code % 100000000;
-#else
- code = code % 1000000;
-#endif
+ /* always use 8 digits (maximum) */
+ code = code % 100000000;
return code;
}
}
@@ -246,10 +237,6 @@ totp_start (void *cls,
want = compute_totp (i,
data,
data_length);
- fprintf (stderr,
- "TOTP %d: %llu\n",
- i,
- (unsigned long long) want);
ANASTASIS_hash_answer (want,
&as->valid_replies[off++]);
}