diff --git a/src/crl.c b/src/crl.c index 787901f66..20b2241ab 100644 --- a/src/crl.c +++ b/src/crl.c @@ -763,24 +763,23 @@ static CRL_Entry* DupCRL_Entry(const CRL_Entry* ent, void* heap) DYNAMIC_TYPE_CRL_ENTRY); dupl->signature = (byte*)XMALLOC(dupl->signatureSz, heap, DYNAMIC_TYPE_CRL_ENTRY); -#ifdef WC_RSA_PSS + #ifdef WC_RSA_PSS dupl->sigParams = (byte*)XMALLOC(dupl->sigParamsSz, heap, DYNAMIC_TYPE_CRL_ENTRY); -#endif - if (dupl->toBeSigned == NULL || dupl->signature == NULL) { + #endif + if (dupl->toBeSigned == NULL || dupl->signature == NULL + #ifdef WC_RSA_PSS + || dupl->sigParams == NULL + #endif + ) { CRL_Entry_free(dupl, heap); return NULL; } XMEMCPY(dupl->toBeSigned, ent->toBeSigned, dupl->tbsSz); XMEMCPY(dupl->signature, ent->signature, dupl->signatureSz); - -#ifdef WC_RSA_PSS - if (dupl->sigParams == NULL) { - CRL_Entry_free(dupl, heap); - return NULL; - } + #ifdef WC_RSA_PSS XMEMCPY(dupl->sigParams, ent->sigParams, dupl->sigParamsSz); -#endif + #endif } else { dupl->toBeSigned = NULL; diff --git a/tests/api.c b/tests/api.c index b878fcd14..71830ac69 100644 --- a/tests/api.c +++ b/tests/api.c @@ -3046,7 +3046,7 @@ static int test_wolfSSL_CertManagerCRL(void) const char* crl2 = "./certs/crl/crl2.pem"; #ifdef WC_RSA_PSS const char* crl_rsapss = "./certs/crl/crl_rsapss.pem"; - const char* ca_rsapss = "certs/rsapss/ca-rsapss.pem"; + const char* ca_rsapss = "./certs/rsapss/ca-rsapss.pem"; #endif const unsigned char crl_buff[] = { 0x30, 0x82, 0x02, 0x04, 0x30, 0x81, 0xed, 0x02,