Topic: [SOLVED] RSA_FUNCTION MP_EXPTMOD_E: memory/config problem error

Hello:

I'm using wolfssl stack with Atmel ATECC508 crytochip.
I 'm getting this error when trying to verify vertificate signature;

About to verify certificate signature
[b]RSA_FUNCTION MP_EXPTMOD_E: memory/config problem[/b]
Rsa SSL verify error
Confirm signature failed
Failed to verify CA from chain
.......
About to verify certificate signature
No CA signer to verify with
Failed to verify Peer's cert
        No callback override available, fatal
wolfSSL Leaving DoHandShakeMsgType(), return -188
wolfSSL Leaving DoHandShakeMsg(), return -188
wolfSSL error occurred, error = -188
ERROR: aws_client_mqtt_connect L#244 Error(8) : Failed to TLS connect!

It's clear there is a memory problem, but I would like to know how much memory is required for this operation. I tried to add more memory to the heap (using FreeRTOS) but it didn't help.
Any other advice about how to solve this issue?

Thanks in advance
Gus

Share

Re: [SOLVED] RSA_FUNCTION MP_EXPTMOD_E: memory/config problem error

Hi gussabina,

This error typically stems from the FP_MAX_BITS not being set large enough. Since the fast math library uses STACK we hard code that value for a fixed length buffer. By default it is set to 4096 which will allow for up to a 2048-bit rsa key (RSA KEY SIZE * 2). My suspicion is that the endpoint you are connecting to is sending a larger RSA key, perhaps a 4096-bit RSA key. Could you try adding this to your settings:

#undef FP_MAX_BITS
#define FP_MAX_BITS 8192 /* Set to largest RSA key size times 2 IE 4096*2 = 8192 */

Does that resolve the issue?


Warmest Regards,

Kaleb

Re: [SOLVED] RSA_FUNCTION MP_EXPTMOD_E: memory/config problem error

Hi Kaleb J. Himes,

Thank you for the answer. It solved the problem.

Share