diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:10:01 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-02-21 12:07:18 +0000 |
commit | 74c1c0ef7689ea68dc8263f73c00ff8675f9f0fe (patch) | |
tree | 211ef9cd4296f67e9358aaaadfabd69c97634ba0 /dns.c | |
parent | c19bcc02b07b450d585d0fd10ccd96174aeb3b7c (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.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; |