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

srp_create_salted_verification_key can return incorrect size #14

Open
wyoung opened this issue Nov 21, 2019 · 0 comments
Open

srp_create_salted_verification_key can return incorrect size #14

wyoung opened this issue Nov 21, 2019 · 0 comments

Comments

@wyoung
Copy link

wyoung commented Nov 21, 2019

We're seeing a symptom where this code:

srp_create_salted_verification_key(algo, group, I, P, strlen(P),
      &salt_buf, &salt_len, &ver_buf, &ver_len, 0, 0);

can return 3 or less in salt_len, not the expected 4. Based on how often it happens (1-4 times typical per ~500 tries) we're guessing that it's happening when the top 8 bits of the salt happen to be 0, and the value isn't getting zero-padded to 32 bits properly.

Calling the same function with the same values almost always fixes it, but we worry that we're effectively truncating the salt by doing so, since some values are now not possible, thus an attacker would know not to even try them.

This doesn't happen for the same inputs each time, either, which further indicates that it's the library's internal handling of the random numbers that's at fault here, not our call.

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

No branches or pull requests

1 participant