version 1.42, 2022/02/01 23:32:51 |
version 1.43, 2023/02/10 04:56:30 |
|
|
* Export the fingerprint of a key as a DNS resource record |
* Export the fingerprint of a key as a DNS resource record |
*/ |
*/ |
int |
int |
export_dns_rr(const char *hostname, struct sshkey *key, FILE *f, int generic) |
export_dns_rr(const char *hostname, struct sshkey *key, FILE *f, int generic, |
|
int alg) |
{ |
{ |
u_int8_t rdata_pubkey_algorithm = 0; |
u_int8_t rdata_pubkey_algorithm = 0; |
u_int8_t rdata_digest_type = SSHFP_HASH_RESERVED; |
u_int8_t rdata_digest_type = SSHFP_HASH_RESERVED; |
|
|
int success = 0; |
int success = 0; |
|
|
for (dtype = SSHFP_HASH_SHA1; dtype < SSHFP_HASH_MAX; dtype++) { |
for (dtype = SSHFP_HASH_SHA1; dtype < SSHFP_HASH_MAX; dtype++) { |
|
if (alg != -1 && dtype != alg) |
|
continue; |
rdata_digest_type = dtype; |
rdata_digest_type = dtype; |
if (dns_read_key(&rdata_pubkey_algorithm, &rdata_digest_type, |
if (dns_read_key(&rdata_pubkey_algorithm, &rdata_digest_type, |
&rdata_digest, &rdata_digest_len, key)) { |
&rdata_digest, &rdata_digest_len, key)) { |