|
Jan F. Chadima |
986cee |
diff -up openssh-5.2p1/dns.c.rh205842 openssh-5.2p1/dns.c
|
|
Jan F. Chadima |
986cee |
--- openssh-5.2p1/dns.c.rh205842 2009-07-27 16:25:28.000000000 +0200
|
|
Jan F. Chadima |
986cee |
+++ openssh-5.2p1/dns.c 2009-07-27 16:40:59.000000000 +0200
|
|
Jan F. Chadima |
986cee |
@@ -176,6 +176,7 @@ verify_host_key_dns(const char *hostname
|
|
Jan F. Chadima |
986cee |
{
|
|
Jan F. Chadima |
986cee |
u_int counter;
|
|
Jan F. Chadima |
986cee |
int result;
|
|
Jan F. Chadima |
986cee |
+ unsigned int rrset_flags = 0;
|
|
Jan F. Chadima |
986cee |
struct rrsetinfo *fingerprints = NULL;
|
|
Jan F. Chadima |
986cee |
|
|
Jan F. Chadima |
986cee |
u_int8_t hostkey_algorithm;
|
|
Jan F. Chadima |
986cee |
@@ -199,8 +200,19 @@ verify_host_key_dns(const char *hostname
|
|
Jan F. Chadima |
986cee |
return -1;
|
|
Jan F. Chadima |
986cee |
}
|
|
Jan F. Chadima |
986cee |
|
|
Jan F. Chadima |
986cee |
+ /*
|
|
Jan F. Chadima |
986cee |
+ * Original getrrsetbyname function, found on OpenBSD for example,
|
|
Jan F. Chadima |
986cee |
+ * doesn't accept any flag and prerequisite for obtaining AD bit in
|
|
Jan F. Chadima |
986cee |
+ * DNS response is set by "options edns0" in resolv.conf.
|
|
Jan F. Chadima |
986cee |
+ *
|
|
Jan F. Chadima |
986cee |
+ * Our version is more clever and use RRSET_FORCE_EDNS0 flag.
|
|
Jan F. Chadima |
986cee |
+ */
|
|
Jan F. Chadima |
986cee |
+#ifndef HAVE_GETRRSETBYNAME
|
|
Jan F. Chadima |
986cee |
+ rrset_flags |= RRSET_FORCE_EDNS0;
|
|
Jan F. Chadima |
986cee |
+#endif
|
|
Jan F. Chadima |
986cee |
result = getrrsetbyname(hostname, DNS_RDATACLASS_IN,
|
|
Jan F. Chadima |
986cee |
- DNS_RDATATYPE_SSHFP, 0, &fingerprints);
|
|
Jan F. Chadima |
986cee |
+ DNS_RDATATYPE_SSHFP, rrset_flags, &fingerprints);
|
|
Jan F. Chadima |
986cee |
+
|
|
Jan F. Chadima |
986cee |
if (result) {
|
|
Jan F. Chadima |
986cee |
verbose("DNS lookup error: %s", dns_result_totext(result));
|
|
Jan F. Chadima |
986cee |
return -1;
|
|
Jan F. Chadima |
986cee |
diff -up openssh-5.2p1/openbsd-compat/getrrsetbyname.c.rh205842 openssh-5.2p1/openbsd-compat/getrrsetbyname.c
|
|
Jan F. Chadima |
986cee |
--- openssh-5.2p1/openbsd-compat/getrrsetbyname.c.rh205842 2009-07-27 16:22:23.000000000 +0200
|
|
Jan F. Chadima |
986cee |
+++ openssh-5.2p1/openbsd-compat/getrrsetbyname.c 2009-07-27 16:41:55.000000000 +0200
|
|
Jan F. Chadima |
986cee |
@@ -209,8 +209,8 @@ getrrsetbyname(const char *hostname, uns
|
|
Jan F. Chadima |
986cee |
goto fail;
|
|
Jan F. Chadima |
986cee |
}
|
|
Jan F. Chadima |
986cee |
|
|
Jan F. Chadima |
986cee |
- /* don't allow flags yet, unimplemented */
|
|
Jan F. Chadima |
986cee |
- if (flags) {
|
|
Jan F. Chadima |
986cee |
+ /* Allow RRSET_FORCE_EDNS0 flag only. */
|
|
Jan F. Chadima |
986cee |
+ if ((flags & !RRSET_FORCE_EDNS0) != 0) {
|
|
Jan F. Chadima |
986cee |
result = ERRSET_INVAL;
|
|
Jan F. Chadima |
986cee |
goto fail;
|
|
Jan F. Chadima |
986cee |
}
|
|
Jan F. Chadima |
986cee |
@@ -226,9 +226,9 @@ getrrsetbyname(const char *hostname, uns
|
|
Jan F. Chadima |
986cee |
#endif /* DEBUG */
|
|
Jan F. Chadima |
986cee |
|
|
Jan F. Chadima |
986cee |
#ifdef RES_USE_DNSSEC
|
|
Jan F. Chadima |
986cee |
- /* turn on DNSSEC if EDNS0 is configured */
|
|
Jan F. Chadima |
986cee |
- if (_resp->options & RES_USE_EDNS0)
|
|
Jan F. Chadima |
986cee |
- _resp->options |= RES_USE_DNSSEC;
|
|
Jan F. Chadima |
986cee |
+ /* turn on DNSSEC if required */
|
|
Jan F. Chadima |
986cee |
+ if (flags & RRSET_FORCE_EDNS0)
|
|
Jan F. Chadima |
986cee |
+ _resp->options |= (RES_USE_EDNS0|RES_USE_DNSSEC);
|
|
Jan F. Chadima |
986cee |
#endif /* RES_USE_DNSEC */
|
|
Jan F. Chadima |
986cee |
|
|
Jan F. Chadima |
986cee |
/* make query */
|
|
Jan F. Chadima |
986cee |
diff -up openssh-5.2p1/openbsd-compat/getrrsetbyname.h.rh205842 openssh-5.2p1/openbsd-compat/getrrsetbyname.h
|
|
Jan F. Chadima |
986cee |
--- openssh-5.2p1/openbsd-compat/getrrsetbyname.h.rh205842 2009-07-27 16:35:02.000000000 +0200
|
|
Jan F. Chadima |
986cee |
+++ openssh-5.2p1/openbsd-compat/getrrsetbyname.h 2009-07-27 16:36:09.000000000 +0200
|
|
Jan F. Chadima |
986cee |
@@ -72,6 +72,9 @@
|
|
Jan F. Chadima |
986cee |
#ifndef RRSET_VALIDATED
|
|
Jan F. Chadima |
986cee |
# define RRSET_VALIDATED 1
|
|
Jan F. Chadima |
986cee |
#endif
|
|
Jan F. Chadima |
986cee |
+#ifndef RRSET_FORCE_EDNS0
|
|
Jan F. Chadima |
986cee |
+# define RRSET_FORCE_EDNS0 0x0001
|
|
Jan F. Chadima |
986cee |
+#endif
|
|
Jan F. Chadima |
986cee |
|
|
Jan F. Chadima |
986cee |
/*
|
|
Jan F. Chadima |
986cee |
* Return codes for getrrsetbyname()
|