comparison cli-agentfwd.c @ 989:73ea0dce9a57 pam

Merge up to date
author Matt Johnston <matt@ucc.asn.au>
date Fri, 23 Jan 2015 21:38:47 +0800
parents 9bf46570868f
children 16584026a1f0
comparison
equal deleted inserted replaced
925:bae0b34bc059 989:73ea0dce9a57
208 key_buf = buf_getstringbuf(inbuf); 208 key_buf = buf_getstringbuf(inbuf);
209 pubkey = new_sign_key(); 209 pubkey = new_sign_key();
210 ret = buf_get_pub_key(key_buf, pubkey, &key_type); 210 ret = buf_get_pub_key(key_buf, pubkey, &key_type);
211 buf_free(key_buf); 211 buf_free(key_buf);
212 if (ret != DROPBEAR_SUCCESS) { 212 if (ret != DROPBEAR_SUCCESS) {
213 /* This is slack, properly would cleanup vars etc */ 213 TRACE(("Skipping bad/unknown type pubkey from agent"));
214 dropbear_exit("Bad pubkey received from agent"); 214 sign_key_free(pubkey);
215 } else {
216 pubkey->type = key_type;
217 pubkey->source = SIGNKEY_SOURCE_AGENT;
218
219 list_append(ret_list, pubkey);
215 } 220 }
216 pubkey->type = key_type;
217 pubkey->source = SIGNKEY_SOURCE_AGENT;
218
219 list_append(ret_list, pubkey);
220 221
221 /* We'll ignore the comment for now. might want it later.*/ 222 /* We'll ignore the comment for now. might want it later.*/
222 buf_eatstring(inbuf); 223 buf_eatstring(inbuf);
223 } 224 }
224 225
232 void cli_setup_agent(struct Channel *channel) { 233 void cli_setup_agent(struct Channel *channel) {
233 if (!getenv("SSH_AUTH_SOCK")) { 234 if (!getenv("SSH_AUTH_SOCK")) {
234 return; 235 return;
235 } 236 }
236 237
237 cli_start_send_channel_request(channel, "[email protected]"); 238 start_send_channel_request(channel, "[email protected]");
238 /* Don't want replies */ 239 /* Don't want replies */
239 buf_putbyte(ses.writepayload, 0); 240 buf_putbyte(ses.writepayload, 0);
240 encrypt_packet(); 241 encrypt_packet();
241 } 242 }
242 243