Mercurial > dropbear
comparison cli-session.c @ 47:4b53a43f0082
- client pubkey auth works
- rearrange the runopts code for client and server (hostkey reading is needed
by both (if the client is doing pubkey auth. otherwise....))
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 06 Aug 2004 16:18:01 +0000 |
parents | 9ee8996a375f |
children | 20563735e8b5 |
comparison
equal
deleted
inserted
replaced
46:3bea78e1b175 | 47:4b53a43f0082 |
---|---|
86 cli_ses.kex_state = KEX_NOTHING; | 86 cli_ses.kex_state = KEX_NOTHING; |
87 | 87 |
88 cli_ses.tty_raw_mode = 0; | 88 cli_ses.tty_raw_mode = 0; |
89 cli_ses.winchange = 0; | 89 cli_ses.winchange = 0; |
90 | 90 |
91 /* Auth */ | |
92 cli_ses.lastpubkey = NULL; | |
93 cli_ses.lastauthtype = NULL; | |
94 | |
91 /* For printing "remote host closed" for the user */ | 95 /* For printing "remote host closed" for the user */ |
92 ses.remoteclosed = cli_remoteclosed; | 96 ses.remoteclosed = cli_remoteclosed; |
93 ses.buf_match_algo = cli_buf_match_algo; | 97 ses.buf_match_algo = cli_buf_match_algo; |
94 | 98 |
95 /* packet handlers */ | 99 /* packet handlers */ |
158 cli_auth_try(); | 162 cli_auth_try(); |
159 cli_ses.state = USERAUTH_REQ_SENT; | 163 cli_ses.state = USERAUTH_REQ_SENT; |
160 TRACE(("leave cli_sessionloop: cli_auth_try")); | 164 TRACE(("leave cli_sessionloop: cli_auth_try")); |
161 return; | 165 return; |
162 | 166 |
167 /* | |
163 case USERAUTH_SUCCESS_RCVD: | 168 case USERAUTH_SUCCESS_RCVD: |
164 send_msg_service_request(SSH_SERVICE_CONNECTION); | 169 send_msg_service_request(SSH_SERVICE_CONNECTION); |
165 cli_ses.state = SERVICE_CONN_REQ_SENT; | 170 cli_ses.state = SERVICE_CONN_REQ_SENT; |
166 TRACE(("leave cli_sessionloop: sent ssh-connection service req")); | 171 TRACE(("leave cli_sessionloop: sent ssh-connection service req")); |
167 return; | 172 return; |
169 case SERVICE_CONN_ACCEPT_RCVD: | 174 case SERVICE_CONN_ACCEPT_RCVD: |
170 cli_send_chansess_request(); | 175 cli_send_chansess_request(); |
171 TRACE(("leave cli_sessionloop: cli_send_chansess_request")); | 176 TRACE(("leave cli_sessionloop: cli_send_chansess_request")); |
172 cli_ses.state = SESSION_RUNNING; | 177 cli_ses.state = SESSION_RUNNING; |
173 return; | 178 return; |
174 | 179 */ |
175 /* | 180 |
176 case USERAUTH_SUCCESS_RCVD: | 181 case USERAUTH_SUCCESS_RCVD: |
177 cli_send_chansess_request(); | 182 cli_send_chansess_request(); |
178 TRACE(("leave cli_sessionloop: cli_send_chansess_request")); | 183 TRACE(("leave cli_sessionloop: cli_send_chansess_request")); |
179 cli_ses.state = SESSION_RUNNING; | 184 cli_ses.state = SESSION_RUNNING; |
180 return; | 185 return; |
181 */ | |
182 | 186 |
183 case SESSION_RUNNING: | 187 case SESSION_RUNNING: |
184 if (ses.chancount < 1) { | 188 if (ses.chancount < 1) { |
185 cli_finished(); | 189 cli_finished(); |
186 } | 190 } |
234 /* Operates in-place turning dirty (untrusted potentially containing control | 238 /* Operates in-place turning dirty (untrusted potentially containing control |
235 * characters) text into clean text. */ | 239 * characters) text into clean text. */ |
236 void cleantext(unsigned char* dirtytext) { | 240 void cleantext(unsigned char* dirtytext) { |
237 | 241 |
238 unsigned int i, j; | 242 unsigned int i, j; |
239 unsigned char c, lastchar; | 243 unsigned char c; |
240 | 244 |
241 j = 0; | 245 j = 0; |
242 for (i = 0; dirtytext[i] != '\0'; i++) { | 246 for (i = 0; dirtytext[i] != '\0'; i++) { |
243 | 247 |
244 c = dirtytext[i]; | 248 c = dirtytext[i]; |