Skip to content

Add remaining Mbed TLS SSL error codes and content lengths - #78

Merged
Frauschi merged 2 commits into
wolfSSL:masterfrom
padelsbach:constants
Nov 24, 2026
Merged

Frauschi merged 2 commits into
wolfSSL:masterfrom
padelsbach:constants

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Add 31 MBEDTOLS_ERR_SSL_* codes that were missing. wolfPSA now has all 50 codes from MBedTLS 4.3 with the same values as 3.6. Also add MBEDTLS_SSL_IN_CONTENT_LEN and MBEDTLS_SSL_OUT_CONTENT_LEN.

This change allows many clients to compile.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 02:17

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.

🟢 Approval recommended

No active review issues are reported for the Mbed TLS compatibility expansion.

No open issues 🎉

What changed in this PR

Expands wolfPSA’s Mbed TLS compatibility layer with missing SSL constants and error handling, helping more Mbed TLS clients compile.

Changes:

  • Adds 31 SSL error codes and input/output content-length macros.
  • Maps peer fatal alerts and adds error descriptions with Mbed TLS-compatible formatting.
  • Adds fatal-alert tests and documents compatibility limits.
File Description
wolfpsa/​mbedtls_compat/​mbedtls/​ssl.h Defines missing SSL error codes and content-length macros.
test/​mbedtls_compat/​ssl_test.c Tests TLS fatal alerts and uses the content-length macro.
test/​mbedtls_compat/​error_test.c Tests fatal-alert error-string formatting.
src/​mbedtls/​ssl.c Maps fatal alerts and enforces record-size compatibility.
src/​mbedtls/​error.c Adds error descriptions and suppresses low-level details for fatal alerts.
docs/​mbedtls-compatibility.md Documents added constants, fatal-alert behavior, and fixed record limits.

Review effort: Balanced

@padelsbach
padelsbach requested a review from Frauschi November 24, 2026 02:20

@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.

Codes and strings match Mbed TLS 4.x; two small nits.

Comment thread docs/mbedtls-compatibility.md Resolved
Comment thread wolfpsa/mbedtls_compat/mbedtls/ssl.h Resolved
@padelsbach
padelsbach requested a review from Frauschi November 24, 2026 19:38
@padelsbach padelsbach removed their assignment Nov 24, 2026

@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.

Both fixed, thanks.

@Frauschi
Frauschi merged commit 6ad63b0 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