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

SCRUTINICE fixes #2180

Merged
merged 10 commits into from
Feb 13, 2025
Merged

SCRUTINICE fixes #2180

merged 10 commits into from
Feb 13, 2025

Conversation

smittals2
Copy link
Contributor

@smittals2 smittals2 commented Feb 7, 2025

Issues:

P197895641, P197898490

Description of changes:

Scrutinice alerts for a null check and potential memory leak

Call-outs:

Point out areas that need special attention or support during the review process. Discuss architecture or design changes.

Testing:

How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?

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.

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.02%. Comparing base (bd09b3a) to head (fef7beb).

Files with missing lines Patch % Lines
crypto/fipsmodule/evp/p_pqdsa.c 33.33% 2 Missing ⚠️
crypto/fipsmodule/pqdsa/pqdsa.c 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2180      +/-   ##
==========================================
- Coverage   79.03%   79.02%   -0.01%     
==========================================
  Files         612      612              
  Lines      106064   106067       +3     
  Branches    14984    14984              
==========================================
- Hits        83829    83823       -6     
- Misses      21581    21590       +9     
  Partials      654      654              

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

@smittals2 smittals2 marked this pull request as ready for review February 8, 2025 00:29
@smittals2 smittals2 requested a review from a team as a code owner February 8, 2025 00:29
@smittals2 smittals2 requested a review from andrewhop February 8, 2025 01:21
@smittals2 smittals2 assigned smittals2 and unassigned smittals2 Feb 11, 2025
justsmth
justsmth previously approved these changes Feb 11, 2025
justsmth
justsmth previously approved these changes Feb 12, 2025
Comment on lines 29 to 30
uint8_t empty_msg[1] = {0};
int ret = ml_dsa_sign(params, signature, &params->bytes, empty_msg, 0, NULL, 0, sk);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional? empty_message is actually 1 uint8_t long, but you're passing in 0 for the length

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea previously this code was passing in NULL which never gets checked. I tried doing a 0 length array, but you cant initialize an array of 0 length on c89/90 I believe. So then I did a 1 length arr. But still passing in length 0 so it's considered an empty message. This is intentional.

Per Jake, what the message is doesn't matter for the PCT.

@smittals2 smittals2 enabled auto-merge (squash) February 13, 2025 00:36
@smittals2 smittals2 merged commit 7518c78 into aws:main Feb 13, 2025
115 of 118 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