Harden X509 DER length handling in wolfSSL_X509_get_der and wolfSSL_i2d_X509#10212
Merged
dgarske merged 1 commit intoJun 8, 2026
Merged
Conversation
b159a2a to
335c054
Compare
9d00aca to
5bb246e
Compare
5295ab2 to
2d95ee8
Compare
2d95ee8 to
9d05b0c
Compare
|
retest this please |
9d05b0c to
d68d575
Compare
d68d575 to
a4eec4a
Compare
…2d_X509
- src/x509.c: Guard wolfSSL_X509_get_der against derCert->length > INT_MAX, and reject derSz <= 0 in wolfSSL_i2d_X509.
- tests/api/test_ossl_x509_io.{c,h}: Add API coverage for the X509 DER length guards.
a4eec4a to
368e148
Compare
Contributor
Author
|
retest this please |
dgarske
reviewed
Jun 8, 2026
dgarske
left a comment
Member
There was a problem hiding this comment.
Skoll Code Review
Scan type: reviewOverall recommendation: COMMENT
Findings: 2 total — 2 posted, 0 skipped
2 finding(s) posted as inline comments (see file-level comments below)
Posted findings
- [Low] MEMORY_E returned for zero-length DER is semantically misleading —
src/x509.c:8842-8845 - [Info] Overflow guard is a tautology on (extremely rare) 64-bit-int platforms —
src/x509.c:4526-4528
Review generated by Skoll
dgarske
approved these changes
Jun 8, 2026
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.
Summary
wolfSSL_X509_get_deragainstderCert->length > INT_MAX, and rejectderSz <= 0inwolfSSL_i2d_X509.Note
The SRTP KDF work originally mentioned on this branch was absorbed upstream; this PR now contains only X509 DER length hardening.