crypto: fix Argon2 FIPS bypass and KDF error loss - #64776
Open
panva wants to merge 2 commits into
Open
Conversation
The private OSSL_LIB_CTX used for OSSL_set_max_threads() inherits no configuration, so Argon2 escaped FIPS mode and --openssl-config. Check availability against the default context, and create the private one only when lanes > 1. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
The ncrypto KDF helpers cleared the OpenSSL error queue on return, and the traits insert their own message, which makes DeriveBitsJob skip errors->Capture(). Argon2, HKDF, PBKDF2 and scrypt failures were therefore bare Errors with no code and no opensslErrorStack. Drop the guard, which DeriveBitsJob already provides, and capture before inserting since Capture() clears the store. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64776 +/- ##
=======================================
Coverage 90.14% 90.15%
=======================================
Files 744 744
Lines 242518 242522 +4
Branches 45685 45698 +13
=======================================
+ Hits 218611 218634 +23
- Misses 15396 15402 +6
+ Partials 8511 8486 -25
🚀 New features to boost your workflow:
|
Collaborator
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.
Argon2 ran its KDF in a private
OSSL_LIB_CTX, which inherits no configuration, so itworked in FIPS mode while every other non-approved algorithm was refused. Availability is
now checked against the default context.
The KDF helpers also cleared the OpenSSL error queue on return, leaving Argon2, HKDF,
PBKDF2 and scrypt failures as bare
Errors with nocodeoropensslErrorStack.