Only abort when RSA PWCT fail in FIPS #2020
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
We've been getting abort failures when building with FIPS mode against Ruby's break tests. The issue happens to be related to the abort call we do when calls to
RSA_generate_key_ex
fail.In the original commit where this was introduced (6bdd4c3), it's mentioned that "It's required that the FIPS module aborts when PCT tests fail in
RSA_check_fips()
." Our current behavior fails regardless of a regular RSA failure or a PWCT failure, which causes regular RSA failures to unintentionally abort as well.This changes aborting to only happen during failures in
RSA_check_fips
. Our existing death tests were also expecting failures during regular RSA failures rather than PWCT failures, so I've tweaked the tests to account for that. Ruby's RSA break test passes successfully with this change.Call-outs:
The new test is ran when the CFLAG
BORINGSSL_FIPS_BREAK_TESTS
is set, so I've updated our test script to run tests when building with this dimension. This leverages our existing break tests to test PWCT aborting behavior.Testing:
New test dimension
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.