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

base32_encode returns an error when the leading byte is 0 #54

Closed
TetraK1 opened this issue Nov 23, 2023 · 2 comments
Closed

base32_encode returns an error when the leading byte is 0 #54

TetraK1 opened this issue Nov 23, 2023 · 2 comments

Comments

@TetraK1
Copy link

TetraK1 commented Nov 23, 2023

base32_encode passes the byte array to check_input, which returns an error if the first byte is 0.

This fails when it shouldn't i.e. 0 is a valid secret.

uint8_t secret_bytes[] = {0, 0, 0, 0};
cotp_error_t err_code;
base32_encode(secret_bytes, 4, &err_code);
// err_code = EMPTY_STRING
@paolostivanin
Copy link
Owner

You're right, thanks for reporting this! I'll fix it in the next days

@paolostivanin
Copy link
Owner

fixed with 00c55cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants