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

create_extended_keypair should use Random and be made deterministic for fuzzing #2649

Closed
iphydf opened this issue Feb 4, 2024 · 3 comments · Fixed by #2671
Closed

create_extended_keypair should use Random and be made deterministic for fuzzing #2649

iphydf opened this issue Feb 4, 2024 · 3 comments · Fixed by #2671
Assignees
Milestone

Comments

@iphydf
Copy link
Member

iphydf commented Feb 4, 2024

crypto_sign_keypair generates random numbers and then derives a key. We should use Random for random numbers and derive the key from that. It's exactly the same in production builds, but in fuzzing this ensures that we can fuzz NGC properly.

@iphydf iphydf added this to the v0.2.19 milestone Feb 4, 2024
@JFreegman
Copy link
Member

Do you mean write fuzzer-only re-implementation of the libsodium function? I wouldn't want to be re-implementing libsodium internals in production. Even if it's a copy-paste job there are numerous issues with that.

@iphydf
Copy link
Member Author

iphydf commented Feb 5, 2024

https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_sign/ed25519/ref10/keypair.c#L39

Use the "seed" version of the API instead of the unseeded version where it seeds via internal random. No, not just for fuzzing.

https://github.com/jedisct1/libsodium/blob/b564794eddda79d54374144653c1f4e05ae08a64/src/libsodium/crypto_sign/crypto_sign.c#L47 use this one from the public API.

@JFreegman
Copy link
Member

I see, I didn't know there was a public version of that function.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants