From 1efe822057c33796c1dd1db600fa247022a9069c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Fri, 11 Apr 2014 10:35:18 +0000 Subject: [PATCH] For TOTP keys, we record when the key was last used. For HOTP keys, however, we want to record the *next* allowed counter value. git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@794 185d5e19-27fe-0310-9dcf-9bff6b9f3609 --- lib/liboath/oath_hotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/liboath/oath_hotp.c b/lib/liboath/oath_hotp.c index 439b2fc..bfce61e 100644 --- a/lib/liboath/oath_hotp.c +++ b/lib/liboath/oath_hotp.c @@ -129,7 +129,7 @@ oath_hotp_match(struct oath_key *k, unsigned int response, int window) for (int i = 0; i < window; ++i) { code = oath_hotp(k->key, k->keylen, k->counter + i, k->digits); if (code == response && !k->dummy) { - k->counter = k->counter + i; + k->counter = k->counter + i + 1; return (1); } }