From 36c1d20bb2fe48cac65edf4fa2d228069e189f84 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 11 Jul 2023 11:51:40 -0700 Subject: [PATCH] If malloc is disabled make sure it is also disabled in SP math --- wolfssl/wolfcrypt/settings.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 2412c0a52..46120511e 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -2871,6 +2871,12 @@ extern void uITRON4_free(void *p) ; #error Small stack cannot be used with no malloc (WOLFSSL_NO_MALLOC) #endif +/* If malloc is disabled make sure it is also disabled in SP math */ +#if defined(WOLFSSL_NO_MALLOC) && !defined(WOLFSSL_SP_NO_MALLOC) && \ + (defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL)) + #define WOLFSSL_SP_NO_MALLOC +#endif + /* Enable DH Extra for QT, openssl all, openssh and static ephemeral */ /* Allows export/import of DH key and params as DER */ #if !defined(NO_DH) && !defined(WOLFSSL_DH_EXTRA) && \