@@ -125,9 +125,9 @@ static const char *const HINTS[] =
125
125
"Enable verbose output" ,
126
126
"Specify how detailed logs should be. Possible values: 'error', 'warning', 'notice', 'info', 'verbose', 'debug'" ,
127
127
"Enable basic information output" ,
128
- "Comma-separated list of key files to use (one of -k/-H options is required for encryption) " ,
128
+ "Comma-separated list of key files to use" ,
129
129
"Comma-separated list of hosts to encrypt/decrypt for (defaults to 'localhost')" ,
130
- "Output file (required)" ,
130
+ "Output file (required for encrypt/decrypt )" ,
131
131
NULL
132
132
};
133
133
@@ -981,12 +981,10 @@ int main(int argc, char *argv[])
981
981
DoCleanupAndExit (EXIT_SUCCESS );
982
982
}
983
983
984
- if (decrypt && (host_arg == NULL ) && (key_path_arg == NULL ))
984
+ // Default to localhost
985
+ if ((encrypt || decrypt ) && (host_arg == NULL ) && (key_path_arg == NULL ))
985
986
{
986
- /* Decryption requires a private key which is usually only available for
987
- * the local host. Let's just default to localhost if no other specific
988
- * host/key is given for decryption. */
989
- Log (LOG_LEVEL_VERBOSE , "Using the localhost private key for decryption" );
987
+ Log (LOG_LEVEL_VERBOSE , "Using the localhost private key as default" );
990
988
host_arg = "localhost" ;
991
989
}
992
990
@@ -1022,13 +1020,6 @@ int main(int argc, char *argv[])
1022
1020
key_paths = SeqNew (16 , free );
1023
1021
}
1024
1022
1025
- // Default to localhost on encryption
1026
- char * localhost = "127.0.0.1" ;
1027
- if (encrypt && key_path_arg == NULL && host_arg == NULL )
1028
- {
1029
- host_arg = localhost ;
1030
- }
1031
-
1032
1023
if (host_arg != NULL )
1033
1024
{
1034
1025
Log (LOG_LEVEL_DEBUG , "-H/--host given: '%s'" , host_arg );
0 commit comments