Skip to content

Fenrir Fixes: Error Handling#584

Merged
padelsbach merged 2 commits into
wolfSSL:masterfrom
stenslae:pr-error-handling
Jul 14, 2026
Merged

Fenrir Fixes: Error Handling#584
padelsbach merged 2 commits into
wolfSSL:masterfrom
stenslae:pr-error-handling

Conversation

@stenslae

@stenslae stenslae commented Jul 1, 2026

Copy link
Copy Markdown
Member

Fixes error handling across wolfSSL example files, split into two commits by area:

Crypto/signature examples, 19 findings: F-1298 F-1302 F-1307 F-1712 F-1713 F-1719 F-1720 F-1721 F-1722 F-2093 F-3466 F-3472 F-3477 F-4131 F-4132 F-4600 F-5612 F-6286 F-6289 F-6536

TLS/DTLS/protocol examples, 14 findings: F-1296 F-1301 F-1706 F-2112 F-2893 F-2900 F-3223 F-3899 F-4121 F-4123 F-4127 F-4128 F-4603 F-4604

Fixed: unchecked wc_InitRng/key-init return values, NULL derefs from wolfSSL_get_error() on a NULL ssl, error paths that fall through instead of goto cleanup/return, fd/resource leaks on error, and writing unauthenticated plaintext to disk before AEAD tag verification in both AES-GCM and Ascon file-encrypt examples.

@stenslae stenslae self-assigned this Jul 1, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #584

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-src

No new issues found in the changed files. ✅

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #584

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-src

No new issues found in the changed files. ✅

@stenslae stenslae removed their assignment Jul 7, 2026
@stenslae stenslae force-pushed the pr-error-handling branch from e4a68e6 to ac65945 Compare July 9, 2026 22:02

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #584

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread crypto/aes/aesgcm-file-encrypt.c
Comment thread crypto/aes/aesgcm-file-encrypt.c

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #584

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread crypto/aes/aesgcm-file-encrypt.c Outdated
@stenslae stenslae marked this pull request as draft July 10, 2026 15:59
@stenslae stenslae assigned stenslae and unassigned wolfSSL-Bot Jul 10, 2026
Comment thread crypto/aes/aesgcm-file-encrypt.c Outdated
@stenslae stenslae force-pushed the pr-error-handling branch from 95a55ff to 8c1440a Compare July 10, 2026 19:13
@stenslae stenslae marked this pull request as ready for review July 10, 2026 19:51
@stenslae stenslae force-pushed the pr-error-handling branch from 8c1440a to 1aa7934 Compare July 13, 2026 21:11
@stenslae stenslae requested review from wolfSSL-Fenrir-bot and removed request for wolfSSL-Fenrir-bot July 13, 2026 21:53
@stenslae stenslae force-pushed the pr-error-handling branch from 1aa7934 to 4149b0b Compare July 13, 2026 22:44

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #584

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-src

No new issues found in the changed files. ✅

@stenslae stenslae assigned padelsbach and unassigned stenslae Jul 14, 2026
@stenslae stenslae force-pushed the pr-error-handling branch from 4149b0b to b4822ff Compare July 14, 2026 19:46
@padelsbach

Copy link
Copy Markdown
Contributor

@stenslae, even more conflicts after that last merge

Emma Stensland added 2 commits July 14, 2026 14:47
… F-3466 F-3472 F-3477 F-4131 F-4132 F-4600 F-5612 F-6286 F-6289 F-6536: Fix error handling in crypto and signature examples

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #584

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-src
Findings: 2
1 finding(s) posted as inline comments (see file-level comments below)

Low (1)

Redundant unlink() call added to decrypt_file_AesGCM

Function: decrypt_file_AesGCM
Category: Code Quality

The PR adds a second if (ret != 0) { unlink(out_file); } block immediately following a pre-existing identical block at lines 495–501. While the second call is redundant and harmless (the file is already removed by the first block), it represents unnecessary code added by the PR. The change is not a security vulnerability.

Recommendation: Remove the redundant second unlink(out_file) call to eliminate unnecessary code.


This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread crypto/aes/aesgcm-file-encrypt.c
@padelsbach padelsbach merged commit 8c968eb into wolfSSL:master Jul 14, 2026
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.

4 participants