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

Avoid double seed for non-UBE support runtimes #2259

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

Conversation

torben-hansen
Copy link
Contributor

Description of changes:

In the non-UBE support runtime, a fresh lazy init will spawn a seed of the CTR-DRBG state. But then in rand_bytes_core(), there will be an immediate spawn of a reseed of the CTR-DRBG state to ensure uniqueness for non-UBE support.

Fix this by telling rand_bytes_core whether the CTR-DRBG state is fresh or not.

This requires a few changes in the tests to account for a reseed that might not happen. Now I'm there, refactor a bit.

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 March 9, 2025 21:38
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.03%. Comparing base (1b0a250) to head (8803926).

Files with missing lines Patch % Lines
crypto/fipsmodule/rand/new_rand_test.cc 73.68% 5 Missing ⚠️
crypto/fipsmodule/rand/rand.c 80.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           randomness_generation    #2259      +/-   ##
=========================================================
+ Coverage                  79.00%   79.03%   +0.02%     
=========================================================
  Files                        628      628              
  Lines                     107202   107223      +21     
  Branches                   15163    15164       +1     
=========================================================
+ Hits                       84699    84740      +41     
+ Misses                     21790    21770      -20     
  Partials                     713      713              

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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