Fix multiple reported issues. - #11009
Open
kareem-wolfssl wants to merge 4 commits into
Open
Conversation
…reset the buffer state. Thanks to Christos Papakonstantinou (Cantina Security) for the report.
Thanks to Christos Papakonstantinou (Cantina Security) for the report.
Thanks to Christos Papakonstantinou (Cantina Security) for the report.
Thanks to Christos Papakonstantinou (Cantina Security) for the report.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple reported issues (zd#22229) across certificate verification and TLS handshake processing by tightening cleanup semantics and enforcing negotiated values for RPK certificate-type extensions.
Changes:
- Prevent untrusted temporary CA issuers from persisting in the shared CertManager during/after
wolfSSL_X509_verify_cert()and fix object-list cleanup when CRLs are appended. - Enforce “offered vs received” constraints for
client_cert_type/server_cert_type(RFC 7250 / RFC 8446) to reject unsolicited or unoffered negotiated values. - Reset per-handshake RPK negotiation state on SSL object reuse and harden output-buffer shrinking to avoid freeing non-heap memory and to drop stale accounting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/x509_str.c | Harden temp-CA lifecycle during X509 store verification; fix get0_objects() cleanup when CRLs are present. |
| src/tls.c | Reject unsolicited/unoffered cert-type negotiation values for RPK-related TLS extensions. |
| src/ssl.c | Reset RPK negotiation state on WOLFSSL object reuse (preserving isRPKLoaded). |
| src/internal.c | Make ShrinkOutputBuffer() safe for static buffers and reset output accounting when discarding pending output. |
Comments suppressed due to low confidence (1)
src/x509_str.c:1170
- Exit cleanup unconditionally calls wolfSSL_CertManagerUnloadTempIntermediateCerts(), but ignores its return value. If this unload fails (e.g., BAD_MUTEX_E), the function can return success while leaving WOLFSSL_TEMP_CA entries resident in the shared CertManager, undermining the stated goal of always cleaning up temporary trust anchors. Consider propagating cleanup failure (at least when verification otherwise succeeded).
if (ctx->store != NULL) {
wolfSSL_CertManagerUnloadTempIntermediateCerts(ctx->store->cm);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1011
to
1013
| X509StoreRemoveCa(ctx->store, issuer, WOLFSSL_TEMP_CA); | ||
| X509VerifyCertSetupRetry(ctx, certs, failedCerts, | ||
| &depth, origDepth); |
|
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
Fixes zd#22229
Testing
Built in tests, provided reproducers.
Checklist