diff options
Diffstat (limited to 'dns.c')
-rw-r--r-- | dns.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -210,6 +210,7 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address, | |||
210 | { | 210 | { |
211 | u_int counter; | 211 | u_int counter; |
212 | int result; | 212 | int result; |
213 | unsigned int rrset_flags = 0; | ||
213 | struct rrsetinfo *fingerprints = NULL; | 214 | struct rrsetinfo *fingerprints = NULL; |
214 | 215 | ||
215 | u_int8_t hostkey_algorithm; | 216 | u_int8_t hostkey_algorithm; |
@@ -233,8 +234,19 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address, | |||
233 | return -1; | 234 | return -1; |
234 | } | 235 | } |
235 | 236 | ||
237 | /* | ||
238 | * Original getrrsetbyname function, found on OpenBSD for example, | ||
239 | * doesn't accept any flag and prerequisite for obtaining AD bit in | ||
240 | * DNS response is set by "options edns0" in resolv.conf. | ||
241 | * | ||
242 | * Our version is more clever and use RRSET_FORCE_EDNS0 flag. | ||
243 | */ | ||
244 | #ifndef HAVE_GETRRSETBYNAME | ||
245 | rrset_flags |= RRSET_FORCE_EDNS0; | ||
246 | #endif | ||
236 | result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, | 247 | result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, |
237 | DNS_RDATATYPE_SSHFP, 0, &fingerprints); | 248 | DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints); |
249 | |||
238 | if (result) { | 250 | if (result) { |
239 | verbose("DNS lookup error: %s", dns_result_totext(result)); | 251 | verbose("DNS lookup error: %s", dns_result_totext(result)); |
240 | return -1; | 252 | return -1; |