]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - openssh/patches/openssh-5.9p1-edns.patch
openssh: Update to 5.9p1.
[people/amarx/ipfire-3.x.git] / openssh / patches / openssh-5.9p1-edns.patch
1 diff -up openssh-5.9p1/dns.c.edns openssh-5.9p1/dns.c
2 --- openssh-5.9p1/dns.c.edns 2010-08-31 14:41:14.000000000 +0200
3 +++ openssh-5.9p1/dns.c 2011-09-09 08:05:27.782440497 +0200
4 @@ -177,6 +177,7 @@ verify_host_key_dns(const char *hostname
5 {
6 u_int counter;
7 int result;
8 + unsigned int rrset_flags = 0;
9 struct rrsetinfo *fingerprints = NULL;
10
11 u_int8_t hostkey_algorithm;
12 @@ -200,8 +201,19 @@ verify_host_key_dns(const char *hostname
13 return -1;
14 }
15
16 + /*
17 + * Original getrrsetbyname function, found on OpenBSD for example,
18 + * doesn't accept any flag and prerequisite for obtaining AD bit in
19 + * DNS response is set by "options edns0" in resolv.conf.
20 + *
21 + * Our version is more clever and use RRSET_FORCE_EDNS0 flag.
22 + */
23 +#ifndef HAVE_GETRRSETBYNAME
24 + rrset_flags |= RRSET_FORCE_EDNS0;
25 +#endif
26 result = getrrsetbyname(hostname, DNS_RDATACLASS_IN,
27 - DNS_RDATATYPE_SSHFP, 0, &fingerprints);
28 + DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints);
29 +
30 if (result) {
31 verbose("DNS lookup error: %s", dns_result_totext(result));
32 return -1;
33 diff -up openssh-5.9p1/openbsd-compat/getrrsetbyname.c.edns openssh-5.9p1/openbsd-compat/getrrsetbyname.c
34 --- openssh-5.9p1/openbsd-compat/getrrsetbyname.c.edns 2009-07-13 03:38:23.000000000 +0200
35 +++ openssh-5.9p1/openbsd-compat/getrrsetbyname.c 2011-09-09 15:03:39.930500801 +0200
36 @@ -209,8 +209,8 @@ getrrsetbyname(const char *hostname, uns
37 goto fail;
38 }
39
40 - /* don't allow flags yet, unimplemented */
41 - if (flags) {
42 + /* Allow RRSET_FORCE_EDNS0 flag only. */
43 + if ((flags & ~RRSET_FORCE_EDNS0) != 0) {
44 result = ERRSET_INVAL;
45 goto fail;
46 }
47 @@ -226,9 +226,9 @@ getrrsetbyname(const char *hostname, uns
48 #endif /* DEBUG */
49
50 #ifdef RES_USE_DNSSEC
51 - /* turn on DNSSEC if EDNS0 is configured */
52 - if (_resp->options & RES_USE_EDNS0)
53 - _resp->options |= RES_USE_DNSSEC;
54 + /* turn on DNSSEC if required */
55 + if (flags & RRSET_FORCE_EDNS0)
56 + _resp->options |= (RES_USE_EDNS0|RES_USE_DNSSEC);
57 #endif /* RES_USE_DNSEC */
58
59 /* make query */
60 diff -up openssh-5.9p1/openbsd-compat/getrrsetbyname.h.edns openssh-5.9p1/openbsd-compat/getrrsetbyname.h
61 --- openssh-5.9p1/openbsd-compat/getrrsetbyname.h.edns 2007-10-26 08:26:50.000000000 +0200
62 +++ openssh-5.9p1/openbsd-compat/getrrsetbyname.h 2011-09-09 08:05:27.965438689 +0200
63 @@ -72,6 +72,9 @@
64 #ifndef RRSET_VALIDATED
65 # define RRSET_VALIDATED 1
66 #endif
67 +#ifndef RRSET_FORCE_EDNS0
68 +# define RRSET_FORCE_EDNS0 0x0001
69 +#endif
70
71 /*
72 * Return codes for getrrsetbyname()