Re: [core] DTLS and Epochs

Jim Schaad <ietf@augustcellars.com> Thu, 08 June 2017 20:13 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C37DC127698 for <core@ietfa.amsl.com>; Thu, 8 Jun 2017 13:13:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.002
X-Spam-Level:
X-Spam-Status: No, score=-2.002 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=augustcellars.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 IUgINQLA1bRE for <core@ietfa.amsl.com>; Thu, 8 Jun 2017 13:13:02 -0700 (PDT)
Received: from mail4.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F2A10127B52 for <core@ietf.org>; Thu, 8 Jun 2017 13:13:01 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Language: en-us
DKIM-Signature: v=1; a=rsa-sha256; d=augustcellars.com; s=winery; c=simple/simple; t=1496952777; h=from:subject:to:date:message-id; bh=X6NAOBik7QWHbQMAh9jQsoHetiXIYAJtMG5pxAo/+u8=; b=iUVJZH92AZx0fx63L3NSt6gqamJhMY80DqNUFtCxvvHrZxPEomEzYFLMeIU1TumOhpSsZukvwrZ mAZPOOWCsylHRiNyhDeMGnWqLQBE9lqmu9OIOGPGwF5kFlWaXOE+2nYs3RuiY7hXyp+uHMcUNZM4p d1dmrI6SrrDlFhipYjvn3IzwonvLY65xBStBATwaJpeSUbvA+y3QEW+yshbzA3NOV9Naje+IA2K4T K/c9iv0bIb3EZztFSTN6gnYB25aCGzUxG2y/OVJOZTVwrlxaq7soCNQ9KQLkd1lmgk3EiXbOhpWl4 xuKbjhEu/NHlignMXt31gKxTQ5nZacg0r9zw==
Received: from mail2.augustcellars.com (192.168.1.201) by mail4.augustcellars.com (192.168.1.153) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 8 Jun 2017 13:12:56 -0700
Received: from Hebrews (24.21.96.37) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 8 Jun 2017 13:12:53 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: "'Kraus Achim (INST/ECS4)'" <Achim.Kraus@bosch-si.com>, 'weigengyu' <weigengyu@vip.sina.com>
CC: core@ietf.org, 'Klaus Hartke' <hartke@tzi.org>
References: <003501d2cd32$c4417a10$4cc46e30$@augustcellars.com> <CAAzbHvYb39cPMmw_S0eZ4RSwzzmcE7636tjyu=kyCbUtBOwb0g@mail.gmail.com> <005e01d2cd8f$ae548dc0$0afda940$@augustcellars.com> <BC45A96C78AE43AF896A65A184D287B5@WeiGengyuPC> <014601d2daf1$8f1865c0$ad493140$@augustcellars.com> <849AEC05-87E3-48A7-B5C6-E6B6C8DC98D5@tzi.org> <015501d2dafe$dc53e640$94fbb2c0$@augustcellars.com> <0EE7D28C4BD94A4BB8ACA70FF0182BFC@WeiGengyuPC> <000001d2db51$a7d31c30$f7795490$@augustcellars.com> <B6BE0059DC7749D6AA5621CAE49E5073@WeiGengyuPC> <000301d2db56$24df9ab0$6e9ed010$@augustcellars.com> <35046B0695F64F97ABE9E1965062E7FC@WeiGengyuPC> <83c2fca38c534509aa77241aa3105aad@FE-MBX1027.de.bosch.com>
In-Reply-To: <83c2fca38c534509aa77241aa3105aad@FE-MBX1027.de.bosch.com>
Date: Thu, 08 Jun 2017 13:12:50 -0700
Message-ID: <03a301d2e093$9ce2cf90$d6a86eb0$@augustcellars.com>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQDNpaiTKhTjOCugYu4GMFgItWlKOAHYofZfATwV17wCXqj8+gECJzwEAn/HMtwCQrMlzAJeyvcCAqXT4VwCCbk/5wJGr66GAoi8hSgBudPu9aNfWrcg
X-Originating-IP: [24.21.96.37]
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/PpUOK1vBGz3y8u0h4HnFhJtV2w4>
Subject: Re: [core] DTLS and Epochs
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 08 Jun 2017 20:13:05 -0000

Both your message and the one from Hannes that you referred to bring up some rather interesting questions.

>From my original reading of the CoAP documents, I would say that a resumption establishes both a new session and a new epoch.  The keys are different and thus it is not the same epoch.   One of the potential problems is that you can resume a new session but keep the current session so it gets slightly ambiguous about what should be done.

The idea of doing a resumption to a different address and expecting things to be the same is a very strange, but possibly correct idea.  I would agree that if you do a resumption then an Observe relationship really should be preserved.  This might imply information that needs to be placed in resumption tickets but I would need to sit down and spend some time doing thought and design before I would be willing to commit to such an approach.

Jim


-----Original Message-----
From: Kraus Achim (INST/ECS4) [mailto:Achim.Kraus@bosch-si.com] 
Sent: Thursday, June 8, 2017 1:18 AM
To: weigengyu <weigengyu@vip.sina.com>
Cc: core@ietf.org; 'Klaus Hartke' <hartke@tzi.org>; Jim Schaad <ietf@augustcellars.com>
Subject: RE: [core] DTLS and Epochs

Hi all,

> Reviewing Cf. CoAP's source code, it becomes clear that the CoAP entity would read the DTLS epoch when it starts sending messages.

Scandium (java DTLS implementation, subproject in californium, java CoAP implementation) was implemented to be used  for CoAP, therefore it was extended to check the epoch. But, if the (D)TLS implementation doesn't provide this information, you can't check it. That's the issue others got aware.

And there is still a pitfall: you can only check the epoch number! So currently, if an initial DTLS handshake is finished you get a session ID (say S12345), a selected ciphersuite (say CS_XYZ), and the epoch (with number 1). A new handshake would get a new session ID (S6789) and could be detected. But for a resuming handshake, this will end-up in the same session ID and same epoch-number. 

It's still unclear to me, if this should be considered to be the "same epoch" in the meaning of RFC7252.   

I pointed to that last summer (https://www.ietf.org/mail-archive/web/core/current/msg07816.html) but I could get clarification on that.

Mit freundlichen Grüßen / Best regards

 Achim Kraus

(INST/ECS4) 
Bosch Software Innovations GmbH | Stuttgarter Straße 130 | 71332 Waiblingen | GERMANY | www.bosch-si.com

Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B 
Geschäftsführung: Dr.-Ing. Rainer Kallenbach, Michael Hahn 



-----Original Message-----
From: core [mailto:core-bounces@ietf.org] On Behalf Of weigengyu
Sent: Montag, 5. Juni 2017 13:54
To: Jim Schaad <ietf@augustcellars.com>
Cc: core@ietf.org; 'Klaus Hartke' <hartke@tzi.org>
Subject: Re: [core] DTLS and Epochs


Hi Jim,

I present our opinions about epoch changes.
In weekend we (my studens: Mr. Haihai REN and Jiantong LI) reviewed the source code of Cf. CoAP and RFC7252 9.1.

Based on the text of RFC7252 and the layered protocol concepts, it may be a problem to tie the CoAP message with DTLS epoch, as you pointed.
It may be a problem how the CoAP entity knows the DTLS epoch changes.

But, such a problem has never be happened in our previous works. Why?
Reviewing Cf. CoAP's source code, it becomes clear that the CoAP entity would read the DTLS epoch when it starts sending messages.
In this specific implementation, the CoAP entity has the ability to read DTLS epoch of another object which is a variable of another layer in protocol concepts.

In Cf.CoAP source code, when the CoAP entity needs to send messages, it invokes the DTLS entity to work, i.e. to do server and client authentifications; then the client sends ChangeChipherSpec, and server' Finish, the DTLS's epoch change. Actually the epoch is plus one.
Then the CoAP entity would get DTLS epoch and begin to send CoAP messages over DTLS Record.
It is clear that the CoAP entity could get the new epoch in Cf. CoAP.

It is known that Cf. CoAP is a specific implementation in which getting epoch is not a tough work.
It seems that it is not a critical matter in software implementation as in protocol concept.

Probably, statements in RFC7252 should be clear enough to tell that the CoAP getting DTLS epoch is a cross-layer operation.

Regards,

Gengyu WEI
Network Technology Center
School of Computer
Beijing University of Posts and Telecommunications
-----原始邮件-----
From: Jim Schaad
Sent: Friday, June 02, 2017 12:10 PM
To: 'weigengyu'
Cc: 'Klaus Hartke' ; core@ietf.org
Subject: RE: [core] DTLS and Epochs


My intention is to get rid of the requirement since it makes no sense.  That 
is what the message I sent to Carsten was about.  What is the best process 
for doing so.

Jim



-----Original Message-----
From: weigengyu [mailto:weigengyu@bupt.edu.cn]
Sent: Thursday, June 1, 2017 8:58 PM
To: Jim Schaad <ietf@augustcellars.com>; 'Carsten Bormann' <cabo@tzi.org>
Cc: 'Klaus Hartke' <hartke@tzi.org>; core@ietf.org
Subject: Re: [core] DTLS and Epochs

Hi Jim,

Thank you for your explainations.

> Section 9.1.1 of RFC 7252 in paragraph 2 has the unfortunate
> requirement that all messages MUST be responded to using the epoch value.

It is really unfortunate requirements that the application protocol is 
forced to be tied with the lower-layer variable.
Is there an intension to creat a cross-layer mechanim?

Regards,

Gengyu WEI
Network Technology Center
School of Computer
Beijing University of Posts and Telecommunications
-----原始邮件-----
From: Jim Schaad
Sent: Friday, June 02, 2017 11:38 AM
To: 'weigengyu' ; 'Carsten Bormann'
Cc: 'Klaus Hartke' ; core@ietf.org
Subject: RE: [core] DTLS and Epochs

Section 9.1.1 of RFC 7252 in paragraph 2 has the unfortunate requirement 
that all messages MUST be responded to using the epoch value.  Without the 
knowledge that the epoch value has changed this is not enforceable on either 
end.

-----Original Message-----
From: weigengyu [mailto:weigengyu@bupt.edu.cn]
Sent: Thursday, June 1, 2017 5:27 PM
To: Jim Schaad <ietf@augustcellars.com>; 'Carsten Bormann' <cabo@tzi.org>
Cc: 'Klaus Hartke' <hartke@tzi.org>; core@ietf.org
Subject: Re: [core] DTLS and Epochs

Hi,

> Please note - I did not say that the epoch was not changed, I said
> that it does not tell me that the epoch has changed.
> From a strictly security point of view there is no reason to do so if,
> for example, the epoch changed just because the key was rolled over.

Why the epoch changed event must tell "me", i.e. the upper layer entity?

Regards,

Gengyu WEI
Network Technology Center
School of Computer
Beijing University of Posts and Telecommunications
-----原始邮件-----
From: Jim Schaad
Sent: Friday, June 02, 2017 1:45 AM
To: 'Carsten Bormann'
Cc: 'weigengyu' ; 'Klaus Hartke' ; core@ietf.org
Subject: RE: [core] DTLS and Epochs



-----Original Message-----
From: Carsten Bormann [mailto:cabo@tzi.org]
Sent: Thursday, June 1, 2017 9:36 AM
To: Jim Schaad <ietf@augustcellars.com>
Cc: weigengyu <weigengyu@bupt.edu.cn>; Klaus Hartke <hartke@tzi.org>; 
core@ietf.org
Subject: Re: [core] DTLS and Epochs

On Jun 1, 2017, at 18:10, Jim Schaad <ietf@augustcellars.com> wrote:
>
> Please note - I did not say that the epoch was not changed, I said
> that it does not tell me that the epoch has changed.  From a strictly
> security point of view there is no reason to do so if, for example,
> the epoch changed just because the key was rolled over.

Right, and the question for me is:  How do we get from the overly 
restrictive spec in 7252 to something that is still secure and can be 
supported by TLS libraries that are out there.

[JLS] I believe that the only way is to do an update to 7252.  I originally 
thought that I would file an errata, but I do not believe that is a correct 
use of the errata system.  It is used for things which are unclear or 
technically wrong.  This is not wrong, just misguided. It might be easiest 
to just do a delta RFC unless there is a good number of errata that need to 
be rolled into an updated document.

Jim


Grüße, Carsten





_______________________________________________
core mailing list
core@ietf.org
https://www.ietf.org/mailman/listinfo/core