diff 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
line wrap: on
line diff
--- a/cli-agentfwd.c	Fri Mar 29 00:28:09 2013 +0800
+++ b/cli-agentfwd.c	Sat Apr 06 16:00:37 2013 +0800
@@ -254,7 +254,7 @@
 }
 
 void agent_buf_sign(buffer *sigblob, sign_key *key, 
-		const unsigned char *data, unsigned int len) {
+		buffer *data_buf) {
 	buffer *request_data = NULL;
 	buffer *response = NULL;
 	unsigned int siglen;
@@ -266,10 +266,10 @@
 	string			data
 	uint32			flags
 	*/
-	request_data = buf_new(MAX_PUBKEY_SIZE + len + 12);
+	request_data = buf_new(MAX_PUBKEY_SIZE + data_buf>-len + 12);
 	buf_put_pub_key(request_data, key, key->type);
 	
-	buf_putstring(request_data, data, len);
+	buf_putbufstring(request_data, data_buf);
 	buf_putint(request_data, 0);
 	
 	response = agent_request(SSH2_AGENTC_SIGN_REQUEST, request_data);