1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Merge pull request #2372 from mpalmer/binary-parse-report-error

Allow module_hash_binary_parse to report a fatal error
This commit is contained in:
Jens Steube 2020-05-18 15:14:49 +02:00 committed by GitHub
commit 1dc3469f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -1288,10 +1288,14 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
{
hashes_cnt = hashes_parsed;
}
else
else if (hashes_parsed == 0)
{
event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hashes->hashfile, strerror (errno));
}
else
{
event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hashes->hashfile, strparser (hashes_parsed));
}
}
else
{

View File

@ -236,6 +236,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
hash_t *hashes_buf = hashes->hashes_buf;
int hashes_cnt = 0;
int last_error = 0;
for (int keyslot_idx = 0; keyslot_idx < LUKS_NUMKEYS; keyslot_idx++)
{
@ -247,12 +248,23 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, hashes->hashfile, strlen (hashes->hashfile));
if (parser_status != PARSER_OK) continue;
if (parser_status != PARSER_OK)
{
last_error = parser_status;
continue;
}
hashes_cnt++;
}
return hashes_cnt;
if (hashes_cnt == 0)
{
return last_error;
}
else
{
return hashes_cnt;
}
}
u64 module_kern_type_dynamic (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info)