F 569 : Fix stack buffer overflow in encryption setup#212
F 569 : Fix stack buffer overflow in encryption setup#212dgarske merged 7 commits intowolfSSL:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a stack buffer overflow in the encryption CLI setup by replacing unbounded scanf("%s", ...) reads with bounded fgets() reads, and adds regression tests to validate stdin-driven input/output filename paths.
Changes:
- Replace unbounded
scanfwith boundedfgetsfor-in/-outprompts in encryption setup. - Add regression tests that supply input/output filenames via stdin (including a non-EVP path probe).
- Expand an OCSP interop test’s expected error-message matching.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/ocsp/ocsp-interop-test.sh | Broadens grep pattern to recognize more “missing file” error variants. |
| tests/encrypt/enc-test.sh | Adds stdin-based regression tests covering the new fgets() input handling. |
| src/x509/clu_x509_sign.c | Minor formatting cleanup + extends hash-type switch cases under a version gate. |
| src/crypto/clu_crypto_setup.c | Replaces unsafe scanf("%s") reads with fgets() and newline trimming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9b1c8c5 to
2a009f1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2a009f1 to
36e3285
Compare
dgarske
left a comment
There was a problem hiding this comment.
🐺 Skoll Code Review
Overall recommendation: APPROVE
Findings: 3 total — 3 posted, 0 skipped
Posted findings
- [Medium] Significant code duplication across three fgets+validation blocks —
src/crypto/clu_crypto_setup.c:346-490 - [Medium] No test coverage for the 'input too long' fgets truncation path —
tests/encrypt/enc-test.sh:188-275 - [Low] Minor:
in = inNameassignment after the while loop is now redundant —src/crypto/clu_crypto_setup.c:376
Review generated by Skoll via openclaw
36e3285 to
6f2525c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix stack buffer overflow via unbounded scanf in encryption setup
Add test coverage
Depends on: #211 (Merged)
Depends on: #219