Merged
Conversation
ac0e304 to
b67617d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3064 +/- ##
==========================================
+ Coverage 78.37% 78.53% +0.16%
==========================================
Files 689 689
Lines 121148 121175 +27
Branches 16973 16982 +9
==========================================
+ Hits 94948 95169 +221
+ Misses 25302 25106 -196
- Partials 898 900 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
justsmth
previously approved these changes
Mar 3, 2026
WillChilds-Klein
approved these changes
Mar 3, 2026
justsmth
approved these changes
Mar 3, 2026
WillChilds-Klein
pushed a commit
to WillChilds-Klein/aws-lc
that referenced
this pull request
Mar 11, 2026
### Issues: Resolves: 17, 56, 58, 60 ### Description of changes: This PR rejects XOF digests in HKDF, cleanse sensitive states, and update function pointers: * HKDF is built on HMAC, which does not support XOF (extendable-output) algorithms such as SHAKE128 and SHAKE256. Previously, passing a SHAKE digest would fall through to HMAC, which rejects it internally - except in HKDF_expand, where EVP_MD_size() returns 0 for XOF digests, causing a division by zero before HMAC is ever called. * Add early EVP_MD_FLAG_XOF checks to all three public HKDF functions so that XOF digests are rejected immediately with a clear error rather than causing undefined behavior or relying on HMAC's internal rejection. * Cleanse bitstates in batched SHAKE operations. * Clean up digest context on early return in EVP_Digest. * Explicitly set XOF function pointers to NULL for EVP_sha512_224. ### Call-out: * Some check are _redundant_ - HKDF calls with SHAKE will fail once HMAC-layer is reached. However, this _redundancy_ aims at early failing in the expected API layer, thus prevents hidden bugs as the division by zero. ### Testing: `./crypto/crypto_test` 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. --------- Co-authored-by: Justin W Smith <103147162+justsmth@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues:
Resolves: 17, 56, 58, 60
Description of changes:
This PR rejects XOF digests in HKDF, cleanse sensitive states, and update function pointers:
Call-out:
Testing:
./crypto/crypto_testBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.