WIP: mbedTLS 4 / PSA Crypto support on 2_x_dev#813
Draft
vikramdattu wants to merge 3 commits into
Draft
Conversation
Adds a parallel PSA Crypto code path for the mbedTLS backend, gated under `#if MBEDTLS_VERSION_MAJOR >= 4`. The legacy mbedTLS 3 path stays unchanged and remains the default. Covers crypto/cipher/aes_icm_mbedtls.c, aes_gcm_mbedtls.c, crypto/hash/hmac_mbedtls.c, the matching struct headers, plus cmake/FindMbedTLS.cmake (additionally finds libtfpsacrypto) and meson.build. CI matrix adds an mbedtls4 entry that builds mbedtls-4.0.0 from source on Ubuntu + macOS. Local: tested against system mbedTLS 3.6.4 (brew) and mbedTLS 4.0.0 (built from source), 10/10 ctest passing on both. For cisco#812.
…nter - GCM encrypt/decrypt now require exact dir match (catches crossed-ctx bugs PSA does not, since the key carries both ENCRYPT and DECRYPT usage flags) - GCM enc_fail returns cipher_fail (not bad_param) for genuine PSA crypto failures - AES-ICM: comment that PSA_ALG_CTR uses a full 128-bit counter, same as the legacy mbedtls_aes_crypt_ctr path; SRTP packet sizes (< 1 MiB) are unaffected
- mbedtls 2.x ships only mbedtls/version.h, not mbedtls/build_info.h; wrap the include with __has_include so the gate resolves on 2.x too - mbedtls4 install needs -DCMAKE_POSITION_INDEPENDENT_CODE=ON so static libtfpsacrypto can be linked into libsrtp2.so on Ubuntu - macOS mbedtls4 install path moved out of $GITHUB_WORKSPACE which the later actions/checkout@v2 step wipes; install to /tmp/ instead
acf4582 to
bd11b49
Compare
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.
WIP backport of mbedTLS 4 PSA Crypto. Gated under
#if MBEDTLS_VERSION_MAJOR >= 4; legacy mbedTLS 3 path unchanged.Local: both mbedTLS 3.6.4 and 4.0.0 → 10/10 ctest pass.
Closes #812. cc @pabuhler