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

[DRAFT] Flip to new randomness generation backend and remove the existing #2147

Draft
wants to merge 3 commits into
base: randomness_generation
Choose a base branch
from

Conversation

torben-hansen
Copy link
Contributor

@torben-hansen torben-hansen commented Jan 29, 2025

Description of changes:

This PR removes the existing randomness generation and replaces it with the new one. It does a number of things to do that:

  • removes "unsafe buffering" mode. This is not a thing in the new implementation and was never used.
  • move rdrand implementation to the entropy source implementation file
  • removes the ability to specify the "entropy source" at compile time. The flag is retained by build backwards compatibility. There is only a single (validable) entropy source left, and that is jitter entropy. (other sources are used, but not validatable).
  • passive entropy is removed completely.
  • the PRNG model test is disabled until I fix it.
  • RAND_bytes_with_user_prediction_resistance() is introduced as a public API. It replaces the internal RAND_bytes_with_additional_data().
  • correct sandbox test to account for getrandom usage.

Call-outs:

Future PRs will expand tests and re-enable the PRNG model test.

Testing:

Existing testing now uses the new randomness generation backend.

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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 92.89941% with 12 lines in your changes missing coverage. Please review.

Project coverage is 78.78%. Comparing base (19e9b93) to head (f2aed9d).

Files with missing lines Patch % Lines
crypto/fipsmodule/rand/rand.c 95.51% 7 Missing ⚠️
crypto/fipsmodule/rand/entropy/entropy_sources.c 54.54% 5 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           randomness_generation    #2147      +/-   ##
=========================================================
+ Coverage                  78.73%   78.78%   +0.04%     
=========================================================
  Files                        608      606       -2     
  Lines                     102800   102471     -329     
  Branches                   14585    14532      -53     
=========================================================
- Hits                       80944    80729     -215     
+ Misses                     21144    21042     -102     
+ Partials                     712      700      -12     

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

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.

2 participants