Re: [DNSOP] DNS cookies and multi-vendor anycast incompatibility

Mark Andrews <marka@isc.org> Thu, 21 June 2018 23:44 UTC

Return-Path: <marka@isc.org>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1A9F2127AC2 for <dnsop@ietfa.amsl.com>; Thu, 21 Jun 2018 16:44:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.9
X-Spam-Level:
X-Spam-Status: No, score=-6.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id irF6T6GoRwxp for <dnsop@ietfa.amsl.com>; Thu, 21 Jun 2018 16:43:58 -0700 (PDT)
Received: from mx.pao1.isc.org (mx.pao1.isc.org [149.20.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4843512785F for <dnsop@ietf.org>; Thu, 21 Jun 2018 16:43:58 -0700 (PDT)
Received: from zmx1.isc.org (zmx1.isc.org [149.20.0.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.pao1.isc.org (Postfix) with ESMTPS id 2CCAE3AB001; Thu, 21 Jun 2018 23:43:58 +0000 (UTC)
Received: from zmx1.isc.org (localhost [127.0.0.1]) by zmx1.isc.org (Postfix) with ESMTPS id 0CD7D16003D; Thu, 21 Jun 2018 23:43:58 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1]) by zmx1.isc.org (Postfix) with ESMTP id E5703160068; Thu, 21 Jun 2018 23:43:57 +0000 (UTC)
Received: from zmx1.isc.org ([127.0.0.1]) by localhost (zmx1.isc.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jVNHCNaOplh0; Thu, 21 Jun 2018 23:43:57 +0000 (UTC)
Received: from [172.30.42.90] (c27-253-115-14.carlnfd2.nsw.optusnet.com.au [27.253.115.14]) by zmx1.isc.org (Postfix) with ESMTPSA id E20E316003D; Thu, 21 Jun 2018 23:43:56 +0000 (UTC)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Mark Andrews <marka@isc.org>
In-Reply-To: <20180621154831.GA30653@jurassic>
Date: Fri, 22 Jun 2018 09:43:54 +1000
Cc: Daniel Salzman <daniel.salzman@nic.cz>, "dnsop@ietf.org WG" <dnsop@ietf.org>, Paul Wouters <paul@nohats.ca>
Content-Transfer-Encoding: quoted-printable
Message-Id: <17971C06-0AA5-4685-B11C-43A9D3550318@isc.org>
References: <c70f058c-8e82-f905-e352-f3e2fd0d4cfc@nic.cz> <alpine.LRH.2.21.1806201006530.6077@bofh.nohats.ca> <107c3532-a07d-9821-70ab-94c00a9dd2f0@nic.cz> <9A860D2F-C02D-4D89-B54D-7FDA9823101B@isc.org> <c4de878b-2559-cb68-a033-48ed6322a4a2@nic.cz> <20D2731B-C3DF-461D-B48D-F1CB1BC69DEE@isc.org> <20180621154831.GA30653@jurassic>
To: Mukund Sivaraman <muks@mukund.org>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/xt8pLkJkUggiA_wF_2S-z4VjxUw>
Subject: Re: [DNSOP] DNS cookies and multi-vendor anycast incompatibility
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2018 23:44:01 -0000

> On 22 Jun 2018, at 1:48 am, Mukund Sivaraman <muks@mukund.org> wrote:
> 
> On Fri, Jun 22, 2018 at 01:09:14AM +1000, Mark Andrews wrote:
>>> So how should the DNS cookies be implemented? IMHO if one server uses https://tools.ietf.org/html/rfc7873#appendix-B.1
>>> and another server uses https://tools.ietf.org/html/rfc7873#appendix-B.2, then it's not interoperable.
>>> Actually the upcoming Knot DNS 2.7 implemented "B.1" using Siphash instead of FNV. Bind probably implemented B.2.
>>> Are both implementations correct?
>> 
>> Well you are free to inspect the code to ensure that it behaves the way
>> we said it did.  The code is in lib/ns/client.c:compute_cookie.  Older
>> branches that is bin/named/client.c:compute_cookie
> 
> Mark, can you check the code in the compute_cookie() vs. RFC 7873 section B.2?
> 
> RFC 7873 says:
> 
> hash =
>           HMAC-SHA256-64( Server Secret,
>               (Client Cookie | Nonce | Time | Client IP Address) )
> 
> compute_cookie() seems to perform:
> 
>           HMAC-SHA256-64( Server Secret,
>               (Client Cookie | Nonce | Time | Client IP Address |Client Cookie) )
> 
> Both process_cookie() and ns_client_addopt() use the same
> compute_cookie() to generate and verify, so it would be hard to spot
> this.
> 
> 		Mukund

Looks like a bug.  Will remove the second Client Cookie.

-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742              INTERNET: marka@isc.org