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

support base32 padding #26

Merged
merged 10 commits into from
Apr 27, 2024
Merged

support base32 padding #26

merged 10 commits into from
Apr 27, 2024

Conversation

ESPINS
Copy link

@ESPINS ESPINS commented Apr 27, 2024

support base32 padding

@tilkinsc
Copy link
Owner

  1. test/main.c - I have no idea if sha256 actually works in the first place, its implementation has been guessed on, not verified. I have swapped your edit over to sha1, as these test files serve more as a demonstration and an easy catch when something breaks while developing. Further, I had to change the totp_at to point to the correct code for the generation as produced by another implementation.

  2. test/main.cpp - This file got little love, so I added the same test. It's important to me that these two tests provide the same exact results.

  3. cotp.c otp_byte_secret - Its better to break when c == '=' rather than burning through the rest of the string. For example a string with a 256 buffer who has 8 characters will be padded with 256-8 characters, needlessly burning through the rest of the string. (there should be no embedded =) We need to be responsible for correctly handling the length of the base32_secret because we do not burden the user with providing the length of the base32_secret.

Thank you for your contribution!

@tilkinsc tilkinsc merged commit f7eca66 into tilkinsc:master Apr 27, 2024
2 checks passed
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.

3 participants