Mercurial > dropbear
comparison 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 |
comparison
equal
deleted
inserted
replaced
1436:60fc6476e044 | 1438:4f8eb331174f |
---|---|
137 char ** next = NULL; | 137 char ** next = NULL; |
138 char * filename = NULL; | 138 char * filename = NULL; |
139 enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE; | 139 enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE; |
140 char * typetext = NULL; | 140 char * typetext = NULL; |
141 char * sizetext = NULL; | 141 char * sizetext = NULL; |
142 unsigned int bits = 0; | 142 unsigned int bits = 0, genbits; |
143 int printpub = 0; | 143 int printpub = 0; |
144 | 144 |
145 crypto_init(); | 145 crypto_init(); |
146 seedrandom(); | 146 seedrandom(); |
147 | 147 |
238 } | 238 } |
239 | 239 |
240 check_signkey_bits(keytype, bits);; | 240 check_signkey_bits(keytype, bits);; |
241 } | 241 } |
242 | 242 |
243 fprintf(stderr, "Generating key, this may take a while...\n"); | 243 genbits = signkey_generate_get_bits(keytype, bits); |
244 fprintf(stderr, "Generating %d bit %s key, this may take a while...\n", genbits, typetext); | |
244 if (signkey_generate(keytype, bits, filename, 0) == DROPBEAR_FAILURE) | 245 if (signkey_generate(keytype, bits, filename, 0) == DROPBEAR_FAILURE) |
245 { | 246 { |
246 dropbear_exit("Failed to generate key.\n"); | 247 dropbear_exit("Failed to generate key.\n"); |
247 } | 248 } |
248 | 249 |