]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Merge branch 'master' into flags-refactor
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 9 Aug 2017 14:28:36 +0000 (16:28 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 9 Aug 2017 14:28:36 +0000 (16:28 +0200)
There were just simple conflicts in NEWS and docs.

1  2 
NEWS
config.mk
daemon/README.rst
daemon/lua/kres-gen.lua
daemon/lua/kres-gen.sh
lib/layer/iterate.c
lib/resolve.c
modules/cookies/cookiemonster.c
modules/policy/README.rst
modules/policy/policy.lua

diff --cc NEWS
index a0c33843e8666910d1d935bf4c7dec7dd5680939,445d7bcbf882731b2a8f3fb96c4c3ea2502905c2..ff45a641bf659ecc306030101b9799b3812d433c
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -1,14 -1,24 +1,35 @@@
 +Knot Resolver 1.4.0 (2017-0x-yy)
 +================================
 +
 +Incompatible changes
 +--------------------
 +- lua: query flag-sets are no longer represented as plain integers.
 +  kres.query.* no longer works, and kr_query_t lost trivial methods
 +  'hasflag' and 'resolved'.
 +  You can instead write code like qry.flags.NO_0X20 = true.
 +
 +
+ Knot Resolver 1.3.3 (2017-08-09)
+ ================================
+ Security
+ --------
+ - Fix a critical DNSSEC flaw.  Signatures might be accepted as valid
+   even if the signed data was not in bailiwick of the DNSKEY used to
+   sign it, assuming the trust chain to that DNSKEY was valid.
+ Bugfixes
+ --------
+ - iterate: skip RRSIGs with bad label count instead of immediate SERVFAIL
+ - utils: fix possible incorrect seeding of the random generator
+ - modules/http: fix compatibility with the Prometheus text format
+ Improvements
+ ------------
+ - policy: implement remaining special-use domain names from RFC6761 (#205),
+   and make these rules apply only if no other non-chain rule applies
  Knot Resolver 1.3.2 (2017-07-28)
  ================================
  
diff --cc config.mk
index 64b55bdf241fe82b7e70127ccd3aaecf0ee037dd,d688dc0ec06532e04d705d971d76cd41d2a65b7d..abb62413cc45a0cdffe21141bee1636ceb1ab44d
+++ b/config.mk
@@@ -1,9 -1,9 +1,9 @@@
  # Project
  MAJOR := 1
  MINOR := 3
- PATCH := 2
+ PATCH := 3
  EXTRA :=
 -ABIVER := 3
 +ABIVER := 4
  BUILDMODE := dynamic
  HARDENING := yes
  
Simple merge
index 44cb9b37a8798b0c3b6a4945ce8676c21a64a067,fbe4208d930817a543e5a9a64d429d6175bcb0da..78f4021480095edaa706d60787d543d847751a9e
@@@ -199,8 -165,12 +199,11 @@@ struct kr_context 
        struct kr_zonecut root_hints;
        char _stub[];
  };
- int knot_dname_size(const knot_dname_t *);
 -struct query_flag {static const int NO_MINIMIZE = 1; static const int NO_THROTTLE = 2; static const int NO_IPV6 = 4; static const int NO_IPV4 = 8; static const int TCP = 16; static const int RESOLVED = 32; static const int AWAIT_IPV4 = 64; static const int AWAIT_IPV6 = 128; static const int AWAIT_CUT = 256; static const int SAFEMODE = 512; static const int CACHED = 1024; static const int NO_CACHE = 2048; static const int EXPIRING = 4096; static const int ALLOW_LOCAL = 8192; static const int DNSSEC_WANT = 16384; static const int DNSSEC_BOGUS = 32768; static const int DNSSEC_INSECURE = 65536; static const int STUB = 131072; static const int ALWAYS_CUT = 262144; static const int DNSSEC_WEXPAND = 524288; static const int PERMISSIVE = 1048576; static const int STRICT = 2097152; static const int BADCOOKIE_AGAIN = 4194304; static const int CNAME = 8388608; static const int REORDER_RR = 16777216; static const int TRACE = 33554432; static const int NO_0X20 = 67108864; static const int DNSSEC_NODS = 134217728; static const int DNSSEC_OPTOUT = 268435456; static const int NONAUTH = 536870912; static const int FORWARD = 1073741824; static const int DNS64_MARK = 2147483648;};
  knot_dname_t *knot_dname_from_str(uint8_t *, const char *, size_t);
+ _Bool knot_dname_is_equal(const knot_dname_t *, const knot_dname_t *);
+ _Bool knot_dname_is_sub(const knot_dname_t *, const knot_dname_t *);
+ int knot_dname_labels(const uint8_t *, const uint8_t *);
+ int knot_dname_size(const knot_dname_t *);
  char *knot_dname_to_str(char *, const knot_dname_t *, size_t);
  uint16_t knot_rdata_rdlen(const knot_rdata_t *);
  uint8_t *knot_rdata_data(const knot_rdata_t *);
Simple merge
index 5e31c6767e7664ae180e012f4e7833b1e7505abf,5c1017b8194a37b9930b5ebbf3bd53934979c7cc..791b9d09f6b78b63ac9d7d63c215f4d14962a1fc
@@@ -465,10 -465,13 +465,13 @@@ static int unroll_cname(knot_pkt_t *pkt
                        if (rr->type == KNOT_RRTYPE_RRSIG) {
                                int rrsig_labels = knot_rrsig_labels(&rr->rrs, 0);
                                if (rrsig_labels > cname_labels) {
-                                       return KR_STATE_FAIL;
+                                       /* clearly wrong RRSIG, don't pick it.
+                                        * don't fail immediately,
+                                        * let validator work. */
+                                       continue;
                                }
                                if (rrsig_labels < cname_labels) {
 -                                      query->flags |= QUERY_DNSSEC_WEXPAND;
 +                                      query->flags.DNSSEC_WEXPAND = true;
                                }
                        }
  
diff --cc lib/resolve.c
index 76c3ec8a3cbf4e8ccea7b6e681f56db97044c2e2,2fdd47071eb4be8b8d04749e46ba3574a4f85b9b..fabcdd0073105c67751cea50e86b06f004e20339
@@@ -1420,8 -1412,8 +1420,8 @@@ ns_election
        }
  
        /* Randomize query case (if not in safemode or turned off) */
 -      qry->secret = (qry->flags & (QUERY_SAFEMODE | QUERY_NO_0X20))
 +      qry->secret = (qry->flags.SAFEMODE || qry->flags.NO_0X20)
-                       ? 0 : kr_rand_uint(UINT32_MAX);
+                       ? 0 : kr_rand_uint(0);
        knot_dname_t *qname_raw = (knot_dname_t *)knot_pkt_qname(packet);
        randomized_qname_case(qname_raw, qry->secret);
  
Simple merge
index 2746497b327c7d9d14e0c0a28e2e690ec85671e2,b5a527d10207aa3f5885f4ebdef2a2074c8c6252..d7cb29d7c4572eef6f151d83b8051dd20ff7c957
@@@ -28,10 -32,12 +32,12 @@@ There are several actions available in 
    the parameter can be a single IP (string) or a lua list of up to four IPs.
  * ``STUB(ip)`` - similar to ``FORWARD(ip)`` but *without* attempting DNSSEC validation.
    Each request may be either answered from cache or simply sent to one of the IPs with proxying back the answer.
- * ``MIRROR(ip)`` - mirror query to given IP and continue solving it (useful for partial snooping)
+ * ``MIRROR(ip)`` - mirror query to given IP and continue solving it (useful for partial snooping); it's a chain action
  * ``REROUTE({{subnet,target}, ...})`` - reroute addresses in response matching given subnet to given target, e.g. ``{'192.0.2.0/24', '127.0.0.0'}`` will rewrite '192.0.2.55' to '127.0.0.55', see :ref:`renumber module <mod-renumber>` for more information.
- * ``QTRACE`` - pretty-print DNS response packets into the log (useful for debugging weird DNS servers).
- * ``FLAGS(set, clear)`` - set and/or clear some flags for the query.  There can be multiple flags to set/clear.  You can just pass a single flag name (string) or a set of names.
+ * ``QTRACE`` - pretty-print DNS response packets into the log for the query and its sub-queries.  It's useful for debugging weird DNS servers.  It's a chain action.
 -* ``FLAGS(set, clear)`` - set and/or clear some flags for the query.  There can be multiple flags to set/clear, combined by ``bit.bor`` from ``kres.query.*`` values.  It's a chain action.
++* ``FLAGS(set, clear)`` - set and/or clear some flags for the query.  There can be multiple flags to set/clear.  You can just pass a single flag name (string) or a set of names.  It's a chain action.
+ Most actions stop the policy matching on the query, but "chain actions" allow to keep trying to match other rules, until a non-chain action is triggered.
  
  .. warning:: The policy module currently only looks at whole DNS requests.  The rules won't be re-applied e.g. when following CNAMEs.
  
Simple merge