comparison cli-auth.c @ 894:7032deca6b90

Disable immediate auth for delayed-zlib mode
author Matt Johnston <matt@ucc.asn.au>
date Sat, 15 Feb 2014 21:23:41 +0800
parents ff597bf2cfb0
children ac340d3e452e
comparison
equal deleted inserted replaced
893:860e3522f8fc 894:7032deca6b90
50 buf_putstring(ses.writepayload, "none", 4); /* 'none' method */ 50 buf_putstring(ses.writepayload, "none", 4); /* 'none' method */
51 51
52 encrypt_packet(); 52 encrypt_packet();
53 53
54 #ifdef DROPBEAR_CLI_IMMEDIATE_AUTH 54 #ifdef DROPBEAR_CLI_IMMEDIATE_AUTH
55 ses.authstate.authtypes = AUTH_TYPE_PUBKEY; 55 /* We can't haven't two auth requests in-flight with delayed zlib mode
56 if (getenv(DROPBEAR_PASSWORD_ENV)) { 56 since if the first one succeeds then the remote side will
57 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT; 57 expect the second one to be compressed.
58 } 58 Race described at
59 if (cli_auth_try() == DROPBEAR_SUCCESS) { 59 http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/zlib-openssh.html
60 TRACE(("skipped initial none auth query")) 60 */
61 /* Note that there will be two auth responses in-flight */ 61 if (ses.keys->trans.algo_comp != DROPBEAR_COMP_ZLIB_DELAY) {
62 cli_ses.ignore_next_auth_response = 1; 62 ses.authstate.authtypes = AUTH_TYPE_PUBKEY;
63 if (getenv(DROPBEAR_PASSWORD_ENV)) {
64 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD | AUTH_TYPE_INTERACT;
65 }
66 if (cli_auth_try() == DROPBEAR_SUCCESS) {
67 TRACE(("skipped initial none auth query"))
68 /* Note that there will be two auth responses in-flight */
69 cli_ses.ignore_next_auth_response = 1;
70 }
63 } 71 }
64 #endif 72 #endif
65 TRACE(("leave cli_auth_getmethods")) 73 TRACE(("leave cli_auth_getmethods"))
66 } 74 }
67 75