summaryrefslogtreecommitdiff
path: root/dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'dns.c')
-rw-r--r--dns.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/dns.c b/dns.c
index 131cb3d8b..dfa4c1ed3 100644
--- a/dns.c
+++ b/dns.c
@@ -177,6 +177,7 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
177{ 177{
178 u_int counter; 178 u_int counter;
179 int result; 179 int result;
180 unsigned int rrset_flags = 0;
180 struct rrsetinfo *fingerprints = NULL; 181 struct rrsetinfo *fingerprints = NULL;
181 182
182 u_int8_t hostkey_algorithm; 183 u_int8_t hostkey_algorithm;
@@ -200,8 +201,19 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
200 return -1; 201 return -1;
201 } 202 }
202 203
204 /*
205 * Original getrrsetbyname function, found on OpenBSD for example,
206 * doesn't accept any flag and prerequisite for obtaining AD bit in
207 * DNS response is set by "options edns0" in resolv.conf.
208 *
209 * Our version is more clever and use RRSET_FORCE_EDNS0 flag.
210 */
211#ifndef HAVE_GETRRSETBYNAME
212 rrset_flags |= RRSET_FORCE_EDNS0;
213#endif
203 result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, 214 result = getrrsetbyname(hostname, DNS_RDATACLASS_IN,
204 DNS_RDATATYPE_SSHFP, 0, &fingerprints); 215 DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints);
216
205 if (result) { 217 if (result) {
206 verbose("DNS lookup error: %s", dns_result_totext(result)); 218 verbose("DNS lookup error: %s", dns_result_totext(result));
207 return -1; 219 return -1;