comparison cli-agentfwd.c @ 984:d46e7f613157

Handle invalid agent keys by skipping rather than exiting. My agent exposes both conventional keys and certs ([email protected]) and I want dropbear to be able to use the former.
author Catalin Patulea <cat@vv.carleton.ca>
date Thu, 01 Jan 2015 17:47:46 -0500
parents 0bb16232e7c4
children 9bf46570868f
comparison
equal deleted inserted replaced
983:2b62f26cf808 984:d46e7f613157
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 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