From ea2eef72f24d13b18b1c6a4a549294521c6102ea Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 30 Sep 2016 11:59:24 +0200 Subject: [PATCH] Make induction support modular --- src/induct.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/induct.c b/src/induct.c index 14bad34e5..5b8ba635b 100644 --- a/src/induct.c +++ b/src/induct.c @@ -25,11 +25,18 @@ int induct_ctx_init (induct_ctx_t *induct_ctx, const user_options_t *user_option { induct_ctx->enabled = false; - if (user_options->attack_mode == ATTACK_MODE_BF) return 0; - - if (user_options->keyspace == true) return 0; if (user_options->benchmark == true) return 0; - if (user_options->opencl_info == true) return 0; + if (user_options->keyspace == true) return 0; + if (user_options->left == true) return 0; + if (user_options->show == true) return 0; + if (user_options->stdout_flag == true) return 0; + if (user_options->usage == true) return 0; + if (user_options->version == true) return 0; + + if (user_options->attack_mode == ATTACK_MODE_BF) return 0; + if (user_options->attack_mode == ATTACK_MODE_COMBI) return 0; + + induct_ctx->enabled = true; if (user_options->induction_dir == NULL) { @@ -78,8 +85,6 @@ int induct_ctx_init (induct_ctx_t *induct_ctx, const user_options_t *user_option induct_ctx->root_directory = mystrdup (user_options->induction_dir); } - induct_ctx->enabled = true; - return 0; } @@ -111,12 +116,7 @@ void induct_ctx_cleanup (induct_ctx_t *induct_ctx) void induct_ctx_destroy (induct_ctx_t *induct_ctx) { - if (induct_ctx->enabled == false) - { - myfree (induct_ctx); - - return; - } + if (induct_ctx->enabled == false) return; if (rmdir (induct_ctx->root_directory) == -1) {