Skip to content

Add small Mbed TLS accessors and x509_crt_parse_der_nocopy - #76

Merged
Frauschi merged 3 commits into
wolfSSL:masterfrom
padelsbach:small-accessors
Nov 24, 2026
Merged

Frauschi merged 3 commits into
wolfSSL:masterfrom
padelsbach:small-accessors

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Adds the following misc small routines:

  • mbedtls_version_get_number, _get_string, _get_string_full
    (MBEDTLS_VERSION_C is now set in the generated config)
  • mbedtls_ssl_check_pending, mbedtls_ssl_get_record_expansion,
    mbedtls_ssl_send_alert_message, plus the MBEDTLS_SSL_ALERT_MSG_* values
  • mbedtls_ssl_ciphersuite_from_id, _from_string, _get_name, _get_id
  • mbedtls_oid_get_numeric_string, in a new mbedtls/oid.h
  • mbedtls_x509_crt_parse_der_nocopy

Copilot AI balanced review requested due to automatic review settings November 24, 2026 01:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Post-handshake TLS 1.2 and TLS 1.3 tests are missing for blocked and partially written encrypted alerts, leaving retry behavior and delivery of exactly one valid alert unverified.

1 open issue
What changed in this PR

Expands the Mbed TLS compatibility layer with version, TLS, cipher-suite, and OID accessors, plus certificate parsing without copying the DER buffer.

Changes:

  • Implements the new APIs and tracks certificate-buffer ownership.
  • Updates configuration, symbol exports, and compatibility documentation.
  • Adds tests for the new accessors, alert handling, and no-copy parsing.
File Description
wolfpsa/​mbedtls_compat/​mbedtls/​x509_crt.h Adds buffer ownership and no-copy parsing declarations.
wolfpsa/​mbedtls_compat/​mbedtls/​version.h Declares version accessors.
wolfpsa/​mbedtls_compat/​mbedtls/​ssl.h Adds TLS accessors and alert constants.
wolfpsa/​mbedtls_compat/​mbedtls/​ssl_ciphersuites.h Defines cipher-suite metadata and accessors.
wolfpsa/​mbedtls_compat/​mbedtls/​oid.h Declares numeric OID formatting.
wolfpsa.map Exports OID and version symbols.
tools/​psa_want_probe.c Enables version support in generated configuration.
test/​mbedtls_compat/​x509_crt_test.c Tests no-copy ownership and OID formatting.
test/​mbedtls_compat/​version_test.c Tests version macros and runtime accessors.
test/​mbedtls_compat/​ssl_test.c Tests pending data, alerts, record expansion, and cipher-suite metadata.
test/​mbedtls_compat/​Makefile Registers the version test.
src/​mbedtls/​x509.c Implements no-copy parsing and numeric OID formatting.
src/​mbedtls/​version.c Implements version accessors.
src/​mbedtls/​ssl.c Implements TLS and cipher-suite APIs.
docs/​mbedtls-compatibility.md Documents added support and behavioral differences.

Review effort: Balanced

Comment thread src/mbedtls/ssl.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Encrypted record sizing and alert retries rely on wolfSSL internal helpers unavailable for inspection, requiring validation against the supported wolfSSL master revision before approval.

1 open issue

Review effort: Balanced

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

6 comments inline, nothing blocking.

Comment thread test/mbedtls_compat/ssl_test.c Resolved
Comment thread src/mbedtls/ssl.c Resolved
Comment thread src/mbedtls/ssl.c Resolved
Comment thread src/mbedtls/ssl.c Resolved
Comment thread test/mbedtls_compat/ssl_test.c Resolved
Comment thread src/mbedtls/x509.c Resolved

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs a rebase onto master for the docs and test Makefile conflicts with #77.

@padelsbach
padelsbach requested a review from Frauschi November 24, 2026 19:41
@Frauschi
Frauschi merged commit e13a4b7 into wolfSSL:master Nov 24, 2026
109 checks passed
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.

4 participants