aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-05-10 01:13:45 +0200
committerChristian Grothoff <christian@grothoff.org>2023-05-10 01:13:45 +0200
commitcc34502ac11a0fc77eb68a469b037fe2e2ee6c20 (patch)
tree271c8bedbed53f541750051f435fdffccd4485df
parent5f9c3021db128e53013f8ad22781254f57c3c355 (diff)
downloadexchange-cc34502ac11a0fc77eb68a469b037fe2e2ee6c20.tar.xz
-fix TOTP calculation
-rw-r--r--src/util/crypto_confirmation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/crypto_confirmation.c b/src/util/crypto_confirmation.c
index bbdf701ec..a238d5376 100644
--- a/src/util/crypto_confirmation.c
+++ b/src/util/crypto_confirmation.c
@@ -102,7 +102,7 @@ compute_totp (struct GNUNET_TIME_Timestamp ts,
offset = hmac[sizeof (hmac) - 1] & 0x0f;
for (int count = 0; count < 4; count++)
- code |= hmac[offset + 3 - count] << (8 * count);
+ code |= ((uint32_t) hmac[offset + 3 - count]) << (8 * count);
code &= 0x7fffffff;
/* always use 8 digits (maximum) */
code = code % 100000000;