version 1.30, 2002/07/24 16:11:18 |
version 1.30.4.2, 2004/03/04 18:18:15 |
|
|
} |
} |
|
|
static int |
static int |
hostfile_check_key(int bits, Key *key, const char *host, const char *filename, int linenum) |
hostfile_check_key(int bits, const Key *key, const char *host, const char *filename, int linenum) |
{ |
{ |
if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL) |
if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL) |
return 1; |
return 1; |
if (bits != BN_num_bits(key->rsa->n)) { |
if (bits != BN_num_bits(key->rsa->n)) { |
log("Warning: %s, line %d: keysize mismatch for host %s: " |
logit("Warning: %s, line %d: keysize mismatch for host %s: " |
"actual %d vs. announced %d.", |
"actual %d vs. announced %d.", |
filename, linenum, host, BN_num_bits(key->rsa->n), bits); |
filename, linenum, host, BN_num_bits(key->rsa->n), bits); |
log("Warning: replace %d with %d in %s, line %d.", |
logit("Warning: replace %d with %d in %s, line %d.", |
bits, BN_num_bits(key->rsa->n), filename, linenum); |
bits, BN_num_bits(key->rsa->n), filename, linenum); |
} |
} |
return 1; |
return 1; |
|
|
|
|
static HostStatus |
static HostStatus |
check_host_in_hostfile_by_key_or_type(const char *filename, |
check_host_in_hostfile_by_key_or_type(const char *filename, |
const char *host, Key *key, int keytype, Key *found, int *numret) |
const char *host, const Key *key, int keytype, Key *found, int *numret) |
{ |
{ |
FILE *f; |
FILE *f; |
char line[8192]; |
char line[8192]; |
|
|
} |
} |
|
|
HostStatus |
HostStatus |
check_host_in_hostfile(const char *filename, const char *host, Key *key, |
check_host_in_hostfile(const char *filename, const char *host, const Key *key, |
Key *found, int *numret) |
Key *found, int *numret) |
{ |
{ |
if (key == NULL) |
if (key == NULL) |
|
|
*/ |
*/ |
|
|
int |
int |
add_host_to_hostfile(const char *filename, const char *host, Key *key) |
add_host_to_hostfile(const char *filename, const char *host, const Key *key) |
{ |
{ |
FILE *f; |
FILE *f; |
int success = 0; |
int success = 0; |