mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-16 17:42:04 +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:
commit
1dc3469f6e
@ -1288,10 +1288,14 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx)
|
|||||||
{
|
{
|
||||||
hashes_cnt = hashes_parsed;
|
hashes_cnt = hashes_parsed;
|
||||||
}
|
}
|
||||||
else
|
else if (hashes_parsed == 0)
|
||||||
{
|
{
|
||||||
event_log_warning (hashcat_ctx, "Hashfile '%s': %s", hashes->hashfile, strerror (errno));
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -236,6 +236,7 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
|||||||
hash_t *hashes_buf = hashes->hashes_buf;
|
hash_t *hashes_buf = hashes->hashes_buf;
|
||||||
|
|
||||||
int hashes_cnt = 0;
|
int hashes_cnt = 0;
|
||||||
|
int last_error = 0;
|
||||||
|
|
||||||
for (int keyslot_idx = 0; keyslot_idx < LUKS_NUMKEYS; keyslot_idx++)
|
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));
|
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++;
|
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)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user