]> andersk Git - openssh.git/blobdiff - ssh-keygen.c
- (dtucker) [auth-pam.c scard-opensc.c] Tinderbox says auth-pam.c uses
[openssh.git] / ssh-keygen.c
index 961fd43e555484381a43b914198bc4da05b82350..5539fe17a1286e18f832b48f4000e994533a6f2a 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keygen.c,v 1.112 2003/11/23 23:18:45 djm Exp $");
+RCSID("$OpenBSD: ssh-keygen.c,v 1.115 2004/05/09 00:06:47 djm Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/pem.h>
@@ -26,8 +26,7 @@ RCSID("$OpenBSD: ssh-keygen.c,v 1.112 2003/11/23 23:18:45 djm Exp $");
 #include "bufaux.h"
 #include "pathnames.h"
 #include "log.h"
-#include "readpass.h"
-#include "moduli.h"
+#include "misc.h"
 
 #ifdef SMARTCARD
 #include "scard.h"
@@ -85,6 +84,10 @@ char *__progname;
 
 char hostname[MAXHOSTNAMELEN];
 
+/* moduli.c */
+int gen_candidates(FILE *, int, int, BIGNUM *);
+int prime_test(FILE *, FILE *, u_int32_t, u_int32_t);
+
 static void
 ask_filename(struct passwd *pw, const char *prompt)
 {
@@ -797,6 +800,7 @@ main(int ac, char **av)
        int opt, type, fd, download = 0, memory = 0;
        int generator_wanted = 0, trials = 100;
        int do_gen_candidates = 0, do_screen_candidates = 0;
+       int log_level = SYSLOG_LEVEL_INFO;
        BIGNUM *start = NULL;
        FILE *f;
 
@@ -823,7 +827,7 @@ main(int ac, char **av)
        }
 
        while ((opt = getopt(ac, av,
-           "degiqpclBRxXyb:f:t:U:D:P:N:C:r:g:T:G:M:S:a:W:")) != -1) {
+           "degiqpclBRvxXyb:f:t:U:D:P:N:C:r:g:T:G:M:S:a:W:")) != -1) {
                switch (opt) {
                case 'b':
                        bits = atoi(optarg);
@@ -891,6 +895,15 @@ main(int ac, char **av)
                case 'U':
                        reader_id = optarg;
                        break;
+               case 'v':
+                       if (log_level == SYSLOG_LEVEL_INFO)
+                               log_level = SYSLOG_LEVEL_DEBUG1;
+                       else {
+                               if (log_level >= SYSLOG_LEVEL_DEBUG1 && 
+                                   log_level < SYSLOG_LEVEL_DEBUG3)
+                                       log_level++;
+                       }
+                       break;
                case 'r':
                        resource_record_hostname = optarg;
                        break;
@@ -901,18 +914,9 @@ main(int ac, char **av)
                        break;
                case 'a':
                        trials = atoi(optarg);
-                       if (trials < TRIAL_MINIMUM) {
-                               fatal("Minimum primality trials is %d",
-                                   TRIAL_MINIMUM);
-                       }
                        break;
                case 'M':
                        memory = atoi(optarg);
-                       if (memory != 0 &&
-                          (memory < LARGE_MINIMUM || memory > LARGE_MAXIMUM)) {
-                               fatal("Invalid memory amount (min %ld, max %ld)",
-                                   LARGE_MINIMUM, LARGE_MAXIMUM);
-                       }
                        break;
                case 'G':
                        do_gen_candidates = 1;
@@ -932,6 +936,10 @@ main(int ac, char **av)
                        usage();
                }
        }
+
+       /* reinit */
+       log_init(av[0], log_level, SYSLOG_FACILITY_USER, 1);
+
        if (optind < ac) {
                printf("Too many arguments.\n");
                usage();
This page took 0.040758 seconds and 4 git commands to generate.