From 93d40beb1766b73e39fec8ec6a36db1a2ce94ebc Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sat, 3 Sep 2022 15:46:40 +0200 Subject: [PATCH] Status Code: Add specific return code for self-test fail (-11) Fixes https://github.com/hashcat/hashcat/issues/3437 --- docs/changes.txt | 6 ++++++ docs/status_codes.txt | 1 + include/types.h | 1 + src/hashcat.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index f2386f9b6..b2e4c721d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,5 +1,11 @@ * changes v6.2.6 -> v6.2.x +## +## Technical +## + +- Status Code: Add specific return code for self-test fail (-11) + * changes v6.2.5 -> v6.2.6 ## diff --git a/docs/status_codes.txt b/docs/status_codes.txt index 4b9daaf4e..b40ac93d0 100644 --- a/docs/status_codes.txt +++ b/docs/status_codes.txt @@ -1,6 +1,7 @@ status codes on exit: ===================== +-11 = self-test failed -10 = autotune failure -9 = mixed backend errors (combo of -3, -4, -5, -6, -7 errors type) -8 = backend error: Invalid module_extra_buffer_size diff --git a/include/types.h b/include/types.h index 8f390be90..f0beeabbb 100644 --- a/include/types.h +++ b/include/types.h @@ -1842,6 +1842,7 @@ typedef struct backend_ctx bool kernel_accel_warnings; bool extra_size_warning; bool mixed_warnings; + bool self_test_warnings; // generic diff --git a/src/hashcat.c b/src/hashcat.c index 9aed03dbe..53619dca6 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -913,6 +913,8 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx) event_log_warning (hashcat_ctx, "You can use --self-test-disable to override, but do not report related errors."); event_log_warning (hashcat_ctx, NULL); + backend_ctx->self_test_warnings = true; + return -1; } } @@ -1825,6 +1827,7 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) if (backend_ctx->kernel_accel_warnings == true) rc_final = -7; if (backend_ctx->extra_size_warning == true) rc_final = -8; if (backend_ctx->mixed_warnings == true) rc_final = -9; + if (backend_ctx->self_test_warnings == true) rc_final = -11; } // special case for --stdout