diff dropbearconvert.c @ 836:d7d9f1612d51 ecc

writing out openssh ecc keys works
author Matt Johnston <matt@ucc.asn.au>
date Sun, 20 Oct 2013 21:06:18 +0800
parents 71e7d31f7671
children 220f55d540ae
line wrap: on
line diff
--- a/dropbearconvert.c	Sat May 25 00:54:19 2013 +0800
+++ b/dropbearconvert.c	Sun Oct 20 21:06:18 2013 +0800
@@ -28,6 +28,8 @@
 #include "buffer.h"
 #include "dbutil.h"
 #include "keyimport.h"
+#include "crypto_desc.h" 
+#include "random.h" 
 
 
 static int do_convert(int intype, const char* infile, int outtype,
@@ -114,7 +116,7 @@
 		const char* outfile) {
 
 	sign_key * key = NULL;
-	char * keytype = NULL;
+	const char * keytype = NULL;
 	int ret = 1;
 
 	key = import_read(infile, NULL, intype);
@@ -124,16 +126,7 @@
 		goto out;
 	}
 
-#ifdef DROPBEAR_RSA
-	if (key->rsakey != NULL) {
-		keytype = "RSA";
-	}
-#endif
-#ifdef DROPBEAR_DSS
-	if (key->dsskey != NULL) {
-		keytype = "DSS";
-	}
-#endif
+	keytype = signkey_name_from_type(key->type, NULL);
 
 	fprintf(stderr, "Key is a %s key\n", keytype);