version 1.108.2.1, 2004/02/28 03:51:34 |
version 1.108.2.2, 2004/08/19 22:37:32 |
|
|
#include "bufaux.h" |
#include "bufaux.h" |
#include "pathnames.h" |
#include "pathnames.h" |
#include "log.h" |
#include "log.h" |
#include "readpass.h" |
#include "misc.h" |
#include "moduli.h" |
|
|
|
#ifdef SMARTCARD |
#ifdef SMARTCARD |
#include "scard.h" |
#include "scard.h" |
|
|
|
|
char hostname[MAXHOSTNAMELEN]; |
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 |
static void |
ask_filename(struct passwd *pw, const char *prompt) |
ask_filename(struct passwd *pw, const char *prompt) |
{ |
{ |
|
|
static void |
static void |
buffer_get_bignum_bits(Buffer *b, BIGNUM *value) |
buffer_get_bignum_bits(Buffer *b, BIGNUM *value) |
{ |
{ |
u_int bits = buffer_get_int(b); |
u_int bignum_bits = buffer_get_int(b); |
u_int bytes = (bits + 7) / 8; |
u_int bytes = (bignum_bits + 7) / 8; |
|
|
if (buffer_len(b) < bytes) |
if (buffer_len(b) < bytes) |
fatal("buffer_get_bignum_bits: input buffer too small: " |
fatal("buffer_get_bignum_bits: input buffer too small: " |
|
|
* Print the SSHFP RR. |
* Print the SSHFP RR. |
*/ |
*/ |
static void |
static void |
do_print_resource_record(struct passwd *pw, char *hostname) |
do_print_resource_record(struct passwd *pw, char *hname) |
{ |
{ |
Key *public; |
Key *public; |
char *comment = NULL; |
char *comment = NULL; |
|
|
} |
} |
public = key_load_public(identity_file, &comment); |
public = key_load_public(identity_file, &comment); |
if (public != NULL) { |
if (public != NULL) { |
export_dns_rr(hostname, public, stdout, print_generic); |
export_dns_rr(hname, public, stdout, print_generic); |
key_free(public); |
key_free(public); |
xfree(comment); |
xfree(comment); |
exit(0); |
exit(0); |
|
|
if (log_level == SYSLOG_LEVEL_INFO) |
if (log_level == SYSLOG_LEVEL_INFO) |
log_level = SYSLOG_LEVEL_DEBUG1; |
log_level = SYSLOG_LEVEL_DEBUG1; |
else { |
else { |
if (log_level >= SYSLOG_LEVEL_DEBUG1 && |
if (log_level >= SYSLOG_LEVEL_DEBUG1 && |
log_level < SYSLOG_LEVEL_DEBUG3) |
log_level < SYSLOG_LEVEL_DEBUG3) |
log_level++; |
log_level++; |
} |
} |
|
|
break; |
break; |
case 'a': |
case 'a': |
trials = atoi(optarg); |
trials = atoi(optarg); |
if (trials < TRIAL_MINIMUM) { |
|
fatal("Minimum primality trials is %d", |
|
TRIAL_MINIMUM); |
|
} |
|
break; |
break; |
case 'M': |
case 'M': |
memory = atoi(optarg); |
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; |
break; |
case 'G': |
case 'G': |
do_gen_candidates = 1; |
do_gen_candidates = 1; |