summaryrefslogtreecommitdiffhomepage
path: root/cli-auth.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-03-31 23:48:25 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-03-31 23:48:25 +0800
commit484516da516037d37747319e9b7cff91bffb6a4a (patch)
treebfbcb8c801cade28f49098d55c4ac04a48a2bb3b /cli-auth.c
parent5abe22d1a514d1f98f88927a23701b51bd7c134e (diff)
Send an auth packet straight away, save another roundtrip
This needs a bit of testing to make sure it doesn't have side-effects.
Diffstat (limited to 'cli-auth.c')
-rw-r--r--cli-auth.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cli-auth.c b/cli-auth.c
index 321cbf3..7dc101f 100644
--- a/cli-auth.c
+++ b/cli-auth.c
@@ -40,11 +40,12 @@ void cli_authinitialise() {
/* Send a "none" auth request to get available methods */
void cli_auth_getmethods() {
-
TRACE(("enter cli_auth_getmethods"))
-
+#ifdef CLI_IMMEDIATE_AUTH
+ ses.authstate.authtypes = AUTH_TYPE_PUBKEY | AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT;
+ cli_auth_try();
+#else
CHECKCLEARTOWRITE();
-
buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
buf_putstring(ses.writepayload, cli_opts.username,
strlen(cli_opts.username));
@@ -53,8 +54,8 @@ void cli_auth_getmethods() {
buf_putstring(ses.writepayload, "none", 4); /* 'none' method */
encrypt_packet();
+#endif
TRACE(("leave cli_auth_getmethods"))
-
}
void recv_msg_userauth_banner() {