check_config: request at least 1 builtin EC alg if there is at least 1 builtin curve

This slightly changes the previous requirement. Instead of enabling
ALL builtin EC algs when there is at least 1 built in curve, we ask
for at least one built alg if there is at least one builtin curve.

This relaxes the previous check while still keeping the base idea:
there must be a reason for which builtin curves are included into
the build.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2023-08-15 17:05:22 +02:00 committed by Manuel Pégourié-Gonnard
parent 29837c7301
commit dca8492043
2 changed files with 6 additions and 3 deletions

View File

@ -125,6 +125,12 @@
#endif /* MBEDTLS_PSA_CRYPTO_CONFIG || MBEDTLS_PSA_CRYPTO_C */
#if defined(MBEDTLS_SOME_BUILTIN_EC) && \
!(defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_ECDSA_DETERMINISTIC) || \
defined(MBEDTLS_ECDH_C))
#error "Some builtin curve is included, but there is no algorighm using it"
#endif
#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
#endif

View File

@ -744,7 +744,4 @@
#endif /* !MBEDTLS_PSA_ACCEL_ALG_CHACHA20_POLY1305 */
#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
/* Undefine internal helpers */
#undef MBEDTLS_SOME_BUILTIN_EC
#endif /* MBEDTLS_CONFIG_ADJUST_LEGACY_FROM_PSA_H */