Fix benchmark with small stack and WOLFSSL_RSA_VERIFY_ONLY.

This commit is contained in:
David Garske
2022-10-04 08:39:42 -07:00
parent 09f4a94b24
commit 0006d1f91c

View File

@ -5645,13 +5645,14 @@ static void bench_rsa_helper(int useDeviceID, RsaKey rsaKey[BENCH_MAX_PENDING],
ret = MEMORY_E; ret = MEMORY_E;
goto exit; goto exit;
} }
#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
#ifndef WOLFSSL_RSA_VERIFY_ONLY
#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
if (message == NULL) { if (message == NULL) {
ret = MEMORY_E; ret = MEMORY_E;
goto exit; goto exit;
} }
#endif #endif
#ifndef WOLFSSL_RSA_VERIFY_ONLY
XMEMCPY(message, messageStr, len); XMEMCPY(message, messageStr, len);
#endif #endif
@ -5807,7 +5808,9 @@ exit:
#if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY) #if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY)
WC_FREE_ARRAY_DYNAMIC(out, BENCH_MAX_PENDING, HEAP_HINT); WC_FREE_ARRAY_DYNAMIC(out, BENCH_MAX_PENDING, HEAP_HINT);
#endif #endif
#ifndef WOLFSSL_RSA_VERIFY_ONLY
WC_FREE_VAR(message, HEAP_HINT); WC_FREE_VAR(message, HEAP_HINT);
#endif
} }
void bench_rsa(int useDeviceID) void bench_rsa(int useDeviceID)