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

Merge pull request #1177 from philsmd/master

fixes #1175: custom charsets and --stdout triggered a missing mask error
This commit is contained in:
Jens Steube 2017-03-11 09:13:41 +01:00 committed by GitHub
commit f651f44606
2 changed files with 22 additions and 7 deletions

View File

@ -19,6 +19,7 @@
##
- Fixed a problem where --keyspace combined with custom charsets incorrectly displayed an error message
- Fixed a problem where --stdout combined with custom charsets incorrectly displayed an error message
- Fixed a typo that resulted in the minimum password length not being correctly initialized
- Fixed a problem with parsing and displaying -m 7000 = Fortigate (FortiOS) hashes

View File

@ -821,14 +821,28 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if (user_options->hc_argc < 2)
{
if (user_options->keyspace == false) // --keyspace would be a special case, i.e. we do not need a hash file
{
event_log_error (hashcat_ctx, "You need to specify a mask if you specify a custom-charset");
// detect if mask was specified:
return -1;
}
bool mask_is_missing = true;
if (user_options->keyspace == true) // special case if --keyspace was used: we need the mask but no hash file
{
if (user_options->hc_argc > 0) mask_is_missing = false;
}
else if (user_options->stdout_flag == true) // special case if --stdout was used: we need the mask but no hash file
{
if (user_options->hc_argc > 0) mask_is_missing = false;
}
else
{
if (user_options->hc_argc > 1) mask_is_missing = false;
}
if (mask_is_missing == true)
{
event_log_error (hashcat_ctx, "You need to specify a mask if you specify a custom-charset");
return -1;
}
}