Skip to content

Commit e99f0c8

Browse files
joerchanmswarowsky
authored andcommittedJan 15, 2024
interface: Add workaround for mbedtls using PSA
Add workaround for mbedtls using PSA. The MbedTLS library is not compatible with the PSA headers provided by TF-M. Add prototype of the functions not supported by TF-M to prevent undefined reference warning. This will still fail at link-time if the application tries to use the functions. This commit is temporary until mbedtls and TF-M projects address this issue. Mbed-TLS/mbedtls#8602 Fix is in mbed TLS commit: 8f1c36df00f6cdca0ba0bb04a497057c37248017 Could not cherry-picked due to it beeing a merge commit Signed-off-by: Joakim Andersson <[email protected]> Signed-off-by: Markus Swarowsky <[email protected]> Change-Id: I66fcb9d971929f3c21e93c8c3f3c0c666c6563c7 Signed-off-by: Markus Swarowsky <[email protected]>
1 parent 52adfa1 commit e99f0c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎interface/include/psa/crypto_extra.h

+15
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ extern "C" {
112112
#define PSA_ALG_IS_VENDOR_HASH_AND_SIGN(alg) \
113113
PSA_ALG_IS_DSA(alg)
114114

115+
/* Workaround for build warnings when MBed TLS has enabled MBEDTLS_USE_PSA_CRYPTO
116+
*
117+
* Mbed TLS is not compatible with TF-Ms PSA API headers.
118+
*
119+
* In order to prevent build warnings for the follow functions we add the
120+
* prototypes for them here.
121+
* If the application tries to link with these functions it will get a link-time
122+
* error. This use-case is not supported by TF-M.
123+
*/
124+
void psa_set_key_enrollment_algorithm(
125+
psa_key_attributes_t *attributes,
126+
psa_algorithm_t alg2);
127+
psa_algorithm_t psa_get_key_enrollment_algorithm(
128+
const psa_key_attributes_t *attributes);
129+
115130
/**@}*/
116131

117132
#ifdef __cplusplus

0 commit comments

Comments
 (0)