Re: [babel] WG adoption call for draft-do-babel-hmac (7/19 - 8/6)

Markus Stenberg <markus.stenberg@iki.fi> Sun, 29 July 2018 06:08 UTC

Return-Path: <fingon@kapsi.fi>
X-Original-To: babel@ietfa.amsl.com
Delivered-To: babel@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E0277130E6F for <babel@ietfa.amsl.com>; Sat, 28 Jul 2018 23:08:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.351
X-Spam-Level:
X-Spam-Status: No, score=-2.351 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=kapsi.fi
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 pPpoPbWJXUVK for <babel@ietfa.amsl.com>; Sat, 28 Jul 2018 23:08:24 -0700 (PDT)
Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) (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 0EC32130E27 for <babel@ietf.org>; Sat, 28 Jul 2018 23:08:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Content-Type:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=bH6H35fzEa3olyrEIMGoQ4MF0JOij3mElZYfWzVYlOE=; b=wdkWvOhpX4pCOU+MkKBXWpfQL/ CiwTCAS50fKZF/yA4pwMjKwYBWhIIODFRx/wRpHTFhQTMzLncoH4zHAddIZtkZtvt+yVIXzzAEZ8t ZgD0Lv9SmCbOWdTwljm5cDiapsq3m0jlsCYfCQB/RwjJ39ziO4YRFEf8WKW2nMC+/AmBXZR/4mYN2 bJXtzsFrZs6BzYfLF/rrZXldrDMbtuG5Arcu8isHKtveQvfDJXQZGlmSmA47hsmLm2QnCL+xaKv6j HwtWjU0kKsoEF7lUDJLUdFVrvz0b25PHfDHhjTtLEbTKovfddhsJRWhpgVaUNvPx+vfKDqOiDxjDs fC7qqroQ==;
Received: from 91-155-69-202.elisa-laajakaista.fi ([91.155.69.202] helo=poro.lan) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <markus.stenberg@iki.fi>) id 1fjesM-0005qE-Mk; Sun, 29 Jul 2018 09:08:18 +0300
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Markus Stenberg <markus.stenberg@iki.fi>
In-Reply-To: <87muubhszo.wl-jch@irif.fr>
Date: Sun, 29 Jul 2018 09:08:17 +0300
Cc: Donald Eastlake <d3e3e3@gmail.com>, Babel at IETF <babel@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <7432C9DE-664D-4264-B862-0BD4459DA82B@iki.fi>
References: <CAF4+nEEubyH7dHmPpdO3P-G-ma3GtVynpGm6=iy_44Ef5wCM_w@mail.gmail.com> <C94064CD-72E9-4D16-AFFE-9F744D5AD409@iki.fi> <87muubhszo.wl-jch@irif.fr>
To: Juliusz Chroboczek <jch@irif.fr>
X-Mailer: Apple Mail (2.3445.9.1)
X-SA-Exim-Connect-IP: 91.155.69.202
X-SA-Exim-Mail-From: markus.stenberg@iki.fi
X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false
Archived-At: <https://mailarchive.ietf.org/arch/msg/babel/GVQADi3RRUiZsrfOtKecyysrQRM>
Subject: Re: [babel] WG adoption call for draft-do-babel-hmac (7/19 - 8/6)
X-BeenThere: babel@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: "A list for discussion of the Babel Routing Protocol." <babel.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/babel>, <mailto:babel-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/babel/>
List-Post: <mailto:babel@ietf.org>
List-Help: <mailto:babel-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/babel>, <mailto:babel-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 29 Jul 2018 06:08:27 -0000

On 29 Jul 2018, at 1.53, Juliusz Chroboczek <jch@irif.fr> wrote:
>   Whenever B resets its PC, or whenever B doesn't know whether
>>   its PC has been reset, it picks an index that it has never used
>>   before (either by drawing it randomly or by using a reliable hardware
>>   clock) and starts sending PCs with that index.
> 
>> I think there are 3 potential sources for index:
> 
>> - nvram/flash (truly unique, frequently but not always available)
>> - magic timestamp (e.g. GPS, magical secure NTP might give us ~unique timestamp, or RTC that never goes backward for this purpose.. but typical routers do not have strictly monotonic hardware clocks the text notes)
>> - something pseudorandom that has sufficiently low collision likelihood given the number of bits of index
> 
>> so I think the text (and some of the following) is slightly
>> optimistic. I would probably just settle for a sufficiently low
>> collision chance.
> So I just need to add "likely", as in "likely not used before"?  Or are
> you suggesting something more?

Nah, just wording changes here and there (there are few places that assume the options 1/2 which are not realistic always).

>> Also, I would like to have byte(/few bits) somewhere indicating the
>> algorithm used for HMAC. Maybe I’m just tired and can’t see one that is
>> already there.
> 
> There's none.  The procedure is:
> 
>  - receiver computes HMAC for each algo/key pair it has been provisioned with;
>  - it does a bytewise comparison of the result of each key computation
>    with each HMAC computed in the packet.
> 
> So the receiver doesn't need to know the algorithm used by the sender --
> it only needs to know which algorithm is associated to each of the keys it
> has been provisioned with.
> 
> Am I missing something?  What purpose would adding info about the
> algorithm to the on-the-wire HMAC serve?

Ah, nevermind, I was still in the mindset with the key id actually on the wire (that’s what I get for rereading drafts at night). Without it, as I reread section 4.3, algorithm does not have to be either. So it is fine as it stands.

That said, this design leads to N times more efficient CPU DOS (non-accelerated SHA256 on slow CPU times MTU worth of HMACs = quite a lot of computation on low-end devices). Then again, I am not sure it really matters (and implementation can constrain that as they want to anyway).

Cheers,

-Markus