summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-11-28 16:41:46 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-11-28 16:41:46 +1100
commit9f647335d21daf0bf23257e47be98b3e18219b63 (patch)
treec149c11a801e7909cc313f23efbae81d46c6524c /ssh-keygen.c
parentb1a8777f3ac863890bb9d324866d1a78c42c6597 (diff)
[ssh-keygen.1 ssh-keygen.c]
Enforce DSA key length of exactly 1024 bits to comply with FIPS-186-2, increase minumum RSA key size to 768 bits and update man page to reflect these. Patch originally bz#1119 (senthilkumar_sen at hotpop.com), ok djm@, grudging ok deraadt@.
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 7f9c7fd1a..b4c651d22 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: ssh-keygen.c,v 1.133 2005/10/31 11:12:49 djm Exp $"); 15RCSID("$OpenBSD: ssh-keygen.c,v 1.134 2005/11/28 05:16:53 dtucker Exp $");
16 16
17#include <openssl/evp.h> 17#include <openssl/evp.h>
18#include <openssl/pem.h> 18#include <openssl/pem.h>
@@ -1046,7 +1046,7 @@ main(int ac, char **av)
1046 "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) { 1046 "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) {
1047 switch (opt) { 1047 switch (opt) {
1048 case 'b': 1048 case 'b':
1049 bits = strtonum(optarg, 512, 32768, &errstr); 1049 bits = strtonum(optarg, 768, 32768, &errstr);
1050 if (errstr) 1050 if (errstr)
1051 fatal("Bits has bad value %s (%s)", 1051 fatal("Bits has bad value %s (%s)",
1052 optarg, errstr); 1052 optarg, errstr);
@@ -1259,6 +1259,8 @@ main(int ac, char **av)
1259 fprintf(stderr, "unknown key type %s\n", key_type_name); 1259 fprintf(stderr, "unknown key type %s\n", key_type_name);
1260 exit(1); 1260 exit(1);
1261 } 1261 }
1262 if (type == KEY_DSA && bits != 1024)
1263 fatal("DSA keys must be 1024 bits");
1262 if (!quiet) 1264 if (!quiet)
1263 printf("Generating public/private %s key pair.\n", key_type_name); 1265 printf("Generating public/private %s key pair.\n", key_type_name);
1264 if (bits == 0) 1266 if (bits == 0)