Skip to content
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

Counter should be 8 bytes long #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

szszszsz
Copy link

@szszszsz szszszsz commented Oct 27, 2022

With counter size equal to 4 bytes the test vectors do not pass back the right values for HOTP. Similarly, the TOTP implementation uses 8 byte long int, hence it seems that this is a typo. At the same time the YK's protocol does accept only 4-byte counters.

As per RFC4226, 5.1. Notation and Symbols [1]:

   C       8-byte counter value, the moving factor.  This counter
           MUST be synchronized between the HOTP generator (client)
           and the HOTP validator (server).

[1] https://www.rfc-editor.org/rfc/rfc4226#page-5

With 4 bytes the test vectors do not pass the right values.
Similarly, the TOTP implementatation uses 8 byte long int.

As per RFC4226, 5.1. Notation and Symbols [1]:
   C       8-byte counter value, the moving factor.  This counter
           MUST be synchronized between the HOTP generator (client)
           and the HOTP validator (server).

[1] https://www.rfc-editor.org/rfc/rfc4226#page-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant