evgeny-gridasov / openvpn-otp

OpenVPN OTP token support plugin
GNU General Public License v3.0
279 stars 74 forks source link

HOTP counter issue #14

Closed avatamaniuc closed 8 years ago

avatamaniuc commented 8 years ago

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!

avatamaniuc commented 8 years ago

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);

calve commented 8 years ago

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 ?

evgeny-gridasov commented 8 years ago

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

avatamaniuc commented 8 years ago

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