-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NK Storage: Counter value is not written for HOTP #60
Comments
@szszszsz Can you tell if this is a firmware or App issue? |
@jans23 I will investigate it further and let you know. After a quick gaze it looks like both sticks are handled by same HOTP setting function thus pointing the problem might be in the Nitrokey Storage firmware. |
I will check it further on Monday. |
Hi @jans23 I have found that the firmware in Nitrokey Storage accepts counter value being written in plaintext whereas Nitrokey Pro accepts counter as binary 64-bit int. The reason in sending an integral value as text is probably to avoid conversion problems between little and big endian architectures. While this is an universal solution, it probably will not be of use here. Having only 8 bytes for counter we could have either 8-digits number as text or almost 20-digits number as 64 bit long int. I will support both firmwares for now in nitrokey-app if possible. Related code blocks: |
Actually it's 7 digits max for plaintext since in current implementation in firmware atoi is runned directly on the packet buffer (last byte has to be '\0'). |
One more correction - since counter value would be transferred only on checking slot in GUI and it is stored in binary form on stick, the only problems are actually setting higher counter value than 9999999 and editing it in GUI - counter value is read back and shown in form. |
…#64) * Check HOTP counter text length and save only 7 digits or issue warning * Read back HOTP counter value for Nitrokey Pro * Fix: check ulong for HOTP counter, not long * Limit counter digits count to 7 for Nitrokey Storage * Handle HOTP counter for both Nitrokey Pro (ulong) and Storage (text) Closes issue #60
With fix both sticks HOTP counters are handled. |
Ubuntu 16.04
occurency: always
Nitrokey Storage
HOTP counter value is not set as in configuration form during HOTP password setup. Issue is not occuring on NK Pro.
It is set to 0. Checked with RFC document example.
The text was updated successfully, but these errors were encountered: