Skip to content

Commit

Permalink
wolfcrypt/src/error.c: don't render error messages for MPI error code…
Browse files Browse the repository at this point in the history
…s unless defined(WOLFSSL_DEBUG_TRACE_ERROR_CODES), for backward compatibility.
  • Loading branch information
douzzer committed Aug 21, 2024
1 parent a7998a2 commit 6a227c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wolfcrypt/src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const char* wc_GetErrorString(int error)
{
switch (error) {

#ifdef WOLFSSL_DEBUG_TRACE_ERROR_CODES
case MP_MEM :
return "MP integer dynamic memory allocation failed";

Expand All @@ -55,6 +56,7 @@ const char* wc_GetErrorString(int error)

case MP_NOT_INF:
return "MP point not at infinity";
#endif /* WOLFSSL_DEBUG_TRACE_ERROR_CODES */

case OPEN_RAN_E :
return "opening random device error";
Expand Down
4 changes: 4 additions & 0 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,11 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t error_test(void)
int first;
int last;
} missing[] = {
#ifdef WOLFSSL_DEBUG_TRACE_ERROR_CODES
{ -6, -100 },
#else
{ -2, -100 },
#endif
{ -124, -124 },
{ -166, -169 }
};
Expand Down

0 comments on commit 6a227c8

Please sign in to comment.