diff dropbearkey.c @ 1438:4f8eb331174f

add configuration option for default RSA size. print key size with dropbearkey
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 23:32:25 +0800
parents e8f67918fdc9
children bdd3802c8ac6
line wrap: on
line diff
--- a/dropbearkey.c	Sat Jun 24 22:37:14 2017 +0800
+++ b/dropbearkey.c	Sat Jun 24 23:32:25 2017 +0800
@@ -139,7 +139,7 @@
 	enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE;
 	char * typetext = NULL;
 	char * sizetext = NULL;
-	unsigned int bits = 0;
+	unsigned int bits = 0, genbits;
 	int printpub = 0;
 
 	crypto_init();
@@ -240,7 +240,8 @@
 		check_signkey_bits(keytype, bits);;
 	}
 
-	fprintf(stderr, "Generating key, this may take a while...\n");
+	genbits = signkey_generate_get_bits(keytype, bits);
+	fprintf(stderr, "Generating %d bit %s key, this may take a while...\n", genbits, typetext);
 	if (signkey_generate(keytype, bits, filename, 0) == DROPBEAR_FAILURE)
 	{
 		dropbear_exit("Failed to generate key.\n");