summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 9407321d5..57679ee43 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.214 2012/05/23 03:28:28 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.215 2012/07/06 00:41:59 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -154,7 +154,8 @@ char hostname[MAXHOSTNAMELEN];
154 154
155/* moduli.c */ 155/* moduli.c */
156int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *); 156int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
157int prime_test(FILE *, FILE *, u_int32_t, u_int32_t, char *); 157int prime_test(FILE *, FILE *, u_int32_t, u_int32_t, char *, unsigned long,
158 unsigned long);
158 159
159static void 160static void
160type_bits_valid(int type, u_int32_t *bitsp) 161type_bits_valid(int type, u_int32_t *bitsp)
@@ -1888,6 +1889,8 @@ usage(void)
1888 fprintf(stderr, " -h Generate host certificate instead of a user certificate.\n"); 1889 fprintf(stderr, " -h Generate host certificate instead of a user certificate.\n");
1889 fprintf(stderr, " -I key_id Key identifier to include in certificate.\n"); 1890 fprintf(stderr, " -I key_id Key identifier to include in certificate.\n");
1890 fprintf(stderr, " -i Import foreign format to OpenSSH key file.\n"); 1891 fprintf(stderr, " -i Import foreign format to OpenSSH key file.\n");
1892 fprintf(stderr, " -J number Screen this number of moduli lines\n");
1893 fprintf(stderr, " -j number Start screening moduli at specified line.\n");
1891 fprintf(stderr, " -K checkpt Write checkpoints to this file.\n"); 1894 fprintf(stderr, " -K checkpt Write checkpoints to this file.\n");
1892 fprintf(stderr, " -L Print the contents of a certificate.\n"); 1895 fprintf(stderr, " -L Print the contents of a certificate.\n");
1893 fprintf(stderr, " -l Show fingerprint of key file.\n"); 1896 fprintf(stderr, " -l Show fingerprint of key file.\n");
@@ -1930,6 +1933,7 @@ main(int argc, char **argv)
1930 u_int32_t memory = 0, generator_wanted = 0, trials = 100; 1933 u_int32_t memory = 0, generator_wanted = 0, trials = 100;
1931 int do_gen_candidates = 0, do_screen_candidates = 0; 1934 int do_gen_candidates = 0, do_screen_candidates = 0;
1932 int gen_all_hostkeys = 0; 1935 int gen_all_hostkeys = 0;
1936 unsigned long start_lineno = 0, lines_to_process = 0;
1933 BIGNUM *start = NULL; 1937 BIGNUM *start = NULL;
1934 FILE *f; 1938 FILE *f;
1935 const char *errstr; 1939 const char *errstr;
@@ -1958,8 +1962,8 @@ main(int argc, char **argv)
1958 exit(1); 1962 exit(1);
1959 } 1963 }
1960 1964
1961 while ((opt = getopt(argc, argv, "AegiqpclBHLhvxXyF:b:f:t:D:I:K:P:m:N:n:" 1965 while ((opt = getopt(argc, argv, "AegiqpclBHLhvxXyF:b:f:t:D:I:J:j:K:P:"
1962 "O:C:r:g:R:T:G:M:S:s:a:V:W:z:")) != -1) { 1966 "m:N:n:O:C:r:g:R:T:G:M:S:s:a:V:W:z")) != -1) {
1963 switch (opt) { 1967 switch (opt) {
1964 case 'A': 1968 case 'A':
1965 gen_all_hostkeys = 1; 1969 gen_all_hostkeys = 1;
@@ -1980,6 +1984,12 @@ main(int argc, char **argv)
1980 case 'I': 1984 case 'I':
1981 cert_key_id = optarg; 1985 cert_key_id = optarg;
1982 break; 1986 break;
1987 case 'J':
1988 lines_to_process = strtoul(optarg, NULL, 10);
1989 break;
1990 case 'j':
1991 start_lineno = strtoul(optarg, NULL, 10);
1992 break;
1983 case 'R': 1993 case 'R':
1984 delete_host = 1; 1994 delete_host = 1;
1985 rr_hostname = optarg; 1995 rr_hostname = optarg;
@@ -2238,8 +2248,8 @@ main(int argc, char **argv)
2238 fatal("Couldn't open moduli file \"%s\": %s", 2248 fatal("Couldn't open moduli file \"%s\": %s",
2239 out_file, strerror(errno)); 2249 out_file, strerror(errno));
2240 } 2250 }
2241 if (prime_test(in, out, trials, generator_wanted, checkpoint) 2251 if (prime_test(in, out, trials, generator_wanted, checkpoint,
2242 != 0) 2252 start_lineno, lines_to_process) != 0)
2243 fatal("modulus screening failed"); 2253 fatal("modulus screening failed");
2244 return (0); 2254 return (0);
2245 } 2255 }