Repository navigation
Compat layer: escape control characters in X509 print output - #11682
Open
padelsbach wants to merge 11 commits into
Open
padelsbach wants to merge 11 commits into
padelsbach wants to merge 11 commits into
Conversation
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Some general-name paths remain injectable, and expanded values can unexpectedly make printing fail.
2 open findings
What changed in this PR
Adds control-character escaping to OpenSSL-compatible X.509 print output.
Changes:
- Escapes control characters in certificate, CRL, CSR, SAN, and ACERT fields.
- Adds regression tests and a memory-BIO test helper.
- Corrects verification parameter
hostFlagsinheritance.
| File | Description |
|---|---|
src/x509.c |
Implements escaping and hostFlags inheritance. |
wolfssl/openssl/x509.h |
Enables control escaping for one-line names. |
tests/utils.c |
Adds memory-BIO conversion helper. |
tests/utils.h |
Declares the BIO helper. |
tests/api.c |
Tests certificate, CRL, CSR, and SAN output. |
tests/api/test_ossl_x509_acert.c |
Tests ACERT escaping. |
tests/api/test_ossl_x509_acert.h |
Registers the ACERT test. |
tests/api/test_ossl_x509_vp.c |
Tests hostFlags inheritance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
jenkins retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Escape control characters in the compat layer print functions, matching
OpenSSL. Previously certificate, CRL and CSR fields were printed as-is,
so a crafted certificate could inject content into the output:
Subject:or alt name, tooutput that applications log or show to users
terminal
Fixes issues:
-M05-2
-M05-3
-M05-4
-M05-5
-M05-6
-M05-7
-M05-8
-M05-9
-M19-2
Testing
Added unit tests
Checklist