forked from wolfSSL/wolfssl
refactor sigParams allocation and adjust test file name
This commit is contained in:
19
src/crl.c
19
src/crl.c
@ -763,24 +763,23 @@ static CRL_Entry* DupCRL_Entry(const CRL_Entry* ent, void* heap)
|
|||||||
DYNAMIC_TYPE_CRL_ENTRY);
|
DYNAMIC_TYPE_CRL_ENTRY);
|
||||||
dupl->signature = (byte*)XMALLOC(dupl->signatureSz, heap,
|
dupl->signature = (byte*)XMALLOC(dupl->signatureSz, heap,
|
||||||
DYNAMIC_TYPE_CRL_ENTRY);
|
DYNAMIC_TYPE_CRL_ENTRY);
|
||||||
#ifdef WC_RSA_PSS
|
#ifdef WC_RSA_PSS
|
||||||
dupl->sigParams = (byte*)XMALLOC(dupl->sigParamsSz, heap,
|
dupl->sigParams = (byte*)XMALLOC(dupl->sigParamsSz, heap,
|
||||||
DYNAMIC_TYPE_CRL_ENTRY);
|
DYNAMIC_TYPE_CRL_ENTRY);
|
||||||
#endif
|
#endif
|
||||||
if (dupl->toBeSigned == NULL || dupl->signature == NULL) {
|
if (dupl->toBeSigned == NULL || dupl->signature == NULL
|
||||||
|
#ifdef WC_RSA_PSS
|
||||||
|
|| dupl->sigParams == NULL
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
CRL_Entry_free(dupl, heap);
|
CRL_Entry_free(dupl, heap);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
XMEMCPY(dupl->toBeSigned, ent->toBeSigned, dupl->tbsSz);
|
XMEMCPY(dupl->toBeSigned, ent->toBeSigned, dupl->tbsSz);
|
||||||
XMEMCPY(dupl->signature, ent->signature, dupl->signatureSz);
|
XMEMCPY(dupl->signature, ent->signature, dupl->signatureSz);
|
||||||
|
#ifdef WC_RSA_PSS
|
||||||
#ifdef WC_RSA_PSS
|
|
||||||
if (dupl->sigParams == NULL) {
|
|
||||||
CRL_Entry_free(dupl, heap);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
XMEMCPY(dupl->sigParams, ent->sigParams, dupl->sigParamsSz);
|
XMEMCPY(dupl->sigParams, ent->sigParams, dupl->sigParamsSz);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dupl->toBeSigned = NULL;
|
dupl->toBeSigned = NULL;
|
||||||
|
@ -3046,7 +3046,7 @@ static int test_wolfSSL_CertManagerCRL(void)
|
|||||||
const char* crl2 = "./certs/crl/crl2.pem";
|
const char* crl2 = "./certs/crl/crl2.pem";
|
||||||
#ifdef WC_RSA_PSS
|
#ifdef WC_RSA_PSS
|
||||||
const char* crl_rsapss = "./certs/crl/crl_rsapss.pem";
|
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
|
#endif
|
||||||
const unsigned char crl_buff[] = {
|
const unsigned char crl_buff[] = {
|
||||||
0x30, 0x82, 0x02, 0x04, 0x30, 0x81, 0xed, 0x02,
|
0x30, 0x82, 0x02, 0x04, 0x30, 0x81, 0xed, 0x02,
|
||||||
|
Reference in New Issue
Block a user