Skip to content

Fenrir fixes: buffer frees, struct resets, Gradle distribution SHA-256#210

Merged
rlm2002 merged 11 commits intowolfSSL:masterfrom
cconlon:fenrir46
Apr 6, 2026
Merged

Fenrir fixes: buffer frees, struct resets, Gradle distribution SHA-256#210
rlm2002 merged 11 commits intowolfSSL:masterfrom
cconlon:fenrir46

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Apr 6, 2026

This PR addresses 15 Fenrir reports for zeroing out buffers, resetting structs, and adding a SHA-256 hash to very the Gradle distribution in the Android Studio example project.

@cconlon cconlon self-assigned this Apr 6, 2026
Copilot AI review requested due to automatic review settings April 6, 2026 16:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Addresses Fenrir findings by adding explicit cleanup of sensitive JNI buffers/structs and improving Android Gradle Wrapper integrity verification.

Changes:

  • Zeroize temporary buffers before freeing (RSA, DH, ChaCha, Curve25519, Ed25519, PEM/DER conversions).
  • Add missing frees/reset behavior for cryptographic structs (e.g., GMAC AES context).
  • Add distributionSha256Sum to the Android Gradle wrapper configuration.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
jni/jni_wolfcrypt.c Zeroizes DER buffer before free in PEM->DER conversion cleanup.
jni/jni_rsa.c Zeroizes RSA temporary output buffer before free.
jni/jni_hmac.c Attempts to wipe HMAC temp buffer after logging.
jni/jni_ed25519.c Adds output buffer size tracking and wipes exported key buffer before free.
jni/jni_dh.c Improves DH encode logging/return handling and wipes DER buffers on cleanup.
jni/jni_curve25519.c Adds buffer size tracking and wipes shared secret buffer before free (but one cleanup call looks incorrect).
jni/jni_chacha.c Wipes ChaCha output buffer before free.
jni/jni_aesgmac.c Frees GMAC AES context before returning.
jni/jni_aescmac.c Attempts to wipe CMAC temp buffer after use.
IDE/Android/gradle/wrapper/gradle-wrapper.properties Adds SHA-256 checksum for Gradle distribution download verification.
Comments suppressed due to low confidence (1)

jni/jni_ed25519.c:1

  • outpuBufSz appears to be a typo, and outputBufSz is used/assigned without being declared in this function, which should cause a compile error. Rename the declared variable to outputBufSz (or consistently use outpuBufSz) and update all references so the buffer-size tracking variable is declared and used consistently.
/* jni_ed25519.c

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread jni/jni_curve25519.c Outdated
Comment thread jni/jni_hmac.c Outdated
Comment thread jni/jni_aescmac.c Outdated
Comment thread jni/jni_wolfcrypt.c
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread jni/jni_chacha.c Outdated
Comment thread jni/jni_aesgmac.c
Comment thread jni/jni_aesgmac.c
@rlm2002 rlm2002 merged commit 9515b27 into wolfSSL:master Apr 6, 2026
129 of 130 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.

3 participants