]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use correct time value
authorNick Porter <nick@portercomputing.co.uk>
Mon, 29 Apr 2024 08:34:28 +0000 (09:34 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 29 Apr 2024 08:34:28 +0000 (09:34 +0100)
src/modules/rlm_totp/totp.c

index 4594f2ad964ef7d3c27233da49931710de09b76b..67f4ae823cfa5a2d74a190f5853a72b84e0be430 100644 (file)
@@ -104,7 +104,7 @@ int fr_totp_cmp(fr_totp_t const *cfg, request_t *request, time_t now, uint8_t co
         */
 
        for (i = 0, then = now; i <= cfg->lookback_steps; i++, then -= cfg->lookback_interval) {
-               padded = ((uint64_t) now) / cfg->time_step;
+               padded = ((uint64_t) then) / cfg->time_step;
                data[0] = padded >> 56;
                data[1] = padded >> 48;
                data[2] = padded >> 40;