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

Default entropy source #1872

Conversation

torben-hansen
Copy link
Contributor

Description of changes:

This PR implements a default entropy source object for the randomness generation. This is done by defining the function table that is already assumed by the randomness generation code in new_rand.c. The configuration is similar to the one already being used but simplified. It's now assumed that an entropy source can never not be initialised which seems reasonable...

Since the entropy source method table is a const object, get_entropy_source() is changed to return a reference to it. Related code is also changed to take this into account.

Finally, the entropy source object "cleanup" function is changed to not return anything. It's called at thread exit and if it fails there is no way to recover anyway.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@torben-hansen torben-hansen requested a review from a team as a code owner September 23, 2024 21:21
@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 60.97561% with 16 lines in your changes missing coverage. Please review.

Project coverage is 78.43%. Comparing base (bc7aeff) to head (f5ca39b).

Files with missing lines Patch % Lines
crypto/fipsmodule/rand/entropy/entropy_sources.c 67.85% 9 Missing ⚠️
crypto/fipsmodule/rand/new_rand.c 54.54% 5 Missing ⚠️
crypto/fipsmodule/rand/rand.c 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           randomness_generation    #1872      +/-   ##
=========================================================
- Coverage                  78.44%   78.43%   -0.01%     
=========================================================
  Files                        585      585              
  Lines                      97004    97020      +16     
  Branches                   13889    13903      +14     
=========================================================
+ Hits                       76091    76102      +11     
- Misses                     20295    20301       +6     
+ Partials                     618      617       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dkostic
dkostic previously approved these changes Sep 23, 2024
@torben-hansen torben-hansen merged commit a11fc48 into aws:randomness_generation Sep 27, 2024
104 of 106 checks passed
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

Successfully merging this pull request may close these issues.

4 participants