1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00

Fixed backend active devices checks

This commit is contained in:
Gabriele Gristina 2022-02-19 17:21:27 +01:00
parent 6dc45eacc6
commit 24de156ce8
2 changed files with 18 additions and 1 deletions

View File

@ -24,6 +24,7 @@
##
- Fixed building error on Raspberry Pi
- Fixed backend active devices checks
- Fixed false negative on Unit Test in case of out-of-memory with grep in single mode
- Fixed false negative on Unit Test with hash-type 25400
- Fixed false negative on hash-types 4510 and 4710 for hashes with long salts

View File

@ -153,7 +153,6 @@ static int backend_ctx_find_alias_devices (hashcat_ctx_t *hashcat_ctx)
alias_device->skipped = true;
backend_ctx->opencl_devices_active--;
backend_ctx->backend_devices_active--;
// show a warning for specifically listed devices if they are an alias
@ -7303,6 +7302,9 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
if (hc_mtlCreateCommandQueue (hashcat_ctx, device_param->metal_device, &command_queue) == -1)
{
device_param->skipped = true;
backend_ctx->metal_devices_active--;
backend_ctx->backend_devices_active--;
continue;
}
@ -7414,6 +7416,9 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
if (hc_clCreateContext (hashcat_ctx, NULL, 1, &device_param->opencl_device, NULL, NULL, &context) == -1)
{
device_param->skipped = true;
backend_ctx->opencl_devices_active--;
backend_ctx->backend_devices_active--;
continue;
}
@ -7426,6 +7431,9 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
if (hc_clCreateCommandQueue (hashcat_ctx, context, device_param->opencl_device, 0, &command_queue) == -1)
{
device_param->skipped = true;
backend_ctx->opencl_devices_active--;
backend_ctx->backend_devices_active--;
continue;
}
@ -7612,6 +7620,14 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime)
}
}
// check again to catch error on OpenCL/Metal
if (backend_ctx->backend_devices_active == 0)
{
event_log_error (hashcat_ctx, "No devices found/left.");
return -1;
}
backend_ctx->target_msec = TARGET_MSEC_PROFILE[user_options->workload_profile - 1];
backend_ctx->need_adl = need_adl;