diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-05-10 01:12:06 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-05-10 01:12:06 +0200 |
commit | 28abc69a5ca126032362891955096860501a6dc2 (patch) | |
tree | c68856011ca3064b6483e6b75c0deed88a256811 /src/authorization | |
parent | 500cde85592167b78b0f0d9420bb2043fb252742 (diff) | |
download | anastasis-28abc69a5ca126032362891955096860501a6dc2.tar.gz anastasis-28abc69a5ca126032362891955096860501a6dc2.tar.bz2 anastasis-28abc69a5ca126032362891955096860501a6dc2.zip |
fix bug in TOTP calculation
Diffstat (limited to 'src/authorization')
-rw-r--r-- | src/authorization/anastasis_authorization_plugin_totp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_totp.c b/src/authorization/anastasis_authorization_plugin_totp.c index e1c104a..c127e38 100644 --- a/src/authorization/anastasis_authorization_plugin_totp.c +++ b/src/authorization/anastasis_authorization_plugin_totp.c @@ -188,7 +188,7 @@ compute_totp (int time_off, 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; |