1
mirror of https://github.com/hashcat/hashcat synced 2024-11-24 14:27:14 +01:00

Add user opt sanity check for brain port, clean up messages for other brain related checks.

This commit is contained in:
Chick3nman 2023-03-23 19:01:24 -05:00
parent 04e7f84daf
commit 35d51020a5

View File

@ -559,24 +559,31 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
#ifdef WITH_BRAIN
#ifdef WITH_BRAIN
if ((user_options->brain_client == true) && (user_options->brain_server == true))
{
event_log_error (hashcat_ctx, "Can not have --brain-client and --brain-server at the same time");
event_log_error (hashcat_ctx, "Can not have --brain-client and --brain-server at the same time.");
return -1;
}
if ((user_options->brain_client_features < 1) || (user_options->brain_client_features > 3))
{
event_log_error (hashcat_ctx, "Invalid --brain-client-feature argument");
event_log_error (hashcat_ctx, "Invalid --brain-client-feature argument.");
return -1;
}
if (user_options->brain_port > 65535)
{
event_log_error (hashcat_ctx, "Invalid brain port specified (greater than 65535).");
return -1;
}
if ((user_options->brain_client == true) && (user_options->brain_password_chgd == false))
{
event_log_error (hashcat_ctx, "Brain clients need to set --brain-password");
event_log_error (hashcat_ctx, "Brain clients must specify --brain-password.");
return -1;
}