Skip to content

Commit

Permalink
Move the implication of MBEDTLS_PSA_CRYPTO_CLIENT where it belongs
Browse files Browse the repository at this point in the history
If MBEDTLS_PSA_CRYPTO_C is enabled, we always enable
MBEDTLS_PSA_CRYPTO_CLIENT, since the client-side functions are part of the
full PSA crypto feature set. Historically, we didn't have a good place for
configuration modification, so we did this early in the crypto.h include
tree. Since Mbed TLS 3.0, we have mbedtls/build_info.h for that.

Addresses Mbed-TLS/mbedtls#7144 .

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
(cherry picked from commit 95c9152)
Signed-off-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@linaro.org>
  • Loading branch information
gilles-peskine-arm authored and d3zd3z committed May 26, 2023
1 parent 52daf84 commit 6e7841e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 7 additions & 0 deletions include/mbedtls/build_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@
#include MBEDTLS_USER_CONFIG_FILE
#endif

/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
* is defined as well to include all PSA code.
*/
#if defined(MBEDTLS_PSA_CRYPTO_C)
#define MBEDTLS_PSA_CRYPTO_CLIENT
#endif /* MBEDTLS_PSA_CRYPTO_C */

/* The PK wrappers need pk_write functions to format RSA key objects
* when they are dispatching to the PSA API. This happens under USE_PSA_CRYPTO,
* and also even without USE_PSA_CRYPTO for mbedtls_pk_sign_ext().
Expand Down
7 changes: 0 additions & 7 deletions include/psa/crypto_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@
#include "crypto_platform.h"
#endif

/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
* is defined as well to include all PSA code.
*/
#if defined(MBEDTLS_PSA_CRYPTO_C)
#define MBEDTLS_PSA_CRYPTO_CLIENT
#endif /* MBEDTLS_PSA_CRYPTO_C */

#include <stdint.h>

/** \defgroup error Error codes
Expand Down

0 comments on commit 6e7841e

Please sign in to comment.