summaryrefslogtreecommitdiff
path: root/dns.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-09 16:10:01 +0000
committerColin Watson <cjwatson@debian.org>2014-10-07 14:27:21 +0100
commit4ac9937c1d9f1901ab0694114d76e59a138aae96 (patch)
tree1fea15387dd046b18554ecbc47f621a814241974 /dns.c
parent66377fbb52584b41bd7f6f19116107fbbad41058 (diff)
Force use of DNSSEC even if "options edns0" isn't in resolv.conf
This allows SSHFP DNS records to be verified if glibc 2.11 is installed. Origin: vendor, https://cvs.fedoraproject.org/viewvc/F-12/openssh/openssh-5.2p1-edns.patch?revision=1.1&view=markup Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572049 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572049 Last-Update: 2010-04-06 Patch-Name: dnssec-sshfp.patch
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 c4d073cf5..e5872c190 100644
--- a/dns.c
+++ b/dns.c
@@ -203,6 +203,7 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
203{ 203{
204 u_int counter; 204 u_int counter;
205 int result; 205 int result;
206 unsigned int rrset_flags = 0;
206 struct rrsetinfo *fingerprints = NULL; 207 struct rrsetinfo *fingerprints = NULL;
207 208
208 u_int8_t hostkey_algorithm; 209 u_int8_t hostkey_algorithm;
@@ -226,8 +227,19 @@ verify_host_key_dns(const char *hostname, struct sockaddr *address,
226 return -1; 227 return -1;
227 } 228 }
228 229
230 /*
231 * Original getrrsetbyname function, found on OpenBSD for example,
232 * doesn't accept any flag and prerequisite for obtaining AD bit in
233 * DNS response is set by "options edns0" in resolv.conf.
234 *
235 * Our version is more clever and use RRSET_FORCE_EDNS0 flag.
236 */
237#ifndef HAVE_GETRRSETBYNAME
238 rrset_flags |= RRSET_FORCE_EDNS0;
239#endif
229 result = getrrsetbyname(hostname, DNS_RDATACLASS_IN, 240 result = getrrsetbyname(hostname, DNS_RDATACLASS_IN,
230 DNS_RDATATYPE_SSHFP, 0, &fingerprints); 241 DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints);
242
231 if (result) { 243 if (result) {
232 verbose("DNS lookup error: %s", dns_result_totext(result)); 244 verbose("DNS lookup error: %s", dns_result_totext(result));
233 return -1; 245 return -1;