1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-08-02 11:58:26 +00:00

Fix selftest in case OPTS_TYPE_DEEP_COMP_KERNEL is active

This commit is contained in:
Jens Steube 2019-12-24 17:24:27 +01:00
parent 6ed3003a30
commit 4d286d5dc7

View File

@ -542,41 +542,30 @@ static int selftest (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
device_param->kernel_params_buf32[28] = 0; device_param->kernel_params_buf32[28] = 0;
device_param->kernel_params_buf32[29] = 1; device_param->kernel_params_buf32[29] = 1;
bool test_ok = false;
if (hashconfig->opts_type & OPTS_TYPE_AUX1) if (hashconfig->opts_type & OPTS_TYPE_AUX1)
{ {
if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX1, 1, false, 0) == 0) test_ok = true; if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX1, 1, false, 0) == -1) return -1;
} }
if (hashconfig->opts_type & OPTS_TYPE_AUX2) if (hashconfig->opts_type & OPTS_TYPE_AUX2)
{ {
if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX2, 1, false, 0) == 0) test_ok = true; if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX2, 1, false, 0) == -1) return -1;
} }
if (hashconfig->opts_type & OPTS_TYPE_AUX3) if (hashconfig->opts_type & OPTS_TYPE_AUX3)
{ {
if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX3, 1, false, 0) == 0) test_ok = true; if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX3, 1, false, 0) == -1) return -1;
} }
if (hashconfig->opts_type & OPTS_TYPE_AUX4) if (hashconfig->opts_type & OPTS_TYPE_AUX4)
{ {
if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX4, 1, false, 0) == 0) test_ok = true; if (run_kernel (hashcat_ctx, device_param, KERN_RUN_AUX4, 1, false, 0) == -1) return -1;
}
} }
else
{
if (run_kernel (hashcat_ctx, device_param, KERN_RUN_3, 1, false, 0) == -1) return -1; if (run_kernel (hashcat_ctx, device_param, KERN_RUN_3, 1, false, 0) == -1) return -1;
} }
if (test_ok == false) return -1;
}
else
{
if (run_kernel (hashcat_ctx, device_param, KERN_RUN_3, 1, false, 0) == -1) return -1;
}
}
device_param->spin_damp = spin_damp_sav; device_param->spin_damp = spin_damp_sav;
// check : check if cracked // check : check if cracked