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

Expand DRBG tests to test the nonce length support and other parameters #3985

Open
gilles-peskine-arm opened this issue Jan 4, 2021 · 0 comments
Labels
component-crypto Crypto primitives and low-level interfaces enhancement help-wanted This issue is not being actively worked on, but PRs welcome.

Comments

@gilles-peskine-arm
Copy link
Contributor

gilles-peskine-arm commented Jan 4, 2021

ARMmbed/mbed-crypto#305 added support for grabbing the nonce of a CTR_DRBG instance from the entropy with mbedtls_ctr_drbg_set_nonce_len. It also adds test code that checks that the correct amount of entropy is read to set the nonce, but not that the correct slice of entropy is read. There was a bug in the initial implementation that caused the nonce to replace the initial entropy instead of being added to it.

At a minimum, to complete this task, add known-answer tests that validate that the CTR_DRBG produces the expected output with a non-empty nonce. This should be a non-regression test for #3973.

More generally, make sure that HMAC_DRBG and CTR_DRBG have sufficient known-answer test to have confidence that they behave correctly with non-default settings (set_entropy_len, set_nonce_len, set_reseed_interval, …).

@gilles-peskine-arm gilles-peskine-arm added enhancement help-wanted This issue is not being actively worked on, but PRs welcome. component-crypto Crypto primitives and low-level interfaces labels Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-crypto Crypto primitives and low-level interfaces enhancement help-wanted This issue is not being actively worked on, but PRs welcome.
Projects
None yet
Development

No branches or pull requests

3 participants