Skip to content

Commit a17f68f

Browse files
authored
Merge pull request #9587 from kareem-wolfssl/zd20850
Add duplicate entry error to distinguish cases where a duplicate CRL is rejected.
2 parents 62ca344 + 832bcd7 commit a17f68f

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

src/crl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ static int AddCRL(WOLFSSL_CRL* crl, DecodedCRL* dcrl, CRL_Entry* crle,
694694
if (ret == MP_LT || ret == MP_EQ) {
695695
WOLFSSL_MSG("Same or newer CRL entry already exists");
696696
wc_UnLockRwLock(&crl->crlLock);
697-
return BAD_FUNC_ARG;
697+
return DUPE_ENTRY_E;
698698
}
699699
else if (ret < 0) {
700700
WOLFSSL_MSG("Error comparing CRL Numbers");

src/internal.c

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

26856+
case DUPE_ENTRY_E:
26857+
return "duplicate entry error";
26858+
2685626859
case GETTIME_ERROR:
2685726860
return "gettimeofday() error";
2685826861

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
@@ -24621,7 +24621,7 @@ static int error_test(void)
2462124621
{ -124, -124 },
2462224622
{ -167, -169 },
2462324623
{ -300, -300 },
24624-
{ -334, -336 },
24624+
{ -335, -336 },
2462524625
{ -346, -349 },
2462624626
{ -356, -356 },
2462724627
{ -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)