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

Implementation passive entropy #1125

Merged
merged 13 commits into from
Aug 7, 2023

Conversation

torben-hansen
Copy link
Contributor

@torben-hansen torben-hansen commented Aug 1, 2023

Issues

CryptoAlg-1953

Description of changes:

Implement passive entropy FIPS source.

Call-outs:

Currently, to compile with this source use -DUSE_FIPS_ENTROPY_SOURCE_PASSIVE. In the future this will be swapped over to be the default and the Jitter CPU source will be an option that must be enabled at build-time.

This PR adds back the state parameter to rand_get_seed - it makes more sense since the state might be needed and there is no need to query the thread list twice...

Testing:

Adds an additional target to CI that uses the special build-option -DUSE_FIPS_ENTROPY_SOURCE_PASSIVE and pass over one run_tests target.

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 August 1, 2023 16:50
CMakeLists.txt Show resolved Hide resolved
crypto/fipsmodule/rand/internal.h Show resolved Hide resolved
crypto/fipsmodule/rand/internal.h Outdated Show resolved Hide resolved
crypto/fipsmodule/rand/rand.c Outdated Show resolved Hide resolved
crypto/fipsmodule/rand/rand.c Outdated Show resolved Hide resolved
@torben-hansen torben-hansen force-pushed the implementation_passive_entropy branch from 6a83064 to 37771cb Compare August 2, 2023 19:45
skmcgrail
skmcgrail previously approved these changes Aug 2, 2023
@torben-hansen torben-hansen requested a review from andrewhop August 3, 2023 13:48
crypto/fipsmodule/rand/rand.c Show resolved Hide resolved
tests/ci/run_posix_tests.sh Outdated Show resolved Hide resolved
crypto/fipsmodule/rand/rand.c Show resolved Hide resolved
andrewhop
andrewhop previously approved these changes Aug 4, 2023
skmcgrail
skmcgrail previously approved these changes Aug 4, 2023
@torben-hansen torben-hansen enabled auto-merge (squash) August 4, 2023 18:18
@torben-hansen torben-hansen dismissed stale reviews from skmcgrail and andrewhop via b5d9e7c August 4, 2023 18:32
andrewhop
andrewhop previously approved these changes Aug 4, 2023
@torben-hansen torben-hansen merged commit 6ba258c into aws:main Aug 7, 2023
torben-hansen added a commit to torben-hansen/aws-lc that referenced this pull request Sep 18, 2023
skmcgrail pushed a commit that referenced this pull request Sep 20, 2023
* Make PRNG model slightly more readable (#1079)

The way the PRNG model is written looks more complicated than what is actually needed. Attempt to re-write it. This also makes it slightly easier to amend with future potential changes.

* Remove CRNGT (#1112)

CRNGT is not a requirement for FIPS 140-3.

FIPS 140-2 Section 4.9.2 required the execution of the Continuous Randomness Number Generation Test (CRNGT). However, this requirement is not present in FIPS 140-3. In addition, later stages of FIPS 140-2 this test was not mandatory in all cases either (cf. FIPS 140-2 IG 9.8).

Executing this test requires maintaining state, which inevitably introduces complexity. Given CRNGT is redundant with respect to compliance and really provides zero practical value (see, again, FIPS 140-2 IG 9.8), we axe it.

* Abstract fips entropy functions (#1113)

Abstract getting data from the configured entropy source of FIPS. Atm, the configured source is hard-coded in multiple workflows. This allows adding another source more easily.

In addition, add some machinery to configure another source of build-time using the new define FIPS_ENTROPY_SOURCE_JITTER_CPU.

* Implementation passive entropy (#1125)

* Use passive entropy source method by default for FIPS build mode (#1188)

Enables passive entropy method by default. In addition, adds a build-time config that can modify (at build-time) the entropy source method to CPU Jitter.

* Kick CI bots

* Kick CI bots, again
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.

3 participants