Skip to content

Commit b140f93

Browse files
refactor sigParams allocation and adjust test file name
1 parent 114d11a commit b140f93

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/crl.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -763,24 +763,23 @@ static CRL_Entry* DupCRL_Entry(const CRL_Entry* ent, void* heap)
763763
DYNAMIC_TYPE_CRL_ENTRY);
764764
dupl->signature = (byte*)XMALLOC(dupl->signatureSz, heap,
765765
DYNAMIC_TYPE_CRL_ENTRY);
766-
#ifdef WC_RSA_PSS
766+
#ifdef WC_RSA_PSS
767767
dupl->sigParams = (byte*)XMALLOC(dupl->sigParamsSz, heap,
768768
DYNAMIC_TYPE_CRL_ENTRY);
769-
#endif
770-
if (dupl->toBeSigned == NULL || dupl->signature == NULL) {
769+
#endif
770+
if (dupl->toBeSigned == NULL || dupl->signature == NULL
771+
#ifdef WC_RSA_PSS
772+
|| dupl->sigParams == NULL
773+
#endif
774+
) {
771775
CRL_Entry_free(dupl, heap);
772776
return NULL;
773777
}
774778
XMEMCPY(dupl->toBeSigned, ent->toBeSigned, dupl->tbsSz);
775779
XMEMCPY(dupl->signature, ent->signature, dupl->signatureSz);
776-
777-
#ifdef WC_RSA_PSS
778-
if (dupl->sigParams == NULL) {
779-
CRL_Entry_free(dupl, heap);
780-
return NULL;
781-
}
780+
#ifdef WC_RSA_PSS
782781
XMEMCPY(dupl->sigParams, ent->sigParams, dupl->sigParamsSz);
783-
#endif
782+
#endif
784783
}
785784
else {
786785
dupl->toBeSigned = NULL;

tests/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3046,7 +3046,7 @@ static int test_wolfSSL_CertManagerCRL(void)
30463046
const char* crl2 = "./certs/crl/crl2.pem";
30473047
#ifdef WC_RSA_PSS
30483048
const char* crl_rsapss = "./certs/crl/crl_rsapss.pem";
3049-
const char* ca_rsapss = "certs/rsapss/ca-rsapss.pem";
3049+
const char* ca_rsapss = "./certs/rsapss/ca-rsapss.pem";
30503050
#endif
30513051
const unsigned char crl_buff[] = {
30523052
0x30, 0x82, 0x02, 0x04, 0x30, 0x81, 0xed, 0x02,

0 commit comments

Comments
 (0)