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

Cleanse the right amount of bytes in HMAC. #1613

Merged
merged 2 commits into from
May 31, 2024

Conversation

nebeid
Copy link
Contributor

@nebeid nebeid commented May 30, 2024

Issues:

N/A

Description of changes:

EVP_MAX_MD_BLOCK_SIZE is the block size in bytes. It is divided by 8 in a 64-bit word array initialisation in hmac.c

This partially reverts "Zeroize data immediately after use for FIPS (#911)", commit c7a9fd0, while keeping and correcting the cleansing.

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.

EVP_MAX_MD_BLOCK_SIZE is the block size in bytes.

This partially reverts "Zeroize data immediately after use for FIPS (aws#911)",
commit c7a9fd0.
@nebeid nebeid requested a review from a team as a code owner May 30, 2024 16:28
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.03%. Comparing base (ffbf2da) to head (e8be6e9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1613   +/-   ##
=======================================
  Coverage   78.03%   78.03%           
=======================================
  Files         562      562           
  Lines       94558    94558           
  Branches    13573    13574    +1     
=======================================
  Hits        73792    73792           
+ Misses      20173    20172    -1     
- Partials      593      594    +1     

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

samuel40791765
samuel40791765 previously approved these changes May 30, 2024
uint64_t pad[EVP_MAX_MD_BLOCK_SIZE_BYTES] = {0};
uint64_t key_block[EVP_MAX_MD_BLOCK_SIZE_BYTES] = {0};
uint64_t pad[EVP_MAX_MD_BLOCK_SIZE / 8] = {0};
uint64_t key_block[EVP_MAX_MD_BLOCK_SIZE / 8] = {0};
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: sizeof(uint64_t) instead of 8 might be a little more clear.

@nebeid nebeid enabled auto-merge (squash) May 31, 2024 18:35
@nebeid nebeid merged commit 3324473 into aws:main May 31, 2024
88 of 92 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