summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-keygen.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2005-11-29 02:04:56 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2005-11-29 02:04:56 +0000
commit6ff144d08ae0eb6028f671b6b0bacb2a1ac17547 (patch)
tree1eaec236dab99d4b36f02a8b40f43e158f66554f /usr.bin/ssh/ssh-keygen.c
parent2289230cd4956395355f0912d00a118c6d699b58 (diff)
Populate default key sizes before checking them; from & ok tim@
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 89c0cf079b1..efb891df60f 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-keygen.c,v 1.134 2005/11/28 05:16:53 dtucker Exp $");
+RCSID("$OpenBSD: ssh-keygen.c,v 1.135 2005/11/29 02:04:55 dtucker Exp $");
#include <openssl/evp.h>
#include <openssl/pem.h>
@@ -1254,12 +1254,12 @@ main(int ac, char **av)
fprintf(stderr, "unknown key type %s\n", key_type_name);
exit(1);
}
+ if (bits == 0)
+ bits = (type == KEY_DSA) ? DEFAULT_BITS_DSA : DEFAULT_BITS;
if (type == KEY_DSA && bits != 1024)
fatal("DSA keys must be 1024 bits");
if (!quiet)
printf("Generating public/private %s key pair.\n", key_type_name);
- if (bits == 0)
- bits = (type == KEY_DSA) ? DEFAULT_BITS_DSA : DEFAULT_BITS;
private = key_generate(type, bits);
if (private == NULL) {
fprintf(stderr, "key_generate failed");