Repository navigation
Add Mbed TLS 4.x verify callbacks and VERIFY_OPTIONAL - #56
Open
padelsbach wants to merge 4 commits into
Open
padelsbach wants to merge 4 commits into
padelsbach wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The default TLS bounds request protocols without checking whether they are compiled in, causing mbedtls_ssl_setup() to fail when TLS 1.3 is disabled.
1 open issue
What changed in this PR
This PR expands wolfPSA’s Mbed TLS 4.x compatibility layer with wolfSSL-backed TLS and networking APIs, PEM decoding, verification callbacks, and VERIFY_OPTIONAL.
Changes:
- Adds TLS configuration, connections, sessions, and certificate-verification handling.
- Integrates TLS sources, initialization, feature detection, and shared-library exports.
- Adds compatibility tests, sample-program interoperability checks, CI updates, and documentation.
| File | Description |
|---|---|
wolfpsa/mbedtls_compat/mbedtls/version.h |
Exposes existing version macros through a compatibility header. |
wolfpsa/mbedtls_compat/mbedtls/timing.h |
Adds a placeholder header for unsupported timing APIs. |
wolfpsa/mbedtls_compat/mbedtls/ssl.h |
Declares TLS types, constants, and APIs. |
wolfpsa/mbedtls_compat/mbedtls/ssl_ciphersuites.h |
Defines cipher-suite identifiers. |
wolfpsa/mbedtls_compat/mbedtls/psa_util.h |
Adds a PSA utility compatibility header. |
wolfpsa/mbedtls_compat/mbedtls/pem.h |
Declares PEM decoding APIs. |
wolfpsa/mbedtls_compat/mbedtls/net_sockets.h |
Declares socket APIs and error codes. |
wolfpsa/mbedtls_compat/mbedtls/error.h |
Adds a placeholder error header. |
wolfpsa/mbedtls_compat/mbedtls/debug.h |
Exposes the TLS debug configuration declaration. |
wolfpsa.map |
Exports TLS, networking, and PEM symbols. |
user_settings.h |
Enables wolfSSL TLS and verification callback settings. |
tools/psa_want_probe.c |
Detects available compatibility features and TLS versions. |
test/psa_server/psa_track_memory_test.c |
Tests PEM/TLS allocation and initialization cleanup. |
test/mbedtls_compat/ssl_test.c |
Tests TLS behavior, verification callbacks, and sessions. |
test/mbedtls_compat/programs.sh |
Runs sample-program interoperability checks. |
test/mbedtls_compat/pem_test.c |
Tests PEM decoding and error handling. |
test/mbedtls_compat/Makefile |
Builds compatibility tests and interoperability peers. |
test/mbedtls_compat/client-tls-mbedtls.c |
Adds a migration-guide client with nonblocking retries. |
test/Makefile |
Makes tracker-build compatibility support configurable. |
src/psa_crypto.c |
Shares PSA initialization and cleanup with wolfSSL TLS. |
src/mbedtls/x509.c |
Makes certificate decoding available internally to TLS. |
src/mbedtls/ssl.c |
Implements TLS APIs and verification callback handling. |
src/mbedtls/pem.c |
Implements unencrypted PEM decoding. |
src/mbedtls/net.c |
Implements socket operations and error translation. |
src/mbedtls/mbedtls_compat_internal.h |
Declares shared certificate and I/O helpers. |
README.md |
Documents supported APIs, limitations, and tests. |
Makefile |
Builds bundled TLS sources and adds test targets. |
.github/workflows/test-psa-api.yml |
Disables compatibility in the stable wolfSSL test variant. |
.github/workflows/mbedtls-compat.yml |
Updates dependencies, upstream reference, and build coverage. |
Review effort: Balanced
Frauschi
reviewed
Nov 16, 2026
padelsbach
force-pushed
the
mbedtls-verify
branch
from
November 16, 2026 23:53
93b801a to
a38febd
Compare
Frauschi
approved these changes
Nov 17, 2026
Frauschi
left a comment
Member
There was a problem hiding this comment.
LGTM, I would wait with merging until wolfSSL/wolfssl#11110 has been merged.
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.

Follow up to #54 and should be merged after it. Also requires wolfSSL/wolfssl#11110.
Adds
mbedtls_ssl_conf_verifyandmbedtls_ssl_set_verify. The verify callback is called for each cert in the chain, top down (CA to leaf), with the flags of every failed check, before the handshake's result is decided.CI points to PR 11110 until it merges.