Skip to content

Commit d09b5ee

Browse files
Add duplicate entry error to distinguish cases where a duplicate CRL is rejected.
1 parent e70e7cb commit d09b5ee

5 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/crl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static int AddCRL(WOLFSSL_CRL* crl, DecodedCRL* dcrl, const byte* buff,
707707
WOLFSSL_MSG("Same or newer CRL entry already exists");
708708
CRL_Entry_free(crle, crl->heap);
709709
wc_UnLockRwLock(&crl->crlLock);
710-
return BAD_FUNC_ARG;
710+
return DUPE_ENTRY_E;
711711
}
712712
else if (ret < 0) {
713713
WOLFSSL_MSG("Error comparing CRL Numbers");

src/internal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26748,6 +26748,9 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
2674826748
case PSK_KEY_ERROR:
2674926749
return "psk key callback error";
2675026750

26751+
case DUPE_ENTRY_E:
26752+
return "duplicate entry error";
26753+
2675126754
case GETTIME_ERROR:
2675226755
return "gettimeofday() error";
2675326756

src/ssl_certman.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,7 @@ int wolfSSL_CertManagerDisableCRL(WOLFSSL_CERT_MANAGER* cm)
17951795
* WOLFSSL_FILETYPE_ASN1, WOLFSSL_FILETYPE_PEM.
17961796
* @return WOLFSSL_SUCCESS on success.
17971797
* @return BAD_FUNC_ARG when cm or buff is NULL or sz is negative or zero.
1798+
* @return DUPE_ENTRY_E if the same or a newer CRL already exists in the cm.
17981799
* @return WOLFSSL_FATAL_ERROR when creating CRL object fails.
17991800
*/
18001801
int wolfSSL_CertManagerLoadCRLBuffer(WOLFSSL_CERT_MANAGER* cm,

tests/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34759,7 +34759,7 @@ static int error_test(void)
3475934759
{ -124, -124 },
3476034760
{ -167, -169 },
3476134761
{ -300, -300 },
34762-
{ -334, -336 },
34762+
{ -335, -336 },
3476334763
{ -346, -349 },
3476434764
{ -356, -356 },
3476534765
{ -358, -358 },

wolfssl/error-ssl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ enum wolfSSL_ErrorCodes {
8282
CLIENT_ID_ERROR = -331, /* psk client identity error */
8383
SERVER_HINT_ERROR = -332, /* psk server hint error */
8484
PSK_KEY_ERROR = -333, /* psk key error */
85+
DUPE_ENTRY_E = -334, /* duplicate entry error */
8586

8687
GETTIME_ERROR = -337, /* gettimeofday failed ??? */
8788
GETITIMER_ERROR = -338, /* getitimer failed ??? */

0 commit comments

Comments
 (0)