diff dropbearkey.c @ 795:7f604f9b3756 ecc

ecdsa is working
author Matt Johnston <matt@ucc.asn.au>
date Fri, 03 May 2013 23:07:48 +0800
parents d386defb5376
children 45f1bc96f357
line wrap: on
line diff
--- a/dropbearkey.c	Sun Apr 28 23:17:43 2013 +0800
+++ b/dropbearkey.c	Fri May 03 23:07:48 2013 +0800
@@ -53,6 +53,7 @@
 #include "gendss.h"
 #include "ecdsa.h"
 #include "crypto_desc.h"
+#include "random.h"
 
 static void printhelp(char * progname);
 
@@ -120,6 +121,9 @@
 	unsigned int bits;
 	int printpub = 0;
 
+	crypto_init();
+	seedrandom();
+
 	/* get the commandline options */
 	for (i = 1; i < argc; i++) {
 		if (argv[i] == NULL) {
@@ -223,10 +227,6 @@
 	/* don't want the file readable by others */
 	umask(077);
 
-	crypto_init();
-	seedrandom();
-
-
 	/* now we can generate the key */
 	key = new_sign_key();
 	
@@ -245,6 +245,7 @@
 #ifdef DROPBEAR_ECDSA
 		case DROPBEAR_SIGNKEY_ECDSA_KEYGEN:
 			key->ecckey = gen_ecdsa_priv_key(bits);
+			keytype = ecdsa_signkey_type(key->ecckey);
 			break;
 #endif
 		default: