=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keygen.c,v retrieving revision 1.108.2.1 retrieving revision 1.113.2.1 diff -u -r1.108.2.1 -r1.113.2.1 --- src/usr.bin/ssh/ssh-keygen.c 2004/02/28 03:51:34 1.108.2.1 +++ src/usr.bin/ssh/ssh-keygen.c 2004/08/19 04:13:27 1.113.2.1 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.108.2.1 2004/02/28 03:51:34 brad Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.113.2.1 2004/08/19 04:13:27 brad Exp $"); #include #include @@ -26,8 +26,7 @@ #include "bufaux.h" #include "pathnames.h" #include "log.h" -#include "readpass.h" -#include "moduli.h" +#include "misc.h" #ifdef SMARTCARD #include "scard.h" @@ -81,6 +80,10 @@ 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) { @@ -185,8 +188,8 @@ static void buffer_get_bignum_bits(Buffer *b, BIGNUM *value) { - u_int bits = buffer_get_int(b); - u_int bytes = (bits + 7) / 8; + u_int bignum_bits = buffer_get_int(b); + u_int bytes = (bignum_bits + 7) / 8; if (buffer_len(b) < bytes) fatal("buffer_get_bignum_bits: input buffer too small: " @@ -623,7 +626,7 @@ * Print the SSHFP RR. */ static void -do_print_resource_record(struct passwd *pw, char *hostname) +do_print_resource_record(struct passwd *pw, char *hname) { Key *public; char *comment = NULL; @@ -637,7 +640,7 @@ } public = key_load_public(identity_file, &comment); if (public != NULL) { - export_dns_rr(hostname, public, stdout, print_generic); + export_dns_rr(hname, public, stdout, print_generic); key_free(public); xfree(comment); exit(0); @@ -887,7 +890,7 @@ if (log_level == SYSLOG_LEVEL_INFO) log_level = SYSLOG_LEVEL_DEBUG1; else { - if (log_level >= SYSLOG_LEVEL_DEBUG1 && + if (log_level >= SYSLOG_LEVEL_DEBUG1 && log_level < SYSLOG_LEVEL_DEBUG3) log_level++; } @@ -902,18 +905,9 @@ 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;