comparison cli-agentfwd.c @ 760:f336d232fc63 ecc

Make _sign and _verify functions take a buffer* rather than void* and int
author Matt Johnston <matt@ucc.asn.au>
date Sat, 06 Apr 2013 16:00:37 +0800
parents 0fd32a552ea5
children ac2158e3e403
comparison
equal deleted inserted replaced
759:76fba0856749 760:f336d232fc63
252 252
253 agent_get_key_list(ret_list); 253 agent_get_key_list(ret_list);
254 } 254 }
255 255
256 void agent_buf_sign(buffer *sigblob, sign_key *key, 256 void agent_buf_sign(buffer *sigblob, sign_key *key,
257 const unsigned char *data, unsigned int len) { 257 buffer *data_buf) {
258 buffer *request_data = NULL; 258 buffer *request_data = NULL;
259 buffer *response = NULL; 259 buffer *response = NULL;
260 unsigned int siglen; 260 unsigned int siglen;
261 int packet_type; 261 int packet_type;
262 262
264 byte SSH2_AGENTC_SIGN_REQUEST 264 byte SSH2_AGENTC_SIGN_REQUEST
265 string key_blob 265 string key_blob
266 string data 266 string data
267 uint32 flags 267 uint32 flags
268 */ 268 */
269 request_data = buf_new(MAX_PUBKEY_SIZE + len + 12); 269 request_data = buf_new(MAX_PUBKEY_SIZE + data_buf>-len + 12);
270 buf_put_pub_key(request_data, key, key->type); 270 buf_put_pub_key(request_data, key, key->type);
271 271
272 buf_putstring(request_data, data, len); 272 buf_putbufstring(request_data, data_buf);
273 buf_putint(request_data, 0); 273 buf_putint(request_data, 0);
274 274
275 response = agent_request(SSH2_AGENTC_SIGN_REQUEST, request_data); 275 response = agent_request(SSH2_AGENTC_SIGN_REQUEST, request_data);
276 276
277 if (!response) { 277 if (!response) {