From 8013f44e1af353f90cfb18a177e6cc711a8132ce Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Fri, 16 Aug 2019 16:13:51 +0100 Subject: [PATCH] Make crypto_struct C++ compatible Avoid an error with differing linkages being expressed for psa_set_key_domain_parameters() between crypto_extra.h and crypto_struct.h in C++ builds. [Error] crypto_extra.h@456,14: conflicting declaration of 'psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t*, psa_key_type_t, const uint8_t *, size_t)' with 'C' linkage --- include/psa/crypto_struct.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 28bbc6ac8..e28b6daa5 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -55,6 +55,10 @@ #ifndef PSA_CRYPTO_STRUCT_H #define PSA_CRYPTO_STRUCT_H +#ifdef __cplusplus +extern "C" { +#endif + /* Include the Mbed TLS configuration file, the way Mbed TLS does it * in each of its header files. */ #if !defined(MBEDTLS_CONFIG_FILE) @@ -497,4 +501,8 @@ static inline size_t psa_get_key_bits( return( attributes->core.bits ); } +#ifdef __cplusplus +} +#endif + #endif /* PSA_CRYPTO_STRUCT_H */