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

Mukund Sivaraman <muks@mukund.org> Thu, 21 June 2018 15:48 UTC

Return-Path: <muks@mukund.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 30692130ED8 for <dnsop@ietfa.amsl.com>; Thu, 21 Jun 2018 08:48:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 O7zhm9Qck8G2 for <dnsop@ietfa.amsl.com>; Thu, 21 Jun 2018 08:48:39 -0700 (PDT)
Received: from mail.banu.com (mail.banu.com [IPv6:2a01:4f8:140:644b::225]) by ietfa.amsl.com (Postfix) with ESMTP id C8313130EF7 for <dnsop@ietf.org>; Thu, 21 Jun 2018 08:48:38 -0700 (PDT)
Received: from jurassic (unknown [182.156.108.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.banu.com (Postfix) with ESMTPSA id 43B7432C093F; Thu, 21 Jun 2018 15:48:35 +0000 (UTC)
Date: Thu, 21 Jun 2018 21:18:31 +0530
From: Mukund Sivaraman <muks@mukund.org>
To: Mark Andrews <marka@isc.org>
Cc: Daniel Salzman <daniel.salzman@nic.cz>, "dnsop@ietf.org WG" <dnsop@ietf.org>, Paul Wouters <paul@nohats.ca>
Message-ID: <20180621154831.GA30653@jurassic>
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>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20D2731B-C3DF-461D-B48D-F1CB1BC69DEE@isc.org>
User-Agent: Mutt/1.9.2 (2017-12-15)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/XxLvWPUL5ShNV29cvtWheJUKcwU>
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 15:48:42 -0000

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