-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s2n_rand_cleanup: be sure to unregister s2n RAND engine from libcrypto (
#3966) `RAND_bytes()` would fail if called after `s2n_rand_cleanup()`. `libcrypto` internally keeps an RAND "engine table". Calling `RAND_set_rand_engine(NULL)` alone isn't enough to remove s2n's RAND engine from the engine table. It needs to be explicitly unregistered from there by calling `ENGINE_unregister_RAND()`. This patch adds a call to `ENGINE_unregister_RAND()`, so that after `s2n_rand_cleanup()` libcrypto's RAND points back to its builtin RAND engine. Signed-off-by: Rivers Zhang <hzhang320@bloomberg.net> Co-authored-by: Lindsay Stewart <slindsay@amazon.com>
- Loading branch information
1 parent
0c11ca4
commit 405a888
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters