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

Add new CAST tests to break-kat.go #2173

Merged
merged 4 commits into from
Feb 7, 2025
Merged

Conversation

andrewhop
Copy link
Contributor

Description of changes:

This change updates all the KATs in self_check.c to work with break-kat.go.

  1. Mark all the KAT data as static which moves the value into the read only data section
  2. Update the Ed* KATs to use different messages for the signing and verification test so the test can distinguish between the two breaking
  3. Update break-kat.go to break both copies of the ML-KEM public key
  4. Add code to test_fips to trigger the lazy self tests
  5. Update test-break-kat.sh to save the output to a variable so it shows up in the logs
  6. Update the test names to be consistent

Testing:

The existing run_fips_test.sh runs test-break-kat.sh which iterates over all the supported KAT values and ensure the error output references the KAT

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.

@andrewhop andrewhop requested a review from a team as a code owner February 6, 2025 00:45
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.

Project coverage is 78.97%. Comparing base (f407534) to head (a7f44ac).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crypto/fipsmodule/self_check/self_check.c 72.22% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2173      +/-   ##
==========================================
- Coverage   78.98%   78.97%   -0.02%     
==========================================
  Files         611      611              
  Lines      105904   105878      -26     
  Branches    14982    14983       +1     
==========================================
- Hits        83651    83618      -33     
- Misses      21598    21606       +8     
+ Partials      655      654       -1     

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

util/fipstools/break-kat.go Outdated Show resolved Hide resolved
util/fipstools/test_fips.c Show resolved Hide resolved
@andrewhop andrewhop force-pushed the add_fips_cast_tests branch from e63510b to 3f6478c Compare February 6, 2025 22:02
@andrewhop andrewhop force-pushed the add_fips_cast_tests branch from 3f6478c to c46e296 Compare February 6, 2025 22:11
nebeid
nebeid previously approved these changes Feb 7, 2025
@andrewhop andrewhop enabled auto-merge (squash) February 7, 2025 20:06
@andrewhop andrewhop merged commit 41060fe into aws:main Feb 7, 2025
116 of 120 checks passed
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.

4 participants