1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-29 03:18:30 +00:00

Fixed a missing check for errors on OpenCL device leading to invalid removal of restore file

This commit is contained in:
jsteube 2018-07-10 13:17:07 +02:00
parent 1b30a1d6c7
commit 82457d2904
5 changed files with 22 additions and 2 deletions

View File

@ -23,6 +23,7 @@
- Fixed a missing kernel in -m 5600 in combination with -a 3 and -O if mask is >= 16 characters - Fixed a missing kernel in -m 5600 in combination with -a 3 and -O if mask is >= 16 characters
- Fixed a miscalculation in --progress-only mode output for extreme slow kernels like -m 14800 - Fixed a miscalculation in --progress-only mode output for extreme slow kernels like -m 14800
- Fixed missing code section in -m 2500 and -m 2501 to crack corrupted handshakes with a LE endian bitness base - Fixed missing code section in -m 2500 and -m 2501 to crack corrupted handshakes with a LE endian bitness base
- Fixed a missing check for errors on OpenCL device leading to invalid removal of restore file
* changes v4.0.1 -> v4.1.0 * changes v4.0.1 -> v4.1.0

View File

@ -177,6 +177,7 @@ typedef enum status_rc
STATUS_BYPASS = 9, STATUS_BYPASS = 9,
STATUS_ABORTED_CHECKPOINT = 10, STATUS_ABORTED_CHECKPOINT = 10,
STATUS_ABORTED_RUNTIME = 11, STATUS_ABORTED_RUNTIME = 11,
STATUS_ERROR = 13,
} status_rc_t; } status_rc_t;

View File

@ -304,7 +304,14 @@ void *thread_calc_stdin (void *p)
if (device_param->skipped) return NULL; if (device_param->skipped) return NULL;
calc_stdin (hashcat_ctx, device_param); // we should check the RC here const int rc_calc = calc_stdin (hashcat_ctx, device_param);
if (rc_calc == -1)
{
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
status_ctx->devices_status = STATUS_ERROR;
}
return NULL; return NULL;
} }
@ -716,7 +723,14 @@ void *thread_calc (void *p)
if (device_param->skipped) return NULL; if (device_param->skipped) return NULL;
calc (hashcat_ctx, device_param); // we should check the RC here const int rc_calc = calc (hashcat_ctx, device_param);
if (rc_calc == -1)
{
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
status_ctx->devices_status = STATUS_ERROR;
}
return NULL; return NULL;
} }

View File

@ -265,6 +265,7 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
} }
if ((status_ctx->devices_status != STATUS_CRACKED) if ((status_ctx->devices_status != STATUS_CRACKED)
&& (status_ctx->devices_status != STATUS_ERROR)
&& (status_ctx->devices_status != STATUS_ABORTED) && (status_ctx->devices_status != STATUS_ABORTED)
&& (status_ctx->devices_status != STATUS_ABORTED_CHECKPOINT) && (status_ctx->devices_status != STATUS_ABORTED_CHECKPOINT)
&& (status_ctx->devices_status != STATUS_ABORTED_RUNTIME) && (status_ctx->devices_status != STATUS_ABORTED_RUNTIME)
@ -1239,6 +1240,7 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx)
if (status_ctx->devices_status == STATUS_QUIT) rc_final = 2; if (status_ctx->devices_status == STATUS_QUIT) rc_final = 2;
if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = 1; if (status_ctx->devices_status == STATUS_EXHAUSTED) rc_final = 1;
if (status_ctx->devices_status == STATUS_CRACKED) rc_final = 0; if (status_ctx->devices_status == STATUS_CRACKED) rc_final = 0;
if (status_ctx->devices_status == STATUS_ERROR) rc_final = -1;
} }
// done // done

View File

@ -33,6 +33,7 @@ static const char *ST_0009 = "Bypass";
static const char *ST_0010 = "Aborted (Checkpoint)"; static const char *ST_0010 = "Aborted (Checkpoint)";
static const char *ST_0011 = "Aborted (Runtime)"; static const char *ST_0011 = "Aborted (Runtime)";
static const char *ST_0012 = "Running (Checkpoint Quit requested)"; static const char *ST_0012 = "Running (Checkpoint Quit requested)";
static const char *ST_0013 = "Error";
static const char *ST_9999 = "Unknown! Bug!"; static const char *ST_9999 = "Unknown! Bug!";
static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' }; static const char UNITS[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' };
@ -227,6 +228,7 @@ const char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
case STATUS_BYPASS: return ST_0009; case STATUS_BYPASS: return ST_0009;
case STATUS_ABORTED_CHECKPOINT: return ST_0010; case STATUS_ABORTED_CHECKPOINT: return ST_0010;
case STATUS_ABORTED_RUNTIME: return ST_0011; case STATUS_ABORTED_RUNTIME: return ST_0011;
case STATUS_ERROR: return ST_0013;
} }
return ST_9999; return ST_9999;