Skip to content

Commit

Permalink
src/ssl.c and wolfssl/wolfcrypt/error-crypt.h: revert change to wolfS…
Browse files Browse the repository at this point in the history
…SL_ERR_GET_REASON() and MAX_CODE_E.
  • Loading branch information
douzzer committed Aug 21, 2024
1 parent a7998a2 commit 48c1583
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -15361,9 +15361,7 @@ int wolfSSL_ERR_GET_REASON(unsigned long err)
ret = 0 - ret; /* setting as negative value */
/* wolfCrypt range is less than MAX (-100)
wolfSSL range is MIN (-300) and lower */
if ((ret <= WC_FIRST_E && ret >= WC_LAST_E) ||
(ret <= WOLFSSL_FIRST_E && ret >= WOLFSSL_LAST_E))
{
if (ret < MAX_CODE_E && ret > MIN_CODE_E) {
return ret;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/error-crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ the error status.

/* error codes, add string for new errors !!! */
enum {
MAX_CODE_E = -1, /* errors -2 - -299 */
WC_FIRST_E = -2, /* errors -2 - -299 */

MP_MEM = -2, /* MP dynamic memory allocation failed. */
Expand All @@ -52,6 +51,7 @@ enum {
* partial completion. */
MP_NOT_INF = -5, /* MP point not at infinity */

MAX_CODE_E = -100, /* errors -101 - -299 -- excludes MP codes */
OPEN_RAN_E = -101, /* opening random device error */
READ_RAN_E = -102, /* reading random device error */
WINCRYPT_E = -103, /* windows crypt init error */
Expand Down

0 comments on commit 48c1583

Please sign in to comment.