diff keyimport.c @ 846:b298bb438625 keyondemand

refactor key generation, make it generate as required. Needs UI in server command line options
author Matt Johnston <matt@ucc.asn.au>
date Thu, 07 Nov 2013 00:18:52 +0800
parents 774ad9b112ef
children f4bb964c8678
line wrap: on
line diff
--- a/keyimport.c	Fri Nov 01 00:21:59 2013 +0800
+++ b/keyimport.c	Thu Nov 07 00:18:52 2013 +0800
@@ -112,7 +112,7 @@
 
 	buffer * buf = NULL;
 	sign_key *ret = NULL;
-	int type;
+	enum signkey_type type;
 
 	buf = buf_new(MAX_PRIVKEY_SIZE);
 	if (buf_readfile(buf, filename) == DROPBEAR_FAILURE) {
@@ -501,7 +501,7 @@
 	return ret;
 }
 
-static sign_key *openssh_read(const char *filename, char *passphrase)
+static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
 {
 	struct openssh_key *key;
 	unsigned char *p;
@@ -511,7 +511,7 @@
 	char *errmsg;
 	char *modptr = NULL;
 	int modlen = -9999;
-	int type;
+	enum signkey_type type;
 
 	sign_key *retkey;
 	buffer * blobbuf = NULL;
@@ -1018,8 +1018,8 @@
 		}
 		*/
 		buffer *seq_buf = buf_new(400);
-		ecc_key **eck = signkey_ecc_key_ptr(key, key->type);
-		const unsigned long curve_size = (*eck)->dp->size;
+		ecc_key **eck = (ecc_key**)signkey_key_ptr(key, key->type);
+		const long curve_size = (*eck)->dp->size;
 		int curve_oid_len = 0;
 		const void* curve_oid = NULL;
 		unsigned long pubkey_size = 2*curve_size+1;