From ff94f4c9d0421fa807a9670aeb5c272094ee6cd6 Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 19 Oct 2023 06:08:24 +0000 Subject: [PATCH] Refactor self_test_disable variable to just self_test, same idea as outfile_autohex variable --- include/types.h | 4 ++-- src/interface.c | 2 +- src/selftest.c | 2 +- src/user_options.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/types.h b/include/types.h index ef1573ccd..6f4150d16 100644 --- a/include/types.h +++ b/include/types.h @@ -701,7 +701,7 @@ typedef enum user_options_defaults RUNTIME = 0, SCRYPT_TMTO = 0, SEGMENT_SIZE = 33554432, - SELF_TEST_DISABLE = false, + SELF_TEST = true, SHOW = false, SKIP = 0, SLOW_CANDIDATES = false, @@ -2361,7 +2361,7 @@ typedef struct user_options bool remove; bool restore; bool restore_disable; - bool self_test_disable; + bool self_test; bool show; bool slow_candidates; bool speed_only; diff --git a/src/interface.c b/src/interface.c index 56d003137..a31cd4d94 100644 --- a/src/interface.c +++ b/src/interface.c @@ -287,7 +287,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->opts_type |= OPTS_TYPE_MP_MULTI_DISABLE; } - if (user_options->self_test_disable == true) + if (user_options->self_test == false) { hashconfig->opts_type |= OPTS_TYPE_SELF_TEST_DISABLE; } diff --git a/src/selftest.c b/src/selftest.c index 9c80374af..313725e55 100644 --- a/src/selftest.c +++ b/src/selftest.c @@ -1048,7 +1048,7 @@ HC_API_CALL void *thread_selftest (void *p) user_options_t *user_options = hashcat_ctx->user_options; - if (user_options->self_test_disable == true) return NULL; + if (user_options->self_test == false) return NULL; hc_device_param_t *device_param = backend_ctx->devices_param + thread_param->tid; diff --git a/src/user_options.c b/src/user_options.c index 20104fa05..598e64261 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -269,7 +269,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->runtime = RUNTIME; user_options->scrypt_tmto = SCRYPT_TMTO; user_options->segment_size = SEGMENT_SIZE; - user_options->self_test_disable = SELF_TEST_DISABLE; + user_options->self_test = SELF_TEST; user_options->separator = SEPARATOR; user_options->session = PROGNAME; user_options->show = SHOW; @@ -414,7 +414,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break; case IDX_HASH_INFO: user_options->hash_info = true; break; case IDX_FORCE: user_options->force = true; break; - case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break; + case IDX_SELF_TEST_DISABLE: user_options->self_test = false; break; case IDX_SKIP: user_options->skip = hc_strtoull (optarg, NULL, 10); user_options->skip_chgd = true; break; case IDX_LIMIT: user_options->limit = hc_strtoull (optarg, NULL, 10); @@ -3280,7 +3280,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->runtime); logfile_top_uint (user_options->scrypt_tmto); logfile_top_uint (user_options->segment_size); - logfile_top_uint (user_options->self_test_disable); + logfile_top_uint (user_options->self_test); logfile_top_uint (user_options->slow_candidates); logfile_top_uint (user_options->show); logfile_top_uint (user_options->speed_only);