Skip to content

Fix multiple reported issues. - #11009

Open
kareem-wolfssl wants to merge 4 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd22229
Open

Fix multiple reported issues.#11009
kareem-wolfssl wants to merge 4 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd22229

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes zd#22229

Testing

Built in tests, provided reproducers.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

…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.
@kareem-wolfssl kareem-wolfssl self-assigned this Jul 30, 2026
Copilot AI review requested due to automatic review settings July 30, 2026 00:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread src/x509_str.c
Comment on lines +1011 to 1013
X509StoreRemoveCa(ctx->store, issuer, WOLFSSL_TEMP_CA);
X509VerifyCertSetupRetry(ctx, certs, failedCerts,
&depth, origDepth);
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m3

  • FLASH: .text +8 B (+0.0%, 122,619 B / 262,144 B, total: 47% used)

gcc-arm-cortex-m4

  • FLASH: .text +64 B (+0.0%, 200,917 B / 262,144 B, total: 77% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text -64 B (-0.0%, 770,964 B / 1,048,576 B, total: 74% used)

linuxkm-standard

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