-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSA Internal Functions being included even with MBEDTLS_PSA_CRYPTO_C undefined #4411
Comments
This is a bug in Mbed TLS. All the code in Our CI does not catch this kind of bugs because it mostly does static builds, and would only catch a link error if a function is used from a full program. If a function is accidentally compiled in a configuration where it shouldn't be, but isn't called in this configuration, we don't detect it. I wonder if we should switch to shared library builds for configuration testing? I'll make a patch for this specific issue, but I'm not sure how to do non-regression. |
Fix Mbed-TLS#4411. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Fix Mbed-TLS#4411. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
I made a patch for 2.27 and 3.0: #4412. The patch doesn't apply cleanly on 2.26 due to a cosmetic difference, you can use https://github.com/gilles-peskine-arm/mbedtls/tree/undefined-reference-2.26. Please note that my patch has not been reviewed yet, so try it out at your own risk. |
Very nice. |
Fix Mbed-TLS#4411. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Fix Mbed-TLS#4411. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
I'm trying to compile mbedTLS 2.26.0 for Windows using CMake, directly on Windows (build=host=Windows). GCC is version 10.3 and checked the option USE_SHARED_MBEDTLS_LIBRARY.
I get the following errors in the linking step:
My config file has the following:
In my IDE, I see psa_crypto.c properly greyed out, where the implementations of functions like psa_sign_hash_internal are. But in psa_crypto_driver_wrappers.c:112 the code returns psa_sign_hash_internal, causing the undefined reference since its implementation is not included in compilation. The same applies for the other functions in the error log.
I even added
Am I missing something?
The text was updated successfully, but these errors were encountered: