During the parsing of the certificate, the public key is not being stored:
#if (!defined(WOLFSSL_NO_MALLOC) && !defined(NO_WOLFSSL_CM_VERIFY)) || \
defined(WOLFSSL_DYN_CERT)
/* cert->publicKey not stored as copy if WOLFSSL_NO_MALLOC defined */
if ((cert->keyOID == RSAk
#ifdef WC_RSA_PSS
|| cert->keyOID == RSAPSSk
#endif
) && cert->publicKey != NULL && cert->pubKeySize > 0) {
ptr = (char*)XMALLOC(cert->pubKeySize, cert->heap,
DYNAMIC_TYPE_PUBLIC_KEY);
if (ptr == NULL)
return MEMORY_E;
XMEMCPY(ptr, cert->publicKey, cert->pubKeySize);
cert->publicKey = (byte *)ptr;
cert->pubKeyStored = 1;
}
#endif
So
cert->pubKeyStored
is not getting set to 1. I was able to get past this by adding
-DWOLFSSL_DYN_CERT
to
CFLAGS
. That said, I later got an out of memory error:
wolfSSL Entering SendCertificateVerify
sent: certificate verify
connect state: FIRST_REPLY_THIRD
growing output buffer
wolfSSL Entering DtlsMsgPoolSave
wolfSSL Entering DtlsMsgNew
wolfSSL Leaving DtlsMsgPoolSave(), return 0
ERROR ran out of static memory
wolfSSL error occurred, error = -125
wolfSSL Entering wolfSSL_get_error
wolfSSL Leaving wolfSSL_get_error, return -125
err = -125, out of memory error
I'll need to ask my colleagues how to increase the memory pool size.
Please stay tuned.
Warm regards, Anthony