From 3f8d23eaefc811ca5428766dcc60cf5a187dffe7 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 7 Apr 2023 11:48:02 +0200 Subject: [PATCH] pk_wrap: fix guards in eckey_check_pair to only include 1 option at build time Signed-off-by: Valerio Setti --- library/pk_wrap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index ed4e752be..57bfdcaa2 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -1175,12 +1175,13 @@ static int eckey_check_pair(const void *pub, const void *prv, (void) f_rng; (void) p_rng; return eckey_check_pair_psa(pub, prv); -#else /* MBEDTLS_USE_PSA_CRYPTO */ +#elif defined(MBEDTLS_ECP_C) return mbedtls_ecp_check_pub_priv((const mbedtls_ecp_keypair *) pub, (const mbedtls_ecp_keypair *) prv, f_rng, p_rng); -#endif /* MBEDTLS_ECP_C */ +#else return MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE; +#endif } static void *eckey_alloc_wrap(void)