From 660c3405f95fa3f1169cbeaba2bc74a37bcbea9e Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Mon, 28 Nov 2005 17:45:32 -0800 Subject: [PATCH] - (tim) [ssh-keygen.c] Move DSA length test after setting default when bits == 0. --- ChangeLog | 6 +++++- ssh-keygen.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8c053f6d..1be6498d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20051129 + - (tim) [ssh-keygen.c] Move DSA length test after setting default when + bits == 0. + 20051128 - (dtucker) [regress/yes-head.sh] Work around breakage caused by some versions of GNU head. Based on patch from zappaman at buraphalinux.org @@ -3375,4 +3379,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4012 2005/11/28 11:28:59 dtucker Exp $ +$Id: ChangeLog,v 1.4013 2005/11/29 01:45:32 tim Exp $ diff --git a/ssh-keygen.c b/ssh-keygen.c index b4c651d22..3a6174ac1 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -1259,12 +1259,12 @@ main(int ac, char **av) fprintf(stderr, "unknown key type %s\n", key_type_name); exit(1); } - 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; + if (type == KEY_DSA && bits != 1024) + fatal("DSA keys must be 1024 bits"); private = key_generate(type, bits); if (private == NULL) { fprintf(stderr, "key_generate failed");