Fenrir fixes across AES, ECC, RSA, SLH-DSA, DH, and PKIX revocation - #265
Open
cconlon wants to merge 9 commits into
Open
Fenrir fixes across AES, ECC, RSA, SLH-DSA, DH, and PKIX revocation#265cconlon wants to merge 9 commits into
cconlon wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR applies a set of security/correctness fixes (“Fenrir” items) across JNI wrappers and the wolfJCE provider, and adds targeted regression tests to prevent reintroductions (AES-OFB, ECC makeKeyOnCurve error mapping, RSA PKCS#8 encoding, AES-GMAC lifecycle, keySize operator parsing, and PKIX revocation fail-closed behavior).
Changes:
- Fixes crypto/JNI behaviors (AES-OFB key schedule, ECC curve/arg error reporting, RSA PKCS#8 size-query ordering, SLH-DSA private buffer zeroization fallback, AES-GMAC init/free + re-key-after-release blocking, DH secret logging removal, CertManager JNI early-return on failed array acquisition).
- Tightens PKIX revocation semantics to fail closed with
UNDETERMINED_REVOCATION_STATUSwhenPREFER_CRLS+NO_FALLBACKhas no CRL source (with SOFT_FAIL support). - Extends disabledAlgorithms parsing to evaluate additional
keySizeoperators, with new/updated tests for operator behavior.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/com/wolfssl/wolfcrypt/test/RsaTest.java | Adds PKCS#8 encode/decode round-trip regression test for RSA private keys. |
| src/test/java/com/wolfssl/wolfcrypt/test/EccTest.java | Adds test asserting null RNG is reported as BAD_FUNC_ARG (not a curve error). |
| src/test/java/com/wolfssl/wolfcrypt/test/AesOfbTest.java | Adds OFB decrypt-mode setKey round-trip regression coverage. |
| src/test/java/com/wolfssl/wolfcrypt/test/AesGmacTest.java | Adds test asserting re-key after release throws. |
| src/test/java/com/wolfssl/provider/jce/test/WolfCryptUtilTest.java | Expands test coverage for keySize operators and clarifies floor behavior. |
| src/test/java/com/wolfssl/provider/jce/test/WolfCryptPKIXCertPathValidatorTest.java | Adds PKIX revocation tests for PREFER_CRLS/NO_FALLBACK missing/empty CRL sources (+ SOFT_FAIL behavior). |
| src/main/java/com/wolfssl/wolfcrypt/AesGmac.java | Adjusts native release semantics and state tracking for AES-GMAC lifecycle. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptUtil.java | Updates disabledAlgorithms parsing to evaluate more keySize operators and change return semantics for known key sizes. |
| src/main/java/com/wolfssl/provider/jce/WolfCryptPKIXRevocationChecker.java | Adds helper to fail closed on missing CRL source under PREFER_CRLS/NO_FALLBACK (SOFT_FAIL aware). |
| src/main/java/com/wolfssl/provider/jce/WolfCryptPKIXCertPathValidator.java | Enforces fail-closed revocation status in additional PREFER_CRLS/NO_FALLBACK scenarios and corrects failure index handling. |
| jni/jni_wolfssl_cert_manager.c | Returns early on failed GetByteArrayElements in CertManager buffer wrappers. |
| jni/jni_slhdsa.c | Introduces version-guarded zeroization macro fallback for private buffers. |
| jni/jni_rsa.c | Fixes RSA PKCS#8 encoding flow by DER-encoding before size query that inspects key bytes. |
| jni/jni_ecc.c | Distinguishes make_key_ex argument errors from unsupported/disabled curves. |
| jni/jni_dh.c | Stops logging DH private/shared-secret material in debug output. |
| jni/jni_aesofb.c | Forces AES-OFB to use encryption key schedule regardless of opmode. |
| jni/jni_aesgmac.c | Ensures AES backend init/free are paired for AES-GMAC operations and object lifecycle. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
This PR includes nine Fenrir fixes: