-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add support to define a callback for FIPS test failures instead of aborting the process #2162
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2162 +/- ##
==========================================
+ Coverage 79.04% 79.05% +0.01%
==========================================
Files 612 613 +1
Lines 106238 106376 +138
Branches 15010 15025 +15
==========================================
+ Hits 83974 84096 +122
- Misses 21613 21628 +15
- Partials 651 652 +1 ☔ View full report in Codecov by Sentry. |
…age (#2182) ### Description of changes: In preparation for the callback change in #2162 this change updates all the places that could abort to pass a message to a new abort function that explains why it's about to abort. ### Testing: The existing test-break-kat.go will ensure all the KATs still fail as expected and the messages they print match. 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.
035dd7d
to
0f09484
Compare
2050f2c
to
4f2a415
Compare
4f2a415
to
fa02bf6
Compare
…, also move the callback_test back into crypto_test since it works with everything else now
I realized I could simplify the testing and put it all in crypto_test. I had to update some of the self_check values to not conflict, e.g. the self_check was using an all zero key and we had another test that had an all zero key so break-kat.go didn't know which one was the real one. |
fa02bf6
to
b6dca5d
Compare
1297d02
to
da3ac4b
Compare
927a7de
to
408f243
Compare
Description of changes:
This change adds a new build option
AWSLC_FIPS_FAILURE_CALLBACK
that then requires applications that use AWS-LC to define theAWS_LC_fips_failure_callback(const char* message)
function. If that function is not defined AWS-LC fails to load.When the callback is defined and a FIPS failure (CAST or PWCT) happens AWS-LC calls that function instead. It is up to the calling application to ensure no further cryptographic operations occur. This is not an approved way to use AWS-LC in FIPS mode, for the approved way to build and use AWS-LC see the latest FIPS security policy.
Testing
This change adds a new gtest application that checks the callback function is called with the expected message and is used with break-kat.go and the runtime PCT environment variables to ensure the callback is passed the expected message.
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.