comparison cli-session.c @ 686:983a817f8e41 insecure-nocrypto

- Only request "none" cipher after auth has succeeded
author Matt Johnston <matt@ucc.asn.au>
date Thu, 17 May 2012 20:52:57 +0800
parents a98a2138364a
children 78eda530c000 d44325108d0e d1575fdc29a6
comparison
equal deleted inserted replaced
685:5af8993f7529 686:983a817f8e41
131 131
132 /* Auth */ 132 /* Auth */
133 cli_ses.lastprivkey = NULL; 133 cli_ses.lastprivkey = NULL;
134 cli_ses.lastauthtype = 0; 134 cli_ses.lastauthtype = 0;
135 135
136 #ifdef DROPBEAR_NONE_CIPHER
137 cli_ses.cipher_none_after_auth = get_algo_usable(sshciphers, "none");
138 set_algo_usable(sshciphers, "none", 0);
139 #else
140 cli_ses.cipher_none_after_auth = 0;
141 #endif
142
136 /* For printing "remote host closed" for the user */ 143 /* For printing "remote host closed" for the user */
137 ses.remoteclosed = cli_remoteclosed; 144 ses.remoteclosed = cli_remoteclosed;
138 ses.buf_match_algo = cli_buf_match_algo; 145 ses.buf_match_algo = cli_buf_match_algo;
139 146
140 /* packet handlers */ 147 /* packet handlers */
204 cli_ses.state = USERAUTH_REQ_SENT; 211 cli_ses.state = USERAUTH_REQ_SENT;
205 TRACE(("leave cli_sessionloop: cli_auth_try")) 212 TRACE(("leave cli_sessionloop: cli_auth_try"))
206 return; 213 return;
207 214
208 case USERAUTH_SUCCESS_RCVD: 215 case USERAUTH_SUCCESS_RCVD:
216
217 #ifdef DROPBEAR_NONE_CIPHER
218 if (cli_ses.cipher_none_after_auth)
219 {
220 set_algo_usable(sshciphers, "none", 1);
221 send_msg_kexinit();
222 }
223 #endif
209 224
210 if (cli_opts.backgrounded) { 225 if (cli_opts.backgrounded) {
211 int devnull; 226 int devnull;
212 /* keeping stdin open steals input from the terminal and 227 /* keeping stdin open steals input from the terminal and
213 is confusing, though stdout/stderr could be useful. */ 228 is confusing, though stdout/stderr could be useful. */