Disable immediate auth for delayed-zlib mode

This commit is contained in:
Matt Johnston 2014-02-15 21:23:41 +08:00
parent 1dc5312f00
commit fa2d843403

View File

@ -52,14 +52,22 @@ void cli_auth_getmethods() {
encrypt_packet(); encrypt_packet();
#ifdef DROPBEAR_CLI_IMMEDIATE_AUTH #ifdef DROPBEAR_CLI_IMMEDIATE_AUTH
ses.authstate.authtypes = AUTH_TYPE_PUBKEY; /* We can't haven't two auth requests in-flight with delayed zlib mode
if (getenv(DROPBEAR_PASSWORD_ENV)) { since if the first one succeeds then the remote side will
ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT; expect the second one to be compressed.
} Race described at
if (cli_auth_try() == DROPBEAR_SUCCESS) { http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/zlib-openssh.html
TRACE(("skipped initial none auth query")) */
/* Note that there will be two auth responses in-flight */ if (ses.keys->trans.algo_comp != DROPBEAR_COMP_ZLIB_DELAY) {
cli_ses.ignore_next_auth_response = 1; ses.authstate.authtypes = AUTH_TYPE_PUBKEY;
if (getenv(DROPBEAR_PASSWORD_ENV)) {
ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT;
}
if (cli_auth_try() == DROPBEAR_SUCCESS) {
TRACE(("skipped initial none auth query"))
/* Note that there will be two auth responses in-flight */
cli_ses.ignore_next_auth_response = 1;
}
} }
#endif #endif
TRACE(("leave cli_auth_getmethods")) TRACE(("leave cli_auth_getmethods"))