stdin: add read timeout checks (abort if no input for a long time)

This commit is contained in:
philsmd
2018-10-17 10:55:47 +02:00
parent 5b8a35a118
commit 73ed017daf
6 changed files with 61 additions and 0 deletions

View File

@@ -6,6 +6,9 @@
#ifndef _MONITOR_H
#define _MONITOR_H
#define STDIN_TIMEOUT_MIN 20 // warn after no input from stdin for x seconds
#define STDIN_TIMEOUT_MAX 120 // abort after no input from stdin for x seconds
int get_runtime_left (const hashcat_ctx_t *hashcat_ctx);
HC_API_CALL void *thread_monitor (void *p);

View File

@@ -120,6 +120,8 @@ typedef enum event_identifier
EVENT_MONITOR_THROTTLE2 = 0x00000084,
EVENT_MONITOR_THROTTLE3 = 0x00000085,
EVENT_MONITOR_PERFORMANCE_HINT = 0x00000086,
EVENT_MONITOR_NOINPUT_HINT = 0x00000087,
EVENT_MONITOR_NOINPUT_ABORT = 0x00000088,
EVENT_OPENCL_SESSION_POST = 0x00000090,
EVENT_OPENCL_SESSION_PRE = 0x00000091,
EVENT_OUTERLOOP_FINISHED = 0x000000a0,
@@ -2022,6 +2024,12 @@ typedef struct status_ctx
double msec_paused; // timer on current dict
/**
* read timeouts
*/
u32 stdin_read_timeout_cnt;
} status_ctx_t;
typedef struct hashcat_user