Fix optionally safe hooks declarations
Signed-off-by: Janos Follath <janos.follath@arm.com>
diff --git a/tf-psa-crypto/drivers/builtin/src/bignum_core.c b/tf-psa-crypto/drivers/builtin/src/bignum_core.c
index 69707f8..3a24c85 100644
--- a/tf-psa-crypto/drivers/builtin/src/bignum_core.c
+++ b/tf-psa-crypto/drivers/builtin/src/bignum_core.c
@@ -747,6 +747,11 @@
}
}
+#if defined(MBEDTLS_TEST_HOOKS)
+// Set to a default that is neither MBEDTLS_MPI_IS_PUBLIC nor MBEDTLS_MPI_IS_SECRET
+int mbedtls_mpi_optionally_safe_codepath = MBEDTLS_MPI_IS_PUBLIC + MBEDTLS_MPI_IS_SECRET + 1;
+#endif
+
/*
* This function calculates the indices of the exponent where the exponentiation algorithm should
* start processing.
diff --git a/tf-psa-crypto/drivers/builtin/src/bignum_core.h b/tf-psa-crypto/drivers/builtin/src/bignum_core.h
index eb84161..90a2dee 100644
--- a/tf-psa-crypto/drivers/builtin/src/bignum_core.h
+++ b/tf-psa-crypto/drivers/builtin/src/bignum_core.h
@@ -831,9 +831,9 @@
mbedtls_mpi_uint *T);
#if defined(MBEDTLS_TEST_HOOKS)
-int mbedtls_mpi_optionally_safe_codepath;
+extern int mbedtls_mpi_optionally_safe_codepath;
-static inline void mbedtls_mpi_optionally_safe_codepath_reset()
+static inline void mbedtls_mpi_optionally_safe_codepath_reset(void)
{
// Set to a default that is neither MBEDTLS_MPI_IS_PUBLIC nor MBEDTLS_MPI_IS_SECRET
mbedtls_mpi_optionally_safe_codepath = MBEDTLS_MPI_IS_PUBLIC + MBEDTLS_MPI_IS_SECRET + 1;