Generic X.509 certificate helpers and secure file utilities - #276
Generic X.509 certificate helpers and secure file utilities#276stenslae wants to merge 4 commits into
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-src
Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-src
Findings: 3
3 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-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.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Error: GitHubAPIError
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Error: GitHubAPIError
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Error: GitHubAPIError
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-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.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-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.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-src
Failed targets: wolfclu-bugs
a09fd6d to
0592d3a
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-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.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-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.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-bugs, wolfclu-src
Findings: 3
3 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
…eneration/CA signing pipelines
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #276
Scan targets checked: wolfclu-src
Failed targets: wolfclu-bugs
Findings: 3
2 finding(s) posted as inline comments (see file-level comments below)
High (1)
Heap buffer overflow copying PEM-to-DER key material into fixed-size scratch buffers
File: src/x509/clu_x509_sign.c:436
Function: wolfCLU_GenChimeraCertSign
Category: Buffer overflows
caKeyBuf/serverKeyBuf/sapkiBuf/altCaKeyBuf are fixed LARGE_TEMP_SZ (11264-byte) allocations, but after wc_PemToDer the code copies derObj->length bytes into them with no check that derObj->length <= LARGE_TEMP_SZ, at lines 435-436, 482-483, 528-529, and 562-563.
Recommendation: Reject with an error if derObj->length exceeds the destination buffer capacity before each XMEMCPY.
Referenced code: src/x509/clu_x509_sign.c:436-438 (3 lines)
This review was generated automatically by Fenrir. Findings are non-blocking.
| CHECK(wolfCLU_PathsRefEqual("same.txt", "same.txt") == 1, "PathsRefEqual identical"); | ||
| CHECK(wolfCLU_PathsRefEqual("a.txt", "b.txt") == 0, "PathsRefEqual different"); | ||
|
|
||
| f = fopen("test_ref_equal.tmp", "wb"); |
There was a problem hiding this comment.
🔵 [Low] Hardcoded temp filename in PathsRefEqual unit test not PID-scoped · Hardcoded paths, ports, or environment dependencies
test_ref_equal.tmp is a fixed filename in the CWD, unlike the sibling testReadFileToBuffer which PID-scopes its temp file; concurrent/parallel test runs in the same directory can collide.
Fix: Use a PID- or tmpnam-scoped filename as done in testReadFileToBuffer.
Added helper functions to do secure file operations. Added simplified certificate parsing and mapping logic into helper functions. Existing modules were refactored to utilize new functions. Added CI tests for all new changes.
This allows for potential reduction in openssl compat layer reliance and new signature algos.