[GH-ISSUE #14] HOTP counter issue #9

Closed
opened 2026-02-25 22:30:44 +03:00 by kerem · 4 comments
Owner

Originally created by @avatamaniuc on GitHub (May 10, 2016).
Original GitHub issue: https://github.com/evgeny-gridasov/openvpn-otp/issues/14

Hello,
I'm trying to make this work with Google Authenticator and HOTP type and it looks like counter writed to /var/spool/openvpn/hotp-counters/* is calculated incorrectly - on every authentication attempt the counter is decremented(-1) instead of being incremented(+1). Could you please check this?

Thank you!

Originally created by @avatamaniuc on GitHub (May 10, 2016). Original GitHub issue: https://github.com/evgeny-gridasov/openvpn-otp/issues/14 Hello, I'm trying to make this work with Google Authenticator and HOTP type and it looks like counter writed to /var/spool/openvpn/hotp-counters/\* is calculated incorrectly - on every authentication attempt the counter is decremented(-1) instead of being incremented(+1). Could you please check this? Thank you!
kerem closed this issue 2026-02-25 22:30:44 +03:00
Author
Owner

@avatamaniuc commented on GitHub (May 10, 2016):

I guess this:
hotp_set_counter(otp_params.key, T-i-1);

should be replaced with:
hotp_set_counter(otp_params.key, T-i+1);

<!-- gh-comment-id:218195545 --> @avatamaniuc commented on GitHub (May 10, 2016): I guess this: hotp_set_counter(otp_params.key, T-i-1); should be replaced with: hotp_set_counter(otp_params.key, T-i+1);
Author
Owner

@calve commented on GitHub (May 10, 2016):

You're damn right and I can't believe this have gone unnoticed that long. I pushed a patch on my fork at https://github.com/calve/openvpn-otp, could you confirm it fix your issue ?

<!-- gh-comment-id:218206943 --> @calve commented on GitHub (May 10, 2016): You're damn right and I can't believe this have gone unnoticed that long. I pushed a patch on my fork at https://github.com/calve/openvpn-otp, could you confirm it fix your issue ?
Author
Owner

@evgeny-gridasov commented on GitHub (May 11, 2016):

Calve could you please verify that everything works and raise a pull request? I'll merge the fix back.

<!-- gh-comment-id:218329737 --> @evgeny-gridasov commented on GitHub (May 11, 2016): Calve could you please verify that everything works and raise a pull request? I'll merge the fix back.
Author
Owner

@avatamaniuc commented on GitHub (May 11, 2016):

It looks like now it's ok. Thank you!

<!-- gh-comment-id:218403157 --> @avatamaniuc commented on GitHub (May 11, 2016): It looks like now it's ok. Thank you!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/openvpn-otp#9
No description provided.