Re: [babel] Solving HMAC replay once and for all
David Schinazi <dschinazi@apple.com> Wed, 27 June 2018 23:16 UTC
Return-Path: <dschinazi@apple.com>
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 04024130E3B for <babel@ietfa.amsl.com>; Wed, 27 Jun 2018 16:16:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.311
X-Spam-Level:
X-Spam-Status: No, score=-4.311 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=apple.com
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 c0qj9-6LNBgo for <babel@ietfa.amsl.com>; Wed, 27 Jun 2018 16:16:55 -0700 (PDT)
Received: from mail-in5.apple.com (mail-out5.apple.com [17.151.62.27]) (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 7A987130E39 for <babel@ietf.org>; Wed, 27 Jun 2018 16:16:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1530141415; x=2394055015; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5juJ72BfJ7gETcV7MjYlqn7M8fUPcaqoVm2kCby2snQ=; b=aX5RMCzRWvWWCuXeDVtY9viCrtSOM5u9Af4VatbMMBtct7KzOiuoG/lzviCPYUyT t+c/xqozppvu/BTsEsOVYlXB62YjhN1UjClU+fH/mp7fPgMSMJNzqi1kJQ7vMeWo qsvyGYmPGELVVL6HQKLV8mbPX53p7BqA7uYW1lfwEkJFoffYtBpPDXSZm/dCrXLf lrISJrQapcwfm5krxABhZJjiszM3gFKQslIqCIHtWwWS+GFen9xOSGos+0f5U07Y LiIc6VLbaVe2twTK2XPCs+WLlsPPXL64myPLGWU9S79u8cew5/52QH+EO1u4iBHl H3aUw1UVYcy8ccADtGOf6Q==;
Received: from relay1.euro.apple.com (relay1.euro.apple.com [17.66.55.11]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in5.apple.com (Apple Secure Mail Relay) with SMTP id 23.7E.09260.6EA143B5; Wed, 27 Jun 2018 16:16:55 -0700 (PDT)
X-AuditID: 11973e13-615ff7000000242c-f6-5b341ae57581
Received: from crk-mmpp-sz04.euro.apple.com (crk-mmpp-sz04.euro.apple.com [17.66.12.168]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by relay1.euro.apple.com (Symantec Mail Security) with SMTP id A7.03.23007.4EA143B5; Thu, 28 Jun 2018 00:16:52 +0100 (BST)
Received: from [17.192.155.180] by crk-mmpp-sz04.euro.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPSA id <0PB0008478O13T80@crk-mmpp-sz04.euro.apple.com>; Thu, 28 Jun 2018 00:16:52 +0100 (IST)
Sender: dschinazi@apple.com
Content-type: text/plain; charset="us-ascii"
MIME-version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: David Schinazi <dschinazi@apple.com>
In-reply-to: <87fu17an1y.wl-jch@irif.fr>
Date: Wed, 27 Jun 2018 16:16:48 -0700
Cc: Markus Stenberg <markus.stenberg@iki.fi>, babel@ietf.org
Content-transfer-encoding: quoted-printable
Message-id: <6CE390DB-EE38-4D62-B56A-A451A02FE723@apple.com>
References: <87muvgh08w.wl-jch@irif.fr> <B79AE9F0-772A-4068-86CF-942ED6B8C5DF@iki.fi> <87k1qkgys1.wl-jch@irif.fr> <572D5E74-BE2D-4CD7-BCF4-4BD008D597AD@iki.fi> <87fu18gw9r.wl-jch@irif.fr> <3EEA555D-F75C-4FD4-BFD5-4344E5EEAEEA@apple.com> <87po0b52vx.wl-jch@irif.fr> <AD5721CC-523E-4582-A612-13464B0F27F6@apple.com> <87in63an71.wl-jch@irif.fr> <87fu17an1y.wl-jch@irif.fr>
To: Juliusz Chroboczek <jch@irif.fr>
X-Mailer: Apple Mail (2.3445.9.1)
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsUi6GTOrftcyiTa4PoyPosti7pZLOa3LmOz 2Dt3BYsDs8eSJT+ZPA5/XcjisXjLW8YA5igum5TUnMyy1CJ9uwSujLbHt1gKrotVnN+xiL2B sUWoi5GTQ0LAROLuxI8sXYxcHEICm5kkrpx4xwqTuNE2mxUicYRJYvXMJiYIp4FJ4n3PNkaQ KmEBaYmuC3fBOpgFtCTW7zzOBGLzChhLrN+8kBWixlLi3sxFzF2MHBxsQDUH1hiBhDkFNCTO 71jIDGKzCKhKtM0/wQQxxkbi34QWZghbW+LJuwusECNtJCb+mg516W8midcPLrGAJEQEVCSW T3vGDnG1okT/mkNsEPYMNokTfVITGIVnITlvFpLzZiHZsYCReRWjUG5iZo5uZp6pXmJBQU6q XnJ+7iZGUMBPtxPewXh6ldUhRgEORiUe3hU9xtFCrIllxZW5hxilOViUxHk7xEyihQTSE0tS s1NTC1KL4otKc1KLDzEycXBKNTDuWzsn8dSzl8tk2rN6u082SgocSw00r1K/Nb2mLcno8O4Z i+X35jB0X3VXCeMymTgnlq0nbuGWndsS5dYIuevW+854HXDnnIbNRxkvhXvvWpgM95ff0Puu cnVOyqR9888ufHhuyiRuaeUdBub3rNdNKX35cLvKbK77iWe22opcenumOKC9eIGjEktxRqKh FnNRcSIAPPlCL1kCAAA=
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsUi6MSzQveJlEm0wfEnRhZbFnWzWMxvXcZm sXfuChYHZo8lS34yeRz+upDFY/GWt4wBzFFcNimpOZllqUX6dglcGW2Pb7EUXBerOL9jEXsD Y4tQFyMnh4SAicSNttmsXYxcHEICR5gkVs9sYoJwGpgk3vdsYwSpEhaQlui6cJcVxGYW0JJY v/M4E4jNK2AssX7zQlaIGkuJezMXMXcxcnCwAdUcWGMEEuYU0JA4v2MhM4jNIqAq0Tb/BBPE GBuJfxNamCFsbYkn7y6wQoy0kZj4azoLxA2/mSReP7jEApIQEVCRWD7tGTvE1YoS/WsOsU1g FJiF5KRZSE6ahWTuAkbmVYyiRak5iZWGeqmlRfl6iQUFOal6yfm5mxjBwWrOvYPx+G7DQ4wC HIxKPLxGb4yjhVgTy4orcw8xSnAwK4nwStwHCvGmJFZWpRblxxeV5qQWH2KU5mBREuedrMQc LSSQnliSmp2aWpBaBJNl4uCUamCUfrW8wr123iK+6bl1Fzwvn3jfy3Xi4IEiN47ylGvyq/Nb RUt+tkx4vnH23d8q4aEeby/dqq3PmvjH31mCbd1K3g2Z3patOtcKPIUnGspfKY5Wa/dJerGT dc75hPQJj0uZDgfZJmcdT09NOX/p2vfXNy/JPYm6EW5rs1V12/Pri5Xk498t3CeqxFKckWio xVxUnAgAzK7H+lICAAA=
Archived-At: <https://mailarchive.ietf.org/arch/msg/babel/OdeaPFN0VQLo8NSHFOUAUyd_QbE>
Subject: Re: [babel] Solving HMAC replay once and for all
X-BeenThere: babel@ietf.org
X-Mailman-Version: 2.1.26
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: Wed, 27 Jun 2018 23:16:57 -0000
> On Jun 27, 2018, at 15:20, Juliusz Chroboczek <jch@irif.fr> wrote: > >>> Basically this breaks the property that "any packet without a valid HMAC is >>> silently ignored" and that worries me, as it was a good property to have. > >> Good point, noted. > > So: > > Property D: a packet is silently ignored after an HMAC failure, > > and > > Property M: nonces are not carried in every packet. > > are both good properties to have. Can we have both? I think so, yes. Straw man proposal: We add two new TLVs: ChallengeRequest and ChallengeResponse, which MUST be sent unicast. Those TLVs are allowed to be parsed if the HMAC validates but the counter does not. Alice is the receiver. Alice maintains a per-neighbour table of counters. When Alice receives a packet from Bob: - if HMAC does not validate, Alice drops bob's packet silently - else if Alice has counter information about Bob, and the counter is in [savedCounter + 1, savedCounter + 256], the packet is accepted and Alice sets savedCounter(Bob) to the counter from the packet; - else (Alice has no counter information about Bob or Alice has counter information about Bob and the counter is outside of that range), Alice parses Challenge TLVs, silently ignores any non-Challenge TLVs in Bob's packet and sends a challenge (with rate limiting) Only the challenges contain an arbitrary-length opaque nonce. The counter should be 48 or 64 bytes long. - Devices who believe they have reliable monotonically increasing clocks can use their time as a counter - Devices that can save their counter to disk start at zero and increase for each packet send - Devices that have neither start off with a random counter then increment by one for the duration of this boot. The security for those devices depends on how much entropy they have in the high order bits of their initial random counter value. This proposal has Properties D and M, and also Property S: if Alice and Bob do not have clocks or storage and they reboot at the same time, they are still secure as long as there are enough bits of entropy in the high order bits of their initial counters to ensure that those won't intersect with values they previously chose. Property R: If something goes wrong (reliable clocks aren't, etc.) devices are able to reestablish communication after 1RTT Conceptually this is similar to treating the high order bits of the counter as a nonce in cases where you do not have a clock or storage. So I guess for those devices property M is somewhat not quite guaranteed-ish... Also, to handle reordering we can have a replay window similar to IPsec/ESP where Alice keeps a bit mask of packets received in [savedCounter - 256, savedCounter - 1] to allow receiving out of order packets in that range. David
- [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all David Schinazi
- Re: [babel] Solving HMAC replay once and for all Toke Høiland-Jørgensen
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all David Schinazi
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all David Schinazi
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all David Schinazi
- Re: [babel] Solving HMAC replay once and for all David Schinazi
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all David Schinazi
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all STARK, BARBARA H
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Ted Lemon
- Re: [babel] Solving HMAC replay once and for all Toke Høiland-Jørgensen
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Toke Høiland-Jørgensen
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Markus Stenberg
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Juliusz Chroboczek
- Re: [babel] Solving HMAC replay once and for all Toke Høiland-Jørgensen