Skip to content

[FIPS 4.0 - CHERRY-PICK] Fix argument order in hmac_copy#3016

Merged
justsmth merged 1 commit intoaws:fips-2025-09-12from
justsmth:fips-2025-09-12-fix-hmac-copy
Feb 19, 2026
Merged

[FIPS 4.0 - CHERRY-PICK] Fix argument order in hmac_copy#3016
justsmth merged 1 commit intoaws:fips-2025-09-12from
justsmth:fips-2025-09-12-fix-hmac-copy

Conversation

@justsmth
Copy link
Copy Markdown
Contributor

Original PR: #3014


Issues:

Addresses: V2098002583

Context:

hmac_copy (the EVP_PKEY_CTX copy handler for HMAC) passed the kTmp source and destination arguments to HMAC_KEY_copy in the wrong order. When EVP_PKEY_CTX_dup was called, the key material (ktmp) was zeroed out on the source context instead of being copied to the destination.

Description of changes:

Corrects argument order and adds test.

Testing:

This adds a regression test that duplicates an HMAC keygen context and then generates keys from both the duplicate and the original, verifying the key bytes match the expected value.

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.

@justsmth justsmth merged commit 59455f7 into aws:fips-2025-09-12 Feb 19, 2026
123 of 152 checks passed
@justsmth justsmth deleted the fips-2025-09-12-fix-hmac-copy branch February 19, 2026 21:50
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.71%. Comparing base (2c1caef) to head (4001586).
⚠️ Report is 1 commits behind head on fips-2025-09-12.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           fips-2025-09-12    #3016      +/-   ##
===================================================
- Coverage            78.89%   78.71%   -0.19%     
===================================================
  Files                  667      667              
  Lines               113044   113057      +13     
  Branches             16060    16072      +12     
===================================================
- Hits                 89190    88988     -202     
- Misses               23073    23293     +220     
+ Partials               781      776       -5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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