Skip to content
Snippets Groups Projects
Commit 484516da authored by Matt Johnston's avatar Matt Johnston
Browse files

Send an auth packet straight away, save another roundtrip

This needs a bit of testing to make sure it doesn't have side-effects.
parent 5abe22d1
No related merge requests found
...@@ -40,11 +40,12 @@ void cli_authinitialise() { ...@@ -40,11 +40,12 @@ void cli_authinitialise() {
/* Send a "none" auth request to get available methods */ /* Send a "none" auth request to get available methods */
void cli_auth_getmethods() { void cli_auth_getmethods() {
TRACE(("enter 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(); CHECKCLEARTOWRITE();
buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
buf_putstring(ses.writepayload, cli_opts.username, buf_putstring(ses.writepayload, cli_opts.username,
strlen(cli_opts.username)); strlen(cli_opts.username));
...@@ -53,8 +54,8 @@ void cli_auth_getmethods() { ...@@ -53,8 +54,8 @@ void cli_auth_getmethods() {
buf_putstring(ses.writepayload, "none", 4); /* 'none' method */ buf_putstring(ses.writepayload, "none", 4); /* 'none' method */
encrypt_packet(); encrypt_packet();
#endif
TRACE(("leave cli_auth_getmethods")) TRACE(("leave cli_auth_getmethods"))
} }
void recv_msg_userauth_banner() { void recv_msg_userauth_banner() {
......
...@@ -188,6 +188,9 @@ ...@@ -188,6 +188,9 @@
#define DROPBEAR_KEY_LINES /* ie we're using authorized_keys or known_hosts */ #define DROPBEAR_KEY_LINES /* ie we're using authorized_keys or known_hosts */
#endif #endif
/* Send an auth request straight away rather than trying "none" type to get a list */
#define CLI_IMMEDIATE_AUTH
/* Changing this is inadvisable, it appears to have problems /* Changing this is inadvisable, it appears to have problems
* with flushing compressed data */ * with flushing compressed data */
#define DROPBEAR_ZLIB_MEM_LEVEL 8 #define DROPBEAR_ZLIB_MEM_LEVEL 8
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment