-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Backport to Mbedtls 2.16: Support set *_drbg reseed interval before seed #3938
Conversation
mbedtls_ctr_drbg_set_reseed_interval() and mbedtls_hmac_drbg_set_reseed_interval() can now be called before their seed functions and the reseed_interval value will persist. Previously it would be overwritten with the default value. *_drbg_reseed_interval is now set in init() and free(). mbedtls_ctr_drbg_free() and mbedtls_hmac_drbg_free() now reset the drbg context to the state immediately after init(). Tests: - Added test to check that DRBG reseeds when reseed_counter reaches reseed_interval, if reseed_interval set before seed and reseed_interval is less than MBEDTLS_*_DRBG_RESEED_INTERVAL. Signed-off-by: gacquroff <[email protected]>
Signed-off-by: gacquroff <[email protected]>
I did have a problem running local tests for this patch, but it seemed unrelated to my change. |
I guess you had built the project, then you changed to a 2.16 branch, then you ran |
That's exactly what I did, hopefully I remember for next time 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a faithful backport of #3393. The patch is identical except for expected differences (in CTR_DRBG, reseed_counter
marks that the entropy nonce length is not set explicitly) due to ARMmbed/mbed-crypto#305 which was added after 2.16.
I will add this info into future PRs. Should git blame to reference patch like you did. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me as well.
Backport of #3393.