Re: [Cfrg] Review of draft-selander-ace-cose-ecdhe-12

John Mattsson <john.mattsson@ericsson.com> Sun, 03 March 2019 11:16 UTC

Return-Path: <john.mattsson@ericsson.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3E39712D4E7 for <cfrg@ietfa.amsl.com>; Sun, 3 Mar 2019 03:16:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.301
X-Spam-Level:
X-Spam-Status: No, score=-4.301 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com header.b=eVaVxs3N; dkim=pass (1024-bit key) header.d=ericsson.com header.b=GkA1S/Yq
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 zwR0et4LFEtA for <cfrg@ietfa.amsl.com>; Sun, 3 Mar 2019 03:16:24 -0800 (PST)
Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) (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 2155612D4E6 for <cfrg@irtf.org>; Sun, 3 Mar 2019 03:16:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1551611782; x=1554203782; 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=RKIOp4dofSUnWN4KcbuVgeX5tt7ENFVpkAH1hJ4D3fU=; b=eVaVxs3NoLGTbLwgt+pWf/CgrEtr/uxWrn+nAdux+1jgHV2Mdl9VT+Dqk0bPDIeU J/a/Xh7A7GX2P+0xfU69oEypfZRkzDQgJ/fPvPPJPFDTF9awDXpZPPp9BpOdScGQ J5gNS0gqSEi3uz2pCV/HdHZEBeqtWap5UrNrqAQ6KVs=;
X-AuditID: c1b4fb2d-db5ff7000000062f-0d-5c7bb786989f
Received: from ESESBMB505.ericsson.se (Unknown_Domain [153.88.183.118]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 05.10.01583.687BB7C5; Sun, 3 Mar 2019 12:16:22 +0100 (CET)
Received: from ESESSMB503.ericsson.se (153.88.183.164) by ESESBMB505.ericsson.se (153.88.183.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Sun, 3 Mar 2019 12:16:21 +0100
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB503.ericsson.se (153.88.183.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Sun, 3 Mar 2019 12:16:21 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RKIOp4dofSUnWN4KcbuVgeX5tt7ENFVpkAH1hJ4D3fU=; b=GkA1S/YqDCQXv5Me3FcRciZ16yqbvVuW/9i0SfJKN0FvOQLKT6gFPXIoGIYVx0dTdTSY2aDSiqAuMxeaK42rpzGEyqspXtJsGBDH4Z7pEBdZXvxm6iKzI3+nSxUh556qk7k6g3a7A7SjyPLN/6itcJ8WFvv0gXkqs5DnGdQehX4=
Received: from HE1PR07MB4169.eurprd07.prod.outlook.com (20.176.166.22) by HE1PR07MB3420.eurprd07.prod.outlook.com (10.170.247.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.5; Sun, 3 Mar 2019 11:16:20 +0000
Received: from HE1PR07MB4169.eurprd07.prod.outlook.com ([fe80::49f9:ba7d:bd7d:2ffc]) by HE1PR07MB4169.eurprd07.prod.outlook.com ([fe80::49f9:ba7d:bd7d:2ffc%5]) with mapi id 15.20.1665.017; Sun, 3 Mar 2019 11:16:20 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: "Stanislav V. Smyshlyaev" <smyshsv@gmail.com>, CFRG <cfrg@irtf.org>
Thread-Topic: Review of draft-selander-ace-cose-ecdhe-12
Thread-Index: AQHU0G2VSrMNg//IoUWRedsTVYX2rqX51PYA
Date: Sun, 03 Mar 2019 11:16:20 +0000
Message-ID: <B40DE35B-54CC-4EC9-983F-7C270EFE90E5@ericsson.com>
References: <CAMr0u6=V+wwaGA=08a5=XTerXJ6k=etzPbpMAf6YME8ERynEog@mail.gmail.com>
In-Reply-To: <CAMr0u6=V+wwaGA=08a5=XTerXJ6k=etzPbpMAf6YME8ERynEog@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.16.1.190220
authentication-results: spf=none (sender IP is ) smtp.mailfrom=john.mattsson@ericsson.com;
x-originating-ip: [82.214.46.143]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 097dd1c9-700f-4c18-3086-08d69fc9a9f6
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:HE1PR07MB3420;
x-ms-traffictypediagnostic: HE1PR07MB3420:
x-ms-exchange-purlcount: 1
x-microsoft-exchange-diagnostics: 1;HE1PR07MB3420;23:lb50YLwG1rek3zg4RcZ7odyQPAS0EFiw0r5WY3GYNaiOzvjhozgFBFA6iod2OWmZj8UncJX1lGvqnbQdQ8/rGePMbAGMxKGuQqcnSIGaCfkbNmQAAIibhJupc3w+Fj3EQeJ3zYF5/9QlzOb4nK+KaDlQfoyCfile6w/6IL3HIEKwsnfK2e4Uvf2rqYiPiaCQb9UWZ9phZOIO/HNDzLERcox2H6g7f+OkJBWhGDXjPGZST6S5xVPv05neLn+QQ7jWflOuWrdS59nvQCCCisw32c9/cqx1LUO3+x1JRvwzy+Mti6IBoHXSFOe6QN/5cFEjNPDJdfc6a97c6Wnee8/z53jWR9Bno1KDBSMvCp79HxMCLdvFyO66wiy5VfkAnq7/dsDVmK4ZoN4u6dXto2V9yyOxq+wyVXnOdTnrYd7wS72+LdUeT/r0agJqWOBo16QPW7P99G4OJAv/cgpsnkGVNnygDwoecbnLuVJeToGmJvJgier88n3oNsS2XDk7SeqQQgvaL8xkGROHmwR9+E0g7SzTYdxXYJibrZKxiDaajb0qlEEOFwfpV9RUe83++cB5gza0H1yF8j0LleIShiDjxdHRJDO7CEIj1wQG0vVudgNyOh6NMgFMht68oELc+in9KRYPKysLr1gQjM+hvdFwrRECK/xHRMkM2yNKagUKVYpKxmCeLgED3dzv1PQGa7SRNW3/YWswA9w70FbeMCBhmQyXZcXbjCaXJFb3iBaVCu6x3wzc5+cmcPoopeR89as4Xhy5mLwaX8prCZrfSDp5EPiGRP88VkSJ/qinSV03+riMyWiMF5M2J7ObaTEOG1S5EEXr1DU3fJlKwZtC50WM77ggsCrqhuWwDx/olW1TFZQl4KpSTKSYgfD7jL7Z5JjhyZ+WIOIz5pY0A8KMd6+5bkWpe7NF94Qokj48zzDCf/NP9CYzNv06yb+mAtHHWka51llnu3GvT8me7Z/YDmam5HCUIPzQs9O5bwnV2xAwNjfTySVm9NxP6XuOLFGKZ0WLwA8UHtumMJVUNe/TOW5EqYBCRpqWIQOBlWj5hnGmOKWhU4TdQkZE2SdtlNBuTWIduKD1X61cruw1quVh1ylkPtugCZtOip+pg+xhqepfcq8F/O8oIpR00gJaP7FBLu05cyOJbH4/KVXdRXNqkYy6DnvpsySQMnJoyvJ75HFX0bV+Sy+ANl6A4W+EX6yybr/ur4belV+vsTalkJ8HWTovHjVB4o8WBuHVYwOEeH/ki+J/QunKyWmAxlgXhPQ6AgL9BzOZS9mYV7aDBcNU/dTXYYa+mkpxZyMoDCHMGV3K/s6DKptNAsiO71fGoTJYlEPi1VxZ1Xmrc0nDaR4m2FLm/w==
x-microsoft-antispam-prvs: <HE1PR07MB34209D577F7AFAC7E136CC5889700@HE1PR07MB3420.eurprd07.prod.outlook.com>
x-forefront-prvs: 096507C068
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(396003)(136003)(346002)(376002)(189003)(199004)(36756003)(26005)(53546011)(6246003)(99286004)(105586002)(5660300002)(106356001)(316002)(14454004)(83716004)(71190400001)(71200400001)(8676002)(76176011)(110136005)(58126008)(102836004)(2906002)(68736007)(446003)(53936002)(6506007)(81156014)(54896002)(6512007)(81166006)(11346002)(6306002)(236005)(97736004)(476003)(2616005)(229853002)(486006)(256004)(25786009)(33656002)(14444005)(966005)(66066001)(82746002)(44832011)(6116002)(6436002)(7736002)(790700001)(6486002)(3846002)(186003)(478600001)(8936002)(606006)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR07MB3420; H:HE1PR07MB4169.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: T+dqmlE73crRd3uGByNfsbgqN8eKXWGP4dk/LBOWpBgLXJY6S2R/Gm1mfZ+FKz9/HZo8NzGUwCo3ZizG/p0opYSCt3wTHsLkuhukyRy++xs7uNC33MS0zsZO0eB4OTnbtv9T9g9zZihzS/ZyF2HzM4refEBG+IJ8IeRUDr7Gh54bhWL2FF7aCDtSqyJcF3L0Ak0XRauGCd187TP3cRl+hK8rRu5pay8eUUp3yx0NZ62jTD7ai7R3Ry6mekmpn6vtXR0OIzPpAwGEytoMuC69gUnDfE2FaTPxXn/rUfuglYkzilDsmEmOUMuInhjbnw7JcGWlgYX5DRtsJm3bHUz5yU/KmWEyE1ubW0iH/1ZsIMW15Jg4it+ByG8/MfjyC94S/5818sFEBxJWjS8lxs5S4ROrCG+9nYEAO1wnyvBe0W0=
Content-Type: multipart/alternative; boundary="_000_B40DE35B54CC4EC9983F7C270EFE90E5ericssoncom_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 097dd1c9-700f-4c18-3086-08d69fc9a9f6
X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2019 11:16:20.6979 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB3420
X-OriginatorOrg: ericsson.com
X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0hTYRjHec/Ozo7DxevUfLAMHGU1cJoF+qGsJGhIF6U+iCh50oOK13ZM vBQMyguKy9TMS0tLS/OSeFnzVqLW0ExFi9IsUxqYGRVaGdWsec4Cv/3+/+f/PO/7vLy0SN4p dqVjE1NYTSITr6CkZHmIMdUz25gZ5n3ZIvbL/9lP+I1OtxOHCHVXxVuJurh1kAoiQqX7o9j4 2FRW4+UfIY252lhPJQ+VEml1HyeQFlVdIfKQHQ14H5iaVq0speX4MYK+ymmb+I4g72UNKYga AvrMb6h1QeJCERR/W0JCpYiAgupWShDzCEwL90XrkynsDfpeLbXOTvgo6BbHJHmIph2xL1iK 3ATbDwr6BsQC+0DX9F+0ziTeDpb5H/wYGT4ID5/38L4cB8GyOZfP2+FgMM3d4scjvBlWnzbx C4mwC7w2V9mWw1DbOy4S2BkW36/xvc7YCzp0c6TQGw5ZWdfFQsYdRh7V2/JuMFmVjwQ+Dt0z bfyOgKcRWB7ctB2ghPpsk0RgVxiaeCIWQk1yqKyZooRCHCy1t9katsLoShkphHIpKDGMoELk WbHh5gJHQkPPNbKCfwEHGC43W5m2+ruhpdtLiLhDSf68ROBdkHVDb2M1VOu/Ehsz1YhuQM4c y3EJ0T57VawmNpLjkhJViWxKG7L+p/6O356dqHHp8ADCNFLYyxarMsPkYiaVS08YQECLFE4y D4PVkkUx6RmsJumM5nw8yw2gLTSpcJH9kTuEyXE0k8LGsWwyq/lfJWg7Vy2SbNNkz56d7DrR GKLLCZxcOS0eD2EufjFkGV5dqn0XEBo9fjfFPtbf906geVYV0XFSOciFGn1e/PJEOcPuc6fS Phl7tM012oxw8Ye6snsek2M6S3OH8shnfZ1Z7bigws/ifKQXjgWkNewwnbu9c21TsqS0Z+RA GhO8PNPiO1VrUZBcDLNHKdJwzD9gVClHSwMAAA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/7O-UnZP59LO1YY0_tToZgdEirt0>
Subject: Re: [Cfrg] Review of draft-selander-ace-cose-ecdhe-12
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Sun, 03 Mar 2019 11:16:28 -0000

Thanks for yet another great review Stanislav!

I tried to address all your and Russ' comments in the GitHub version of the draft:

https://tools.ietf.org/rfcdiff?url1=https://tools.ietf.org/id/draft-selander-ace-cose-ecdhe.txt&url2=https://EricssonResearch.github.io/EDHOC/draft-selander-ace-cose-ecdhe.txt

- I made an issue of "Is the added complexity of "C_U : bstr / nil" worth the bytes saved"

- I also included your comments regarding algorithms and cipher suites in the existing issue "Mandatory and optional cipher suites and algorithms.

- Based on the comments from Russ (and similar offline from Karl Norrman) I renamed aad_2, aad_3 and exchange_hash to transcript hashes (TH_2, TH_3, TH_4) and added an introduction of them to the beginning of the document where it is mentioned what EDHOC adds on top of SIGMA. This naming is hopefully better and by talking about them early, they do not come as a surprise in the key derivation section.

>While the choice of the ciphersuites seems to be acceptable, it will
>inevitably be a discussion point (e.g., should we include a GCM suite or
>even a suite with an internal re-keying mechanism as a countermeasure
>against side-channel attacks? should we include a suite with P224 as a
>lightweight alternative? etc.).

Interesting suggestions. GCM is standardized by COSE and could be added at any point. Currently many constrained IoT systems have a preference for AES-CCM with 8 byte tags and some older hardware are hard coded for AES-CCM with L (called q by NIST) = 2 as that is what is used in IEEE 802.15.4. An algorithm with internal re-keying and P-224 would first have to be standardized by COSE. P-224 for EDCH and ECDSA would save a total of 24 bytes when asymmetric authentication is used and 8 bytes when symmetric authentication is used.

Somewhat related to this discussion, there are existing "issues" on GitHub discussing if it should also be possible to send cipher suites as an array of COSE algorithms without first having to register an EDHOC cipher suite, and if different AEADs could be used for EDHOC and the following application layer protocol. One could for example use AES-CCM with 128 bit tags in EDHOC and 64 bit tags in OSCORE.

> "where salt = 0x in the asymmetric case"

This is supposed to be the empty byte string. I changed this to "0x (the empty byte string)" to make it clear.

>"KID does not need to uniquely identify the PSK ..." - is this possibility
>really needed for applications of the protocol? Absence of unique
>identification of the PSK possibly leaves some potential attack surface -
>the reviewer thinks that marking this as "NOT RECOMMENDED" will be better.

I changed the text to say "It is RECOMMENDED that it uniquely identify the PSK".
The feature we would like to have is the ability to use short identifiers. In the examples
in Appendix B we use 4 byte identifiers, if assignment of the identifiers are not coordinated
there could be collisions. Do you see any problems beyond that having n symmetrical keys
with the same identifier lowers the forgery complexity of a MAC with log2(n) bits?

Cheers,
John

From: "Stanislav V. Smyshlyaev" <smyshsv@gmail.com>
Date: Friday, 1 March 2019 at 21:30
To: CFRG <cfrg@irtf.org>, John Mattsson <john.mattsson@ericsson.com>
Subject: Review of draft-selander-ace-cose-ecdhe-12

Dear colleagues,

The Crypto Review Panel members were asked to provide two reviews of this document - sending the second one.

Document: draft-selander-ace-cose-ecdhe-12
Reviewer: Stanislav Smyshlyaev
Review Date: 2019-03-01
Summary: Minor revision needed

EDHOC is an authenticated key exchange protocol intended for usage in constrained scenarios, based on deeply analyzed SIGMA-I protocol. A formal verification of (a slightly different version of) the EDHOC protocol was conducted in [1] using automatic protocol verifier ProVerif.

The formal verification paper [1] contains not only the technique and the results of the verification, but also a number of recommendations (for the version -08 of the draft). Those recommendations mostly include concerns about unprotected (or, better to say, not fully protected) data that is sent in the protocol messages during mutual authentication and key exchange.

According to the formal analysis conducted in [1], EDHOC provides the declared security properties. In general, additional security analysis of a protocol should be conducted (not only with automatic tools, but also with security proofs by reduction, with a survey of countermeasures against typical attacks on AKE protocols, etc.), but the reviewer believes that for EDHOC, being a particular case of SIGMA-I (with additional messages and with AEAD instead of MAC-then-Encrypt), it is not critical.

While the choice of the ciphersuites seems to be acceptable, it will inevitably be a discussion point (e.g., should we include a GCM suite or even a suite with an internal re-keying mechanism as a countermeasure against side-channel attacks? should we include a suite with P224 as a lightweight alternative? etc.).

The EDHOC protocol looks well-designed. Particularly, the reviewer would like to mention such solutions as CRED_x under signature, which is good to prevent DSKS-type attacks; a downgrade protection based on sending both a list of supported suites and a selected one with aad2 and aad3 messages being hashes from all previous messages (binding the communications together); KCI-attacks are inapplicable due to SIGMA-like ephemeral keys usage.

The concerns of [1] (namely, section 2.3 of [1]) has been addressed. Application data in the second message (UAD_2) is no longer encrypted, which seems to be better for overall security. Indeed, while it weakens the security properties achieved for UAD_2, they become much clearer: the problem is that the encryption of UAD_2 in -08 took place with no guarantees of confidentiality before successfully finishing the protocol - and this issue is a very subtle one, potentially leading to incorrect security assumptions from the application side and vulnerabilities of the applications relying on confidentiality of that data. Therefore, -12 completely addresses the concern outlined by [1] for -08.

Section 9.4 of the draft contains a brief outline of security considerations regarding UAD_1, UAD_2 and PAD_3, which reflects considerations given in [1]. It is important that in 4.4.3 there are explicit instructions to pass PAD_3 to an application only if (and after) verification step succeeds.

The draft looks complete except for several minor concerns listed below.

Minor concerns:
A2.3
"where salt = 0x in the asymmetric case" - a specific value of salt here seems to be forgotten

In 4.4.3 there are explicit instructions to pass PAD_3 to an application only after verification step succeeds – but it seems also reasonable to add corresponding recommendations (to finish the verification step before sending PAD_3 to the application) to 9.6 ("Implementation Considerations").

This doesn't seem to be crucial for the security, but I believe that it would be helpful to provide a comment in Section 3.3 about the reasons why PSK is used as a 'salt', not as a "secret" in HKDF.

"KID does not need to uniquely identify the PSK ..." - is this possibility really needed for applications of the protocol? Absence of unique identification of the PSK possibly leaves some potential attack surface - the reviewer thinks that marking this as "NOT RECOMMENDED" will be better.

Nits:
1.1:
"Constrained IoT systems often deals" -> "Constrained IoT systems often deal"
"Requirements on network formation time can in constrained environments" -> "Requirements on network formation time in constrained environments can "
3:
"All EDHOC messages consists" -> "All EDHOC messages consist"
3.1:
"EDHOC cipher suites consists" -> "EDHOC cipher suites consist"
3.3:
"in the in the selected" -> "in the selected"
4.1:
"ID_CRED_U and ID_CRED_V contains" -> "ID_CRED_U and ID_CRED_V contain"
"Party U and Party V MAY use different type of credentials" -> "Party U and Party V MAY use different types of credentials"
4.3.2:
"Note that protected and signature" -> "Note that 'protected' and 'signature'"
4.4.2:
"Note that protected and signature" -> "Note that 'protected' and 'signature'"


[1] https://link.springer.com/content/pdf/10.1007%2F978-3-030-04762-7_2.pdf