Skip to content

Fix path concatenation in wolfCLU_CertSignAppendOut#197

Merged
dgarske merged 1 commit into
wolfSSL:mainfrom
kojo1:path_concat
Mar 20, 2026
Merged

Fix path concatenation in wolfCLU_CertSignAppendOut#197
dgarske merged 1 commit into
wolfSSL:mainfrom
kojo1:path_concat

Conversation

@kojo1

@kojo1 kojo1 commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

When both new_certs_dir (from config file) and -out option are
specified in the ca command, the output paths were incorrectly
concatenated.

Bug example:

Config: new_certs_dir = /tmp/certs
Command: wolfssl ca -config ca.conf -out /tmp/output/signed.pem ...
Result: /tmp/certs/tmp/output/signed.pem (wrong)
Expected: /tmp/output/signed.pem
Root Cause
In wolfCLU_CertSignAppendOut() (src/x509/clu_x509_sign.c), when appending
the -out path to new_certs_dir:

Absolute paths in -out were not detected and should override
new_certs_dir
Path separator / was missing when concatenating directory and filename

@kojo1 kojo1 changed the title Fix path concatenation bug in wolfCLU_CertSignAppendOut Fix path concatenation in wolfCLU_CertSignAppendOut Jan 30, 2026
@kojo1
kojo1 requested a review from wolfSSL-Bot March 18, 2026 21:47
@dgarske
dgarske merged commit 402548e into wolfSSL:main Mar 20, 2026
17 of 18 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.

2 participants