Skip to content

support base32 padding#26

Merged
tilkinsc merged 10 commits intotilkinsc:masterfrom
ESPINS:master
Apr 27, 2024
Merged

support base32 padding#26
tilkinsc merged 10 commits intotilkinsc:masterfrom
ESPINS:master

Conversation

@ESPINS
Copy link
Copy Markdown

@ESPINS ESPINS commented Apr 27, 2024

support base32 padding

@tilkinsc
Copy link
Copy Markdown
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
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