version 1.55, 2014/01/31 16:39:19 |
version 1.56, 2014/04/29 18:01:49 |
|
|
hostfile_check_key(int bits, const Key *key, const char *host, |
hostfile_check_key(int bits, const Key *key, const char *host, |
const char *filename, u_long linenum) |
const char *filename, u_long linenum) |
{ |
{ |
|
#ifdef WITH_SSH1 |
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)) { |
|
|
logit("Warning: replace %d with %d in %s, line %lu.", |
logit("Warning: replace %d with %d in %s, line %lu.", |
bits, BN_num_bits(key->rsa->n), filename, linenum); |
bits, BN_num_bits(key->rsa->n), filename, linenum); |
} |
} |
|
#endif |
return 1; |
return 1; |
} |
} |
|
|
|
|
key = key_new(KEY_UNSPEC); |
key = key_new(KEY_UNSPEC); |
if (!hostfile_read_key(&cp, &kbits, key)) { |
if (!hostfile_read_key(&cp, &kbits, key)) { |
key_free(key); |
key_free(key); |
|
#ifdef WITH_SSH1 |
key = key_new(KEY_RSA1); |
key = key_new(KEY_RSA1); |
if (!hostfile_read_key(&cp, &kbits, key)) { |
if (!hostfile_read_key(&cp, &kbits, key)) { |
key_free(key); |
key_free(key); |
continue; |
continue; |
} |
} |
|
#else |
|
continue; |
|
#endif |
} |
} |
if (!hostfile_check_key(kbits, key, host, path, linenum)) |
if (!hostfile_check_key(kbits, key, host, path, linenum)) |
continue; |
continue; |