Repository navigation
Add Mbed TLS 3.6 ctr_drbg, entropy and ssl_conf_rng - #80
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The entropy capability guard can enable MBEDTLS_ENTROPY_C without the required hash wrapper or SHA-256/SHA-512 accumulator, causing compilation failures or every entropy request to fail.
1 open issue
What changed in this PR
Adds Mbed TLS 3.6 entropy and DRBG compatibility APIs backed by wolfCrypt, plus an SSL RNG configuration compatibility entry point.
Changes:
- Adds entropy-source management, DRBG seeding, reseeding, and random generation.
- Exports the new APIs and adjusts feature detection.
- Adds compatibility tests and documents differences from Mbed TLS behavior.
| File | Description |
|---|---|
wolfpsa/mbedtls_compat/mbedtls/ssl.h |
Declares mbedtls_ssl_conf_rng for Mbed TLS 3 compatibility. |
wolfpsa/mbedtls_compat/mbedtls/entropy.h |
Defines entropy contexts, constants, and APIs. |
wolfpsa/mbedtls_compat/mbedtls/ctr_drbg.h |
Defines DRBG contexts, constants, and APIs. |
wolfpsa.map |
Exports entropy and DRBG symbols. |
tools/psa_want_probe.c |
Separates entropy and DRBG feature detection. |
test/mbedtls_compat/mbedtls3_test.c |
Tests entropy sources, DRBG behavior, errors, and SSL setup. |
src/mbedtls/mbedtls3.c |
Implements wolfCrypt-backed entropy and DRBG APIs and the no-op SSL RNG setter. |
docs/mbedtls-compatibility.md |
Documents API support, configuration restrictions, and behavioral differences. |
Review effort: Balanced
Frauschi
reviewed
Nov 25, 2026
Frauschi
left a comment
Member
There was a problem hiding this comment.
7 comments inline, nothing blocking.
Frauschi
approved these changes
Nov 26, 2026
| - `mbedtls_ctr_drbg_*` use wolfCrypt's RNG, a hash DRBG, not an AES | ||
| CTR_DRBG. wolfCrypt seeds and reseeds it from its own seed source and | ||
| adds the entropy function's output and the custom or additional data, | ||
| without crediting them as entropy. So the same entropy, for example a |
Member
There was a problem hiding this comment.
On wolfSSL without WC_RNG_HAVE_RESEED_NOW (5.9.4, FIPS modules), reseed still goes through wc_RNG_DRBG_Reseed, which credits the input; note that here or scope "without crediting" to newer wolfSSL.
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.

Adds entropy source and drbg API on top of wolfCrypt