Re: [Gen-art] [6tisch] Review of draft-ietf-6tisch-minimal-17

Tero Kivinen <kivinen@iki.fi> Mon, 09 January 2017 15:40 UTC

Return-Path: <kivinen@iki.fi>
X-Original-To: gen-art@ietfa.amsl.com
Delivered-To: gen-art@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A4E821294CF; Mon, 9 Jan 2017 07:40:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.778
X-Spam-Level:
X-Spam-Status: No, score=0.778 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, SPF_NEUTRAL=0.779] autolearn=no 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 YREAF1EhJPgK; Mon, 9 Jan 2017 07:40:14 -0800 (PST)
Received: from mail.kivinen.iki.fi (fireball.acr.fi [83.145.195.1]) (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 2C6CA1293FC; Mon, 9 Jan 2017 07:40:13 -0800 (PST)
Received: from fireball.acr.fi (localhost [127.0.0.1]) by mail.kivinen.iki.fi (8.15.2/8.15.2) with ESMTPS id v09Fe3ZO016356 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Jan 2017 17:40:03 +0200 (EET)
Received: (from kivinen@localhost) by fireball.acr.fi (8.15.2/8.14.8/Submit) id v09Fe1Zh003374; Mon, 9 Jan 2017 17:40:01 +0200 (EET)
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Message-ID: <22643.44753.425899.255628@fireball.acr.fi>
Date: Mon, 09 Jan 2017 17:40:01 +0200
From: Tero Kivinen <kivinen@iki.fi>
To: pister@eecs.berkeley.edu
In-Reply-To: <CALb6MQVSk6W6vW5rC1pd8F9rsoCayKoDJEtUtbfem6uDsbpa2Q@mail.gmail.com>
References: <148140959184.3857.2236566242217564901.idtracker@ietfa.amsl.com> <CADJ9OA8vju=Y13u8EtfsrpT0Kcaf4X-TWzmgfJ=oKkWo+pdxWw@mail.gmail.com> <CADJ9OA_q391_4thKKsXnTQw1gyS3vp+8-CRPUwDqqCzoNKZMDQ@mail.gmail.com> <3b1ec831-33b1-91ee-d380-1315cb7a3f81@gmail.com> <22638.28317.918545.716649@fireball.acr.fi> <CALb6MQVSk6W6vW5rC1pd8F9rsoCayKoDJEtUtbfem6uDsbpa2Q@mail.gmail.com>
X-Mailer: VM 8.2.0b under 25.1.1 (x86_64--netbsd)
X-Edit-Time: 30 min
X-Total-Time: 30 min
Archived-At: <https://mailarchive.ietf.org/arch/msg/gen-art/CIz7_-ZcDwmpZx1lEKE4zBHDWaI>
Cc: "6tisch@ietf.org" <6tisch@ietf.org>, gen-art@ietf.org, Thomas Watteyne <thomas.watteyne@inria.fr>, draft-ietf-6tisch-minimal.all@ietf.org
Subject: Re: [Gen-art] [6tisch] Review of draft-ietf-6tisch-minimal-17
X-BeenThere: gen-art@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "GEN-ART: General Area Review Team" <gen-art.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/gen-art>, <mailto:gen-art-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/gen-art/>
List-Post: <mailto:gen-art@ietf.org>
List-Help: <mailto:gen-art-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/gen-art>, <mailto:gen-art-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Jan 2017 15:40:16 -0000

Kristofer PISTER writes:
> Tero - you bring up a good point that after all of the discussion of
> this issue we have still not done a good job explaining it, since
> it's clear that there are still misunderstandings.

Clearly. 

> The text in section 4.6 says "This specification assumes the
> existence of two cryptographic keys." That is incorrect, and should
> be changed.  I propose "This specification assumes the existence of
> one protocol identifier, P1, and one cryptographic key K2.  P1
> provides no security."

I do not undestand why you want to throw away the protection K1 can
provide?

If you have two cryptographic keys, K1 and K2, they both will provide
protection against different types of attack. K1 makes sure that
no outsider who does not know K1 can create fake EBs. This means that
sleeping nodes waking up and wanting to resync themself to the
network, which has not changed its K1 during the nodes sleep, can do
so by just seeing K1 protected EB.

It also means that there is at least some protection for the devices
already in the network against malicious EBs which could try to change
the network parameters of the network.

If K1 is not secret, then both of these protections are lost.

K2 is used to provide confidentiality and authenticity of the other
messages than EBs.

There is actually no reason why K1 and K2 needs to be separate, but
both of them needs be secret and unique.

> Let me go over the reasoning behind having P1.  Any implementation
> of 6TiSCH has one of
> three choices for message integrity on the EBs:
> 1) use no message integrity
> 2) use a well-known protocol identifiier, with no security value
> 3) use a secret key

And only option 3 makes any sense if any security is needed. If you
are willing to run network without any security you can then go with
option 1 and 2, but don't use them if you want security. 

> There is ample evidence that sending 15.4 frames without message
> integrity is problematic, so we'd prefer not to do option 1.

I think most of that evidence is based on the 802.15.4 frames and not
802.15.4-2015 EB frames with TSCH related IEs.

Yes, getting random garbage looking like 11-21 byte beacon frame with
valid checksum is going to happen every now and then.

Having random garbage with length 48 bytes to match EB with acceptable
TSCH related IEs is much more improbable.

As joining process is only very small amount of the use of the
network, we should not try to optimize the performance during joining
process, and sacrifice the security of the rest of the network use
time.

After the joining process is done, the node knows K1, and then it can
get much better protection against random garbage.

> Option 2 provides no security, but it does provide message
> integrity, and it provides some level of confidence that the sender
> of the frame is using the same version of the protocol that the
> receiver is using.

Yes, it does provide that for the joining process, but sacrifices the
security of the rest of the time, i.e., after the node has joined the
network.

Also option 2 only causes issues for the nodes trying to join the
network. I.e., they might try to join network they think are there,
because they see random garbage that looks like valid EB. So what.
They waste a bit of resources there, but if they see valid EB they can
pick that. Also easy solution to that is to wait for two valid EBs
from the same coordinator before trying to join. I.e., when node sees
first EB, they will know where the next EB can be, so they can jump to
that channel to listen for it and so on on until it finds second copy
of the same EB. After that they can be sure that there is network
there.

They still do not know if that network is correct for them to join in,
but using option 2 does not provide that information either. It only
tells that there is some (or multiple) networks using same P1. And if
we put P1 in the RFC everybody will be using that same P1.

> Option 3 provides all of the benefits of option 2, plus some level
> of security.  It is a fine option, but it assumes the existence of a
> pre-distributed cryptographic key K1, which is a non-starter.

No, it does require pre-distributed cryptographic K1.

It requires clients to join the network without knowing K1, and after
they have joined the network they will learn the K1 and K2, and after
that they can start using K1 and K2 to secure the traffic in the
network.

The 802.15.4 do provide a way for nodes to parse EBs and join the
networks WITHOUT knowing the key used to protect the EB.

Also even if you do know K1, you still cannot use that to protect the
first EB. The first EB contains the ASN, which is needed to validate
the EB, and before the ASN can be read from the IE contained in the
EB, the EB frame needs to be authenticated, which is not possible as
the ASN is not known... I.e., chicken and egg problem.

Because of this the 802.15.4 do allow EBs to be passed higher layer
even if their security processing failed (either because of not
knowing the key to protect it, or not knowing the ASN used to
calculate Nonce). So the higher layer can then take the ASN out from
there, configure that to the MAC layer, and send some unprotected
joining messages to the coordinator, asking to join the network, and
the coordinators are using the SecExempt flag to allow those joining
nodes to bypass the security checks for the incoming traffic for those
joining messages so those messages can be processed in clear tetx even
when everything else is mandated to be protected.

So to repeat this one more time:

Using known K1 or P1 or whatever it is called, is BAD idea, and it is
better to use unique K1, which is distributed to the network at the
same time as K2 is generated for the network nodes. 
-- 
kivinen@iki.fi