mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-27 06:32:20 +01:00
add second wolfCrypt error code span, and add DEADLOCK_AVERTED_E.
This commit is contained in:
@@ -642,11 +642,14 @@ const char* wc_GetErrorString(int error)
|
||||
case PBKDF2_KAT_FIPS_E:
|
||||
return "wolfCrypt FIPS PBKDF2 Known Answer Test Failure";
|
||||
|
||||
case DEADLOCK_AVERTED_E:
|
||||
return "Deadlock averted -- retry the call";
|
||||
|
||||
case MAX_CODE_E:
|
||||
case WC_SPAN1_MIN_CODE_E:
|
||||
case MIN_CODE_E:
|
||||
default:
|
||||
return "unknown error number";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,4 +663,3 @@ void wc_ErrorString(int error, char* buffer)
|
||||
buffer[WOLFSSL_MAX_ERROR_SZ-1] = 0;
|
||||
}
|
||||
#endif /* !NO_ERROR_STRINGS */
|
||||
|
||||
|
||||
@@ -2777,14 +2777,16 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t error_test(void)
|
||||
int last;
|
||||
} missing[] = {
|
||||
{ -124, -124 },
|
||||
{ -166, -169 }
|
||||
{ -166, -169 },
|
||||
{ WC_SPAN1_LAST_E - 1, WC_SPAN2_FIRST_E + 1 },
|
||||
{ WC_SPAN2_LAST_E - 1, WC_SPAN2_MIN_CODE_E }
|
||||
};
|
||||
|
||||
/* Check that all errors have a string and it's the same through the two
|
||||
* APIs. Check that the values that are not errors map to the unknown
|
||||
* string.
|
||||
*/
|
||||
for (i = WC_FIRST_E; i >= WC_LAST_E; i--) {
|
||||
for (i = WC_SPAN1_FIRST_E; i >= WC_SPAN2_MIN_CODE_E; i--) {
|
||||
int this_missing = 0;
|
||||
for (j = 0; j < (int)XELEM_CNT(missing); ++j) {
|
||||
if ((i <= missing[j].first) && (i >= missing[j].last)) {
|
||||
|
||||
Reference in New Issue
Block a user