Re: [Lake] Computational EDHOC analysis - Some early comments and questions

Göran Selander <goran.selander@ericsson.com> Thu, 14 April 2022 15:00 UTC

Return-Path: <goran.selander@ericsson.com>
X-Original-To: lake@ietfa.amsl.com
Delivered-To: lake@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 738C73A07A9 for <lake@ietfa.amsl.com>; Thu, 14 Apr 2022 08:00:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.11
X-Spam-Level:
X-Spam-Status: No, score=-2.11 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, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.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 NBYdK-p23O-X for <lake@ietfa.amsl.com>; Thu, 14 Apr 2022 08:00:30 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::62a]) (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 0D5263A07BA for <lake@ietf.org>; Thu, 14 Apr 2022 08:00:29 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bQqsITmCPlYUiazpkurREaWV/KXVZRjZRXMfqB1XbF46/2PfdHv6r6Jo3fr6elhg+WAtsuwiBbZKTojLE9i6NNURDu1uYf4ldpHiOMy+2FnT0281sLRyT5DQTsxBwBuYziv5boN449FwJKGBS74VSUgBkvrLKWfxhpETC71cZthLYDSZrPUq1Dqfa3KlwFtvxvtvfMm+jKIHqBXMr0JLlLbgmKyt7imwPhc34Sb9NHXqz72n1ymzh6Ne4vYhQIIY3v8l/dJ57HHBpJWDEo1ABTw7Oat0YwMA5248ttc1nBQav8Y+xPPQ5ziz2ZGDc7IKmdh/oHMS9cpekWQpg+RdSg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UR/9Um3sZMUO3qqWQWRjedmA7VP1+dms+rd4IG7qrBk=; b=hTVymuLVHH3vhc9HW7f4h/OSEVB0kkixy+IEX5XteVXJSHbWj3TBHBp2Kw9cvAe1YbvpU854K9U1+Ek+CI8mEm3KqCndgQGlXel5nf1yuiJkWK5md9YNSPHKtL/r592JBSrAF9SCDNS2ZcgUS+bA3mBxEck+Yh3zKLDtxlbfiRN9DDoxJATotzcCJ6NFSI0JEBVEFKWGPWOYs6XsLCLbJaM0geFRNAA7el53BLK3ggM3N6aI2jb3CYjTpkeHCayYjgUonue+cnyp1U4ZfFrkMNsBjRkXaug0ZDl/AFWN0FXD2pOwFifzSrrzLHbfiW64bJX+FQ6OzMCVl9Fi0yEztg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
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=UR/9Um3sZMUO3qqWQWRjedmA7VP1+dms+rd4IG7qrBk=; b=cS85/XjAyUj5abuwaf28iHWCcflnZxhJ94N8wN/SKfXEh6xswnP9cehrqNADjqG3/Y/Wjb1wT73Wuum7ed/LtfQFW3RJJy3AF39s0uXwtR4Zo1NRfjdcRPKQb3rRiNk5EtTxwtXX8H5toM+61vkstfCHrwSQvl4VtXNtdP88Nwk=
Received: from AM4PR0701MB2195.eurprd07.prod.outlook.com (2603:10a6:200:45::6) by AM6PR07MB5976.eurprd07.prod.outlook.com (2603:10a6:20b:95::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Thu, 14 Apr 2022 15:00:20 +0000
Received: from AM4PR0701MB2195.eurprd07.prod.outlook.com ([fe80::a063:817:8692:11cd]) by AM4PR0701MB2195.eurprd07.prod.outlook.com ([fe80::a063:817:8692:11cd%4]) with mapi id 15.20.5164.019; Thu, 14 Apr 2022 15:00:20 +0000
From: Göran Selander <goran.selander@ericsson.com>
To: Ilunga Tshibumbu Mukendi Marc <marcilu@student.ethz.ch>, "lake@ietf.org" <lake@ietf.org>
CC: "mail@felixguenther.info" <mail@felixguenther.info>
Thread-Topic: [Lake] Computational EDHOC analysis - Some early comments and questions
Thread-Index: AQHYT/6jcnV/0NzlaEey/mFKRc3o/Q==
Date: Thu, 14 Apr 2022 15:00:20 +0000
Message-ID: <1E9AA72B-DF0C-4C92-B4A1-98704CE543C7@ericsson.com>
Accept-Language: en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/16.59.22031300
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ericsson.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: e6a5d005-6269-4d4b-5ced-08da1e277ea0
x-ms-traffictypediagnostic: AM6PR07MB5976:EE_
x-microsoft-antispam-prvs: <AM6PR07MB5976ED3871BF855E1841CC80F4EF9@AM6PR07MB5976.eurprd07.prod.outlook.com>
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: taDKUtyCBPLDEaj+Ph2SitCJVxhHQmjn0r5Rj7OBDSzdDdkBtjU/1k5V8X0GwaKUr910EoGu57u6MtGC2pzgsiKgidWZULxu4087JyJx/CZm1jvCTl9PlyxakLYo20avxe2hYzDWWVsq0YIbHDNtVincVjN3DrOKEmyXHW+lPgYmiAUaJg/g1RzkH12oH453vkVPIgr8fO+FkLx+KjUuZyB0FiVuiHJkS+sEf5gi9iTwH868O1AeXwaTqUzkPYgTDlfFPcaTfZ7TVFBIOzv10olmlwl/6diyDuCBBOj24WyDTJA08dk3ZzjoYJYeQoDfxPMedYKXyns85Y7rY6y5DpFP0m+XZQj9Ph7FeOc+LFcgg6q7xdJSd7YsVyKwOakWIn5DW8hpgvAsQK7SFZj9jt9z0zQkllF1mM3AGPXks4wpKUdI/VF9dx19WflUS697eMS7QC1fBb7Nd3zHqljNRx9yYRJZ5wF1O27lYDi5goEKrQcOlZI92vR1fqj5B1Xg+6631v2VyMi4U/cqpgz/hDq+nlUFC638r0lLU62Gjh5x4yUqufsDyyiVJnar/S0CPrWlUskhAVR1ADKutGYUVncNzhfudegFSGhGeKWp7MLa7ys+ScFset4Js29G9ZP81DXCSqycJD+BdZc25JswJa5pZ+NxUeQsKk7PSKBqwUzuqE37GT86UFFw0BoFNhloRcLsjOc0Z3oVf7PL+ayskVV51LYwVntV+VkNn6BgxsC/A0Cy4jEyg1mFGUPaeOUZZOqY9aUanQFAIjv3yfNlhRN+OcnCcQjPCJ7skOga4r0ELYf5ENOtc5LkVkMnQoPV9zfasdnumguntgk2VgyvY+Qc4l21/c4ojPRC9MdDKdIxosKNE4kIwfpa6iJCC0Yi
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR0701MB2195.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8936002)(91956017)(38070700005)(2616005)(26005)(6506007)(85182001)(82960400001)(2906002)(85202003)(83380400001)(64756008)(5660300002)(4326008)(71200400001)(8676002)(316002)(110136005)(6486002)(76116006)(966005)(53546011)(186003)(66446008)(66556008)(66476007)(66574015)(38100700002)(33656002)(66946007)(86362001)(508600001)(122000001)(36756003)(6512007)(45980500001); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: TyaKehIHBg8PGb9H1vFQBsck+MbG7XMdNjdoVTMF5N/PxGJitEHDNz6BOWVYSIN3e5mXMEIDKCfKk75rsd6Eq0jVUoVSPdBxEVjhTw5SE7nLnAsoX2kG+5mHAUlumD4hkAqtdNKMi+OgZqIhLn2J8f/rEjqbVxRbdd+9gaHX7Ma+QjLM3Xn3k8i9raVJlfGLaiBXNahJeP3aEzpaXu0Sv0ricaSYPSbdHZHkhdHg4Gdkc0Q3SX83jVhnaOi/Hr1VaLIn5N+gF8SqB08QHN9hPXl1XnIGXbHwbzNZHqFq7NIMEkh66SueMhLSxt6qS4lQJQHGnrfXJ4x1XHWvxlnNsQnX1e32DyidWO/KwpFv7BOoKE7q09FbDbPykXDnpYiW64EQ/KL16uU5Hw8uJcZ2JGI/mkXAdl3n/MXdgGACumYFBshvTzAQvnY69aie28Q+DeHJWxRYUV2tboc8Pj80tzyoMhd0iLSS7QVg0VgWqRhuYf+M3Kii0fA7FAlAY1ga+fmUXGuntn11hAxYwnlPzewdd22Nz+19uOz3/qWmOqNZoLAHEu8czEL/iQALFzyyGMpNrzd5Y/uh+WU0YWBnpNctK4ZzwLBeWJaqiVd+bzZP/4hZtfD5hkGtCvwa4ixN6YQv+hAaATBAcO7tt9Ps7rMwCBzSzjgsUu8kcJDvwUfrjVK+diJCxb+naU3L63oSu3QNNQmNrCRskl8djc/5yU1DpUC79Cyt9tRjeD2BMTRCrek/J/e9448jZdVCNp7KjjDiagyCMfUAMH0BVqZH4y1U/1usdDUdhQ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ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM4PR0701MB2195.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e6a5d005-6269-4d4b-5ced-08da1e277ea0
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2022 15:00:20.2874 (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-CrossTenant-userprincipalname: jU4mM1mihcR0QeiMkeWxjwUMRBSFPLnqCkOVFoMC/6LvCyyCNh0Eo6Lsm1jfzc10Uuq7QQ2tWQDKANUD0rfTSEj26xWMig5PY+K2dkqmNMY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR07MB5976
Archived-At: <https://mailarchive.ietf.org/arch/msg/lake/4mU65IzPnMCYOO8NIDoPJ7RvXtM>
Subject: Re: [Lake] Computational EDHOC analysis - Some early comments and questions
X-BeenThere: lake@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Lightweight Authenticated Key Exchange <lake.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/lake>, <mailto:lake-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/lake/>
List-Post: <mailto:lake@ietf.org>
List-Help: <mailto:lake-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/lake>, <mailto:lake-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Apr 2022 15:00:37 -0000

Hi Mark, Felix,

Again, thanks for very good comments and valuable feedback.

Apologies for slow response. Please find some first brief responses below, do let us know if there are further questions. We plan to get back next week with some PRs based on the security analysis feedback to date.


From: Lake <lake-bounces@ietf.org> on behalf of Ilunga Tshibumbu Mukendi Marc <marcilu@student.ethz.ch>
Date: Thursday, 31 March 2022 at 15:18
To: "lake@ietf.org" <lake@ietf.org>
Cc: "mail@felixguenther.info" <mail@felixguenther.info>
Subject: [Lake] Computational EDHOC analysis - Some early comments and questions

Dear LAKE WG,

We are a team from ETH Zurich working on a computational analysis of EDHOC as a key exchange protocol. We are currently at an early stage of our work, but hope to have some preliminary analysis results in the next two months or so.
At this point, we're reaching out mainly to communicate a few early comments / questions based on our investigations so far. We hope this can clarify potential misunderstandings on our side before we dive deeper into our analysis.


Main points:

 1. Transcript Hashes:
 In Section 5.4.2, the draft states that TH_3 takes the ciphertext (of message 2) as input instead of the underlying plaintext; TH_4 works similarly. Is there a particular reason for including the ciphertext and not the plaintext (as done, e.g., in TLS 1.3)?
 (From an analysis perspective, hashing the ciphertext might introduce dependencies on the encryption method.)

[GS] The intent with the transcript hash is to include the content of all exchanged messages, which in the case of message 2 and 3 are encrypted. Please let us know if this has a substantial impact on the analysis or results.


 2. Session Key:
 It is unclear to us what is considered the "final" session key in EDHOC. PRK_4x3m seems to be the "final" key derived in the main document. As PRK_4x3m is however also used for deriving the encryption keys, MAC keys, OSCORE security context, exported material, etc., it is not an "independent and random-looking" key anymore by the time EDHOC completes, which would be the computational security guarantee one would ask for in a key exchange.

[GS] As mentioned, there is no "final" session key defined, since the default use of EDHOC is to establish keying material from which an application can derive session keys. This keying material is PRK_4x3m and TH_4, which perhaps could serve as "session key". However, based on other review comments we consider (with PR #276 as a starting point) to derive a key PRK_out from PRK_4x3m and TH_4 (using Expand) which perhaps is a better candidate "session key" for the analysis.


 3. Key Reuse in KDF:
 The key schedule uses PRK_2e, PRK_3e2m, and PRK-4x3m as inputs in both Extract and Expand (depending on the authentication mode). Such reuse of key material across is generally not secure. Concretely, in HMAC/KMAC-based derivation, one would need to carefully ensure domain separation between such calls. We point out that TLS 1.3, for specifically that reason, uses derived secrets (RFC 8446, Section 7.1: keys with label "derived") to separate Extract and Expand calls (cf. [1]).

[GS] Thanks, we indend to comply with this by deriving salts (using Expand) replacing the corresponding PRK. For PRK_4x3m, this will be replaced by the derivation of PRK_out (using Expand). A PR building on PR #276 will follow.

Secondary points:

 4. KDF Usage in KeyUpdate:
    1) The method takes a nonce to prevent "short cycles". What exactly is meant by that or the formal reasoning behind this?

[GS] We are revisiting the formal reasoning, but the rationale was similar as in stream cipher construction. Another reason for a nonce is to enable binding to the event that triggered the key update.

    2) Since Extract is used here as a PRF, the key (PRK_4x3m) should be the first input, and nonce the second.   (In that context, even a constant nonce would be fine; hence the question in 1).)
    3) To prevent key reuse across primitives, KeyUpdate should use Expand, not Extract. (see 3.)

[GS] Thanks, we will replace with Expand.

 5. Key Updates for OSCORE:
 As currently specified, it seems key updates will not influence the OSCORE security context (or other applications), as it seems such keys are not updated/re-derived. Is that intended?


[GS] Key update for OSCORE (KUDOS) makes use of EDHOC-KeyUpdate but is specified in a separate document:
https://datatracker.ietf.org/doc/html/draft-ietf-core-oscore-key-update


 6. Connection Identifiers:
 The draft states that CIDs have no cryptographic purpose (Section 3.3), but at the same time that they may be used to identify keys (Section 2), which sounds like a cryptographic purpose. What are we misunderstanding?

[GS] In EDHOC the connection identifiers are used for identifying the protocol state. If the correct protocol state is not identified, the message processing may fail, but we didn't consider this primarily a cryptographic concern. We may rephrase this as " no other purpose than to identify protocol state " or similar if that makes more sense?


 7. MAC Length:
 On page 30, MAC lengths seem to be depending on the authentication mode (besides the ciphersuite). What is the reason behind changing MAC length based on the mode?


[GS] This refers to the truncation of the HKDF MAC. For reasons of overhead it is desirable with certain cipher suites if the message on the wire has a truncated MAC.  The modes (methods) differ in the Signature_or_MAC field being either a signature or a MAC. For static DH Signature_or_MAC is the HKDF MAC, which can be truncated. In case of signature Signature_or_MAC is a signature, so the HKDF MAC isn't truncated.


 8. XOR Encryption for Message 2:
 Why is message 2 encrypted via a one-time pad instead of using the AEAD scheme? While an attacker can of course impersonate the server at this point, an AEAD scheme still protects against manipulations by a so-far passive person-in-the-middle.


[GS] Encryption is used as in SIGMA for protecting the identities. We use the same scheme also for the static DH methods. Using an AEAD would add a MAC which increases the overhead.

 9. Usage of EADs:
 The security guarantees for EADs are not explicit. They are considered unprotected; however, they are also passed to security applications. Moreover, the draft states, "the content in an EAD field may impact the security properties provided by EDHOC." What security guarantees can be affected by the EADs?

[GS] The description of EAD is updated in the Editor's copy [1], there is now also an appendix E containing more details and assumptions. Since an application defines the use of EAD, the resulting security guarantees are not in scope of EDHOC. However, one specific use of EDHOC may be worth analysing: The case that the application makes use of an ephemeral key in the EDHOC exchange for the purpose of establishing an ephemeral-static DH shared secret using a static public key different from the authentication key of the responder.


Sorry for brief responses.

Thanks
Göran


[1] https://lake-wg.github.io/edhoc/draft-ietf-lake-edhoc.html