Topic: Missing heap pointer in ECC crypto calls

See also my other question for more details about our application: … xmasm.html

We are using static memory and non-blocking ECC computation with wolfSSL/wolfCrypt. When initializing the "DecodedCert" instance using "InitDecodedCert" we provide a non-NULL "heap" pointer.

When calling "ParseCert" we eventually get the following call stack:
ParseCert ->
ParseCertRelative ->
ConfirmSignature ->
wc_ecc_verify_hash ->
wc_ecc_check_r_s_range ->

In the function "wc_ecc_curve_load" there is a call to the macro XMALLOC in which a NULL-pointer is passed for the "heap" parameter. This means we can not directly use the WolfSSL memory API functions provided when using the option USE_WOLFSSL_MEMORY.

This problem occurs with wolfSSL+wolfasynccrypt v5.6.6 and v5.7.0.

We currently work around this by using XMALLOC_OVERRIDE, and having our own malloc function which "fills in" the missing heap pointer before calling the wolfSSL_Malloc function.


Re: Missing heap pointer in ECC crypto calls

Hi Siewie,

You've found one of the functions that does not support static memory allocation. You are handling it correctly. Would you like me to create a feature request to add static memory support to the `wc_ecc_curve_load` function?

Please send an email to to begin that process.

Kind regards,
Eric - wolfSSL Support