-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20240814-debug-trace-errcodes-MP #7875
20240814-debug-trace-errcodes-MP #7875
Conversation
6ca1981
to
558d3c1
Compare
…wolfcrypt/tfm.h, and wolfssl/wolfcrypt/integer.h, to wolfssl/wolfcrypt/error-crypt.h, harmonizing their names and numbers. wolfssl/wolfcrypt/error-crypt.h: add WC_FIRST_E. wolfcrypt/src/error.c: add MP error code strings. wolfssl/error-ssl.h: add WOLFSSL_FIRST_E and WOLFSSL_LAST_E. wolfcrypt/test/test.c: update error_test() for new error code layout, refactoring the "missing" check. src/internal.c: use WC_FIRST_E and WC_LAST_E in wolfSSL_ERR_reason_error_string(). src/ssl.c: fix wolfSSL_ERR_GET_REASON() to identify in-range error codes using WC_FIRST_E, WC_LAST_E, WOLFSSL_FIRST_E, and WOLFSSL_LAST_E. sp_int.h: provide for WOLFSSL_DEBUG_TRACE_ERROR_CODES, and refactor MP error codes as enums, for consistency with other error codes. wolfcrypt/src/ecc.c: fix 2 identicalInnerCondition's.
77c5aab
to
6a227c8
Compare
…-100} to avoid collisions.
6a227c8
to
2448d48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call on moving the error codes to 'error-crypt.h'. I still think since we are changing the values of MP constants we should collapse MP_MEM
to MEMORY_E
and MP_VAL
to BAD_FUNC_ARG
. I do understand the concern of collapsing error codes causing potential problems.
MP_VAL at least gives us the information that the error was in the maths. |
move several MP error codes from
wolfssl/wolfcrypt/sp_int.h
,wolfssl/wolfcrypt/tfm.h
, andwolfssl/wolfcrypt/integer.h
, towolfssl/wolfcrypt/error-crypt.h
, harmonizing their names and numbers.wolfssl/wolfcrypt/error-crypt.h
: addWC_FIRST_E
.wolfcrypt/src/error.c
: add MP error code strings.wolfssl/error-ssl.h
: addWOLFSSL_FIRST_E
andWOLFSSL_LAST_E
.wolfcrypt/test/test.c
: updateerror_test()
for new error code layout, refactoring the "missing" check.src/internal.c
: useWC_FIRST_E
andWC_LAST_E
inwolfSSL_ERR_reason_error_string()
.src/ssl.c
: fixwolfSSL_ERR_GET_REASON()
to identify in-range error codes usingWC_FIRST_E
,WC_LAST_E
,WOLFSSL_FIRST_E
, andWOLFSSL_LAST_E
.wolfcrypt/src/ecc.c
: fix 2identicalInnerCondition
's.note, refactoring the sp error codes as enums adds helpful additional error checking by the compiler, and also helped
cppcheck
uncover the benign-but-trueidenticalInnerCondition
s.tested with
wolfssl-multi-test.sh ... super-quick-check int-math all-enable-fastmath
with the latter 2 tweaked to add--enable-debug-trace-errcodes
.