diff cli-runopts.c @ 1821:df8d8ec1801c

added option to disable trivial auth methods (#128) * added option to disable trivial auth methods * rename argument to match with other ssh clients * fixed trivial auth detection for pubkeys
author Manfred Kaiser <37737811+manfred-kaiser@users.noreply.github.com>
date Thu, 19 Aug 2021 17:37:14 +0200
parents f8d8af12ac14
children 94dc11094e26
line wrap: on
line diff
--- a/cli-runopts.c	Thu Aug 19 23:17:34 2021 +0800
+++ b/cli-runopts.c	Thu Aug 19 17:37:14 2021 +0200
@@ -152,6 +152,7 @@
 #if DROPBEAR_CLI_ANYTCPFWD
 	cli_opts.exit_on_fwd_failure = 0;
 #endif
+	cli_opts.disable_trivial_auth = 0;
 #if DROPBEAR_CLI_LOCALTCPFWD
 	cli_opts.localfwds = list_new();
 	opts.listen_fwd_all = 0;
@@ -889,6 +890,7 @@
 #if DROPBEAR_CLI_ANYTCPFWD
 			"\tExitOnForwardFailure\n"
 #endif
+			"\tDisableTrivialAuth\n"
 #ifndef DISABLE_SYSLOG
 			"\tUseSyslog\n"
 #endif
@@ -916,5 +918,10 @@
 		return;
 	}
 
+	if (match_extendedopt(&optstr, "DisableTrivialAuth") == DROPBEAR_SUCCESS) {
+		cli_opts.disable_trivial_auth = parse_flag_value(optstr);
+		return;
+	}
+
 	dropbear_log(LOG_WARNING, "Ignoring unknown configuration option '%s'", origstr);
 }