Add initial mbedTLS v4 support#3532
Add initial mbedTLS v4 support#3532Easton97-Jens wants to merge 13 commits intoowasp-modsecurity:v3/masterfrom
Conversation
…-mbed-tls-4.x Migrate embedded Mbed TLS integration to TF-PSA-Crypto (Mbed TLS 4.x) paths
There was a problem hiding this comment.
Pull request overview
Adds initial build/runtime compatibility with Mbed TLS 4.x’s TF-PSA-Crypto layout by updating bundled Mbed TLS paths/sources and migrating MD5/SHA1 hashing to the generic mbedtls_md API.
Changes:
- Switch MD5/SHA1 helpers from deprecated per-hash headers/functions to
mbedtls_md(mbedtls/md.h+mbedtls_md()). - Update autotools build files to include TF-PSA-Crypto include paths and compile the new TF-PSA-Crypto source locations.
- Update Win32 CMake build to compile the TF-PSA-Crypto source set and adjust include directories accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/sha1.h | Migrates digest implementation to generic mbedtls_md API. |
| src/utils/md5.h | Updates MD5 wrapper to use the updated DigestImpl template. |
| src/Makefile.am | Adds TF-PSA-Crypto include paths for libmodsecurity compilation. |
| others/Makefile.am | Repoints bundled Mbed TLS subset headers/sources to TF-PSA-Crypto layout. |
| Makefile.am | Extends cppcheck include paths for TF-PSA-Crypto headers. |
| configure.ac | Updates configure-time check to detect TF-PSA-Crypto base64 source path. |
| build/win32/CMakeLists.txt | Rebuilds bundled crypto subset from TF-PSA-Crypto sources and updates include dirs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n-in-sha1.h Handle mbedtls errors and use unsigned buffer for digest in SHA1 utils
…arcloud-findings Use std::string_view and std::array in DigestImpl::digestHelper
|
Hi @Easton97-Jens, there are two SonarCloud reports in |
…s-in-sha1.h Remove reinterpret_casts in src/utils/sha1.h; use safer static_cast via void*
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added error handling for mbedtls_md_info_from_type and mbedtls_md calls in digestHelper.
|



what
md5.h,sha1.h) with genericmbedtls_mdAPIconfigure.acto work with Mbed TLS 4.x layoutwhy
library/base64.cwhich no longer exist in 4.x./configureand compilationreferences
library/base64.cwhen using Mbed TLS 4.x — Is support planned? #3450