Skip to content

Fenrir fixes across AES, ECC, RSA, SLH-DSA, DH, and PKIX revocation - #265

Open
cconlon wants to merge 9 commits into
wolfSSL:masterfrom
cconlon:fenrirAug24
Open

Fenrir fixes across AES, ECC, RSA, SLH-DSA, DH, and PKIX revocation#265
cconlon wants to merge 9 commits into
wolfSSL:masterfrom
cconlon:fenrirAug24

Conversation

@cconlon

@cconlon cconlon commented Aug 26, 2026

Copy link
Copy Markdown
Member

This PR includes nine Fenrir fixes:

  • F-11201: Use AES_ENCRYPTION key schedule for AES-OFB.
  • F-11202: Report ECC make_key_ex argument errors distinctly from an unsupported or disabled curve.
  • F-11203: Zeroize SLH-DSA private buffer via a version-guarded ForceZero fallback macro.
  • F-11204: Encode the RSA DER key before the PKCS#8 size query that inspects it.
  • F-11205: Free the embedded AES on AesGmac release, pair it with wc_AesInit, and block re-key after release.
  • F-11206: Return early on failed JNI array acquisition in the CertManager buffer wrappers.
  • F-11212: Fail closed with UNDETERMINED_REVOCATION_STATUS when PREFER_CRLS with NO_FALLBACK has no CRL source.
  • F-11213: Evaluate all keySize operators in jdk.certpath.disabledAlgorithms.
  • F-11215: Stop logging the DH shared secret and private key in debug output.

@cconlon cconlon self-assigned this Aug 26, 2026
Copilot AI lite review requested due to automatic review settings August 26, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_STATUS when PREFER_CRLS + NO_FALLBACK has no CRL source (with SOFT_FAIL support).
  • Extends disabledAlgorithms parsing to evaluate additional keySize operators, 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.

Comment thread src/main/java/com/wolfssl/wolfcrypt/AesGmac.java
Comment thread src/main/java/com/wolfssl/provider/jce/WolfCryptUtil.java Outdated
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.

2 participants