Return-Path: <Hanno.Becker@arm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1])
 by ietfa.amsl.com (Postfix) with ESMTP id 0BCC13A1F4A
 for <tls@ietfa.amsl.com>; Tue, 31 Mar 2020 03:10:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.002
X-Spam-Level: 
X-Spam-Status: No, score=0.002 tagged_above=-999 required=5
 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001,
 SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001]
 autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key)
 header.d=armh.onmicrosoft.com header.b=2dAW2xji;
 dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com
 header.b=2dAW2xji
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 2E-a2grHp2Yn for <tls@ietfa.amsl.com>;
 Tue, 31 Mar 2020 03:10:47 -0700 (PDT)
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-eopbgr60049.outbound.protection.outlook.com [40.107.6.49])
 (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 541E93A1F47
 for <tls@ietf.org>; Tue, 31 Mar 2020 03:10:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; 
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=REbfhx39YMdZkqHPDFGKPqAaSTtKxR42tsOEAEqUAZs=;
 b=2dAW2xjiyH6Ljbsen5oYYzkq9EAX51Krl8LgnQm0HMwL/aW6Kpi6dwTWV6XZ/Ns8+bXUtMXVhdT8xDA0641BzY0qw33+X3p1I8Gf812fC7W+Cg3u4hAZB/YIRn4QETQR+ifJMR2E29AfPuneLqxuYHYxFOqBcLR6k8BRdky4yso=
Received: from DB7PR03CA0080.eurprd03.prod.outlook.com (2603:10a6:10:72::21)
 by AM0PR08MB4163.eurprd08.prod.outlook.com (2603:10a6:208:12e::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Tue, 31 Mar
 2020 10:10:43 +0000
Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com
 (2603:10a6:10:72:cafe::b1) by DB7PR03CA0080.outlook.office365.com
 (2603:10a6:10:72::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15 via Frontend
 Transport; Tue, 31 Mar 2020 10:10:41 +0000
Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; ietf.org; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;ietf.org; dmarc=bestguesspass action=none
 header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with
 Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2856.17 via Frontend Transport; Tue, 31 Mar 2020 10:10:41 +0000
Received: ("Tessian outbound 55454527ea3b:v50");
 Tue, 31 Mar 2020 10:10:41 +0000
X-CheckRecipientChecked: true
X-CR-MTA-CID: 9255e446b8d0e6dd
X-CR-MTA-TID: 64aa7808
Received: from 3332c36c1a19.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 A70C3E4A-5770-44D3-9CE8-3CC2E94C5B9F.1; 
 Tue, 31 Mar 2020 10:10:35 +0000
Received: from EUR04-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3332c36c1a19.2
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Tue, 31 Mar 2020 10:10:35 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Qi+XTuwDhJJTmoGgcyygriip5JwavApswGZn8g7C+2aGwz6AWaFzOcYqU3c6UmAjdB567QRwqzQ51K6s7e8eA8Bjkm1vwGjmq3IZ0iELqKzSYyBtOQnpWkiQV9XENJBxNPgy4oPLBw51jCKX1FNRgtfevjRmSLqqmh8Yx9URrbaPJCcx5lGBXafWQlp/1M8m/omyYNx9206krcAW97Fp2hNbdwotcuTY7f9peNodSMSXgJ/DP4yHioDccDFuUoSAIkSP01NAn3v7m7ZXtx++ey7rYFyY3JsAvl0/Vc/uedj/M/C9g7AZFxt7xmJAb0himoEZYopoZSWMKd8exUoijA==
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-SenderADCheck;
 bh=REbfhx39YMdZkqHPDFGKPqAaSTtKxR42tsOEAEqUAZs=;
 b=HS4qv6ErOAOl/ssydmxCGLMcnwzCaFu+INL21H2XlR7UxpiwgmrvDKyKySrJl6MIS65CdWADn9kOC0KExcLBoc3k7tstFCvpUl/53WVyTbRAk26ja4EhD2OPvm8thMsgbX6EZkvbTa7ysQ2pbtaaVk2o/KkJgoqe1hbqOqYTRRbEo9CHt57eqEBLc5PWyOgxFwWXGZqQIXk7pL/Wwgd7PkC/KzOiiemcvmGND65XiEVLgcoBV2/sIdyTjc+oIKQihm7cjruwacUtRWjzYRSS/HMNqIEL/xAzJWQAeTOrWEPEymXeXQWB5aInR2/v256aIjUUIm1qygnnUFvvHRBLBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; 
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=REbfhx39YMdZkqHPDFGKPqAaSTtKxR42tsOEAEqUAZs=;
 b=2dAW2xjiyH6Ljbsen5oYYzkq9EAX51Krl8LgnQm0HMwL/aW6Kpi6dwTWV6XZ/Ns8+bXUtMXVhdT8xDA0641BzY0qw33+X3p1I8Gf812fC7W+Cg3u4hAZB/YIRn4QETQR+ifJMR2E29AfPuneLqxuYHYxFOqBcLR6k8BRdky4yso=
Received: from AM6PR08MB3318.eurprd08.prod.outlook.com (52.135.163.143) by
 AM6PR08MB5029.eurprd08.prod.outlook.com (10.255.121.154) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2856.18; Tue, 31 Mar 2020 10:10:34 +0000
Received: from AM6PR08MB3318.eurprd08.prod.outlook.com
 ([fe80::1579:b7d9:f543:200d]) by AM6PR08MB3318.eurprd08.prod.outlook.com
 ([fe80::1579:b7d9:f543:200d%5]) with mapi id 15.20.2856.019; Tue, 31 Mar 2020
 10:10:34 +0000
From: Hanno Becker <Hanno.Becker@arm.com>
To: Hannes Tschofenig <Hannes.Tschofenig@arm.com>, "tls@ietf.org"
 <tls@ietf.org>
Thread-Topic: [TLS] Possible deadlock when ACKing KeyUpdate messages?
Thread-Index: AQHWBUxJ8anoCpmsBUC57Xe/3C4BZ6hg8CNggAB+9VqAANAfcIAAPaCG
Date: Tue, 31 Mar 2020 10:10:34 +0000
Message-ID: <AM6PR08MB3318E2FA31EEF0996CC11CB79BC80@AM6PR08MB3318.eurprd08.prod.outlook.com>
References: <AM6PR08MB3318966B8BEE7B818D6AB0409BCD0@AM6PR08MB3318.eurprd08.prod.outlook.com>,
 <AM0PR08MB3716FDD9BA467A7D597DD689FACB0@AM0PR08MB3716.eurprd08.prod.outlook.com>
 <AM6PR08MB33181249201D9E9E43F107229BCB0@AM6PR08MB3318.eurprd08.prod.outlook.com>,
 <AM0PR08MB371664C0317053358F3F48FAFAC80@AM0PR08MB3716.eurprd08.prod.outlook.com>
In-Reply-To: <AM0PR08MB371664C0317053358F3F48FAFAC80@AM0PR08MB3716.eurprd08.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Authentication-Results-Original: spf=none (sender IP is )
 smtp.mailfrom=Hanno.Becker@arm.com; 
x-originating-ip: [217.140.99.251]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: 559475c0-0283-4c94-7fd6-08d7d55bc4ae
x-ms-traffictypediagnostic: AM6PR08MB5029:|AM6PR08MB5029:|AM0PR08MB4163:
x-ms-exchange-transport-forked: True
X-Microsoft-Antispam-PRVS: <AM0PR08MB416398E4DC8E0DC7C08F311C9BC80@AM0PR08MB4163.eurprd08.prod.outlook.com>
x-checkrecipientrouted: true
nodisclaimer: true
x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000;
x-forefront-prvs: 0359162B6D
X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en;
 SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3318.eurprd08.prod.outlook.com;
 PTR:; CAT:NONE; SFTY:;
 SFS:(10009020)(4636009)(396003)(376002)(346002)(136003)(39860400002)(366004)(186003)(19627235002)(86362001)(71200400001)(316002)(110136005)(55016002)(81166006)(8676002)(8936002)(9686003)(81156014)(19627405001)(7696005)(15650500001)(26005)(64756008)(66476007)(66446008)(5660300002)(66556008)(53546011)(478600001)(66946007)(2906002)(33656002)(52536014)(966005)(76116006)(6506007);
 DIR:OUT; SFP:1101; 
received-spf: None (protection.outlook.com: arm.com does not designate
 permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: /BnR145idFSgrAK/rib1BmW1S7RlqeuRk4prc/WUKVvtGcy94kxVrJ9+R9NiN/tZkUOod8geIn7GzlmdWQz7XJRlVRfbhce8zkz9vM8dZAzTL9dn+D5/VfkHDZl4nxbXEuKcs2CzkLSDPbsf+TZW7xt7jEcxfwf2abb/glycdKmKaYQPGOD6Ple3TzsOu6V5dIr+voeTJYQQLSnnayjVKPEgPojBRXj8PboIEczs62kw1F28PyiVPNU253W0foHojJ9Vgwp4hX2TjcW1j6FJLYERmmhLuhFFORjW0WnjfV9V4pQC0zxmI0mvAUSyo4eQRo6FNpSaHr9XLOokDSE085XZyLXGsgKETX20SA0S9ZaTQiulIefvbeMMOp/qM7SZwMe+JfzP64AVj7C08MLQ96oHJe525pgFNbN7+mSPLogUg9ydmBvPLdbJlmJDWdyWJQy16VTVAIfpjqX1ZnI/3ydiXOtrc811k9XEWvQg5+yeRliKTbdgpwW8M5+2magMLX3WlVmp3nGJ9eM/HHmmNw==
x-ms-exchange-antispam-messagedata: b1kQwExyEzvL4uQlU7DigpA+joi4KRPdtw7TAsLonz/v13TbAgXC/94Whz8D4yhmyOFdLSHFeGVesmqHxgk8SUK4KbpfpG17muQMlt23os6pYWcI33Q3GJk/LfecYfhIGcdgqBgs9SH3Z4BZlfxogQ==
Content-Type: multipart/alternative;
 boundary="_000_AM6PR08MB3318E2FA31EEF0996CC11CB79BC80AM6PR08MB3318eurp_"
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5029
Original-Authentication-Results: spf=none (sender IP is )
 smtp.mailfrom=Hanno.Becker@arm.com; 
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; 
 IPV:CAL; SFV:NSPM;
 H:64aa7808-outbound-1.mta.getcheckrecipient.com; 
 PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:;
 SFS:(10009020)(4636009)(39860400002)(396003)(136003)(346002)(376002)(46966005)(478600001)(356004)(19627405001)(26826003)(81156014)(6506007)(53546011)(7696005)(81166006)(8676002)(47076004)(966005)(30864003)(86362001)(82740400003)(9686003)(2906002)(52536014)(110136005)(70206006)(70586007)(19627235002)(55016002)(26005)(186003)(336012)(5660300002)(15650500001)(33656002)(316002)(8936002);
 DIR:OUT; SFP:1101; 
X-MS-Office365-Filtering-Correlation-Id-Prvs: 2db4049b-b264-4279-3028-08d7d55bc072
X-Forefront-PRVS: 0359162B6D
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: oAaxOmLR/mPSGrgQPK7cBLpLeCSTk+JicQSIKEOv5yei7EDgEbpzKcYUmuOvMDx3iMtq0cclgIZOJmAloeyucE9Zlx3MFolUPoU+hDBSpbbBn4q/owQ77Kr9H2K0bJ9ltc7+KeQ4Tox/ZosLF+ov5KbLy3h2ObnXVp18/MEJjh5EJTj2npEcInCWE0maxcDoZ7FlZvDLKOmDwLAuc+HHHVzo7T/eBPLnjm6XVA5xFRaK2O5Fu0eFTR/uPK92QsuQ4hQ39Am3l04Guc4XVz3mi7pajgk6uti7hKC4LJS+Wq32Jkz2pC247HzQQ2ZmVnxu3SB3QFTmtbUs4JRzEmSCXVdkHl3GeW1khrGQDQYeOVrk3893RThjgiLyqYQltdZCjGgsTLw/BDm0WRflajliqTrn7CHubv1QIvqAgAvRXZAh5VOJyLZIzLN+ithfrAd0n0F57HS+me9g9+HRPqgXqmJnQfz37WIxsyH5LhnQ4oCHBENZpeiSSgdrWeIq8NvIY/VgfLtDxcuvOiqb9pN4iVEx5XUzedObehPZe8f0nDDLSGsydahECFlfcTU4M9rSB8cMzzGTY+LeDOLQSz6s0w==
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2020 10:10:41.4324 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 559475c0-0283-4c94-7fd6-08d7d55bc4ae
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; 
 Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4163
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/r-WZ6ewwO-0apviEwgHOMFMnpZs>
Subject: Re: [TLS] Possible deadlock when ACKing KeyUpdate messages?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working
 group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>,
 <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>,
 <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Mar 2020 10:10:50 -0000

--_000_AM6PR08MB3318E2FA31EEF0996CC11CB79BC80AM6PR08MB3318eurp_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hi Hannes,

Thank for opening a PR!

I think the underlying issue here is the conception that all that needs to =
be ensured is the ability to ACK
retransmissions of the KeyUpdate, and the modified version still gives that=
 impression. If that was true,
the use of 'canned ACKs' as in Draft 37 would be fine. However, the example=
 shows that there's more to
retaining old keying material than just ACKing retransmitted KeyUpdates, an=
d I'd therefore opt for a more
intrusive change of wording, such as:

Due to the possibility of an ACK message for a KeyUpdate being lost and the=
reby
preventing the sender of the KeyUpdate from updating its keying material,
receivers MUST retain the pre-update keying material until receipt and succ=
essful
decryption of a message using the new keys. Receivers MUST NOT delete the
pre-update keying material immediately and use canned ACK messages for
retransmitted KeyUpdate messages, since situations can occur in which recei=
vers
still need to be able to decrypt messages secured with pre-update keying ma=
terial.


Maybe the second part is better treated as a note or implementation warning=
, though.

Best,
Hanno
________________________________
From: Hannes Tschofenig <Hannes.Tschofenig@arm.com>
Sent: Tuesday, March 31, 2020 7:28 AM
To: Hanno Becker <Hanno.Becker@arm.com>; tls@ietf.org <tls@ietf.org>
Subject: RE: [TLS] Possible deadlock when ACKing KeyUpdate messages?


Hi Hanno,



I believe the part of the paragraph that talks about =93canned ACKs=94 need=
s to be clarified.



In https://github.com/tlswg/dtls13-spec/pull/135 I changed the text  from



=93

   Although KeyUpdate MUST be acknowledged, it is possible for the ACK

   to be lost, in which case the sender of the KeyUpdate will retransmit

   it.  Implementations MUST retain the ability to ACK the KeyUpdate for

   up to 2MSL.  It is RECOMMENDED that they do so by retaining the pre-

   update keying material, but they MAY do so by responding to messages

   which appear to be out-of-epoch with a canned ACK message; in this

   case, implementations SHOULD rate limit how often they send such

   ACKs.

"



To:



=93

Although KeyUpdates MUST be acknowledged, it is possible for the ACK to be

lost, in which case the sender of the KeyUpdate will retransmit it.

The receiver of the KeyUpdate MUST retain the ability to ACK the KeyUpdate =
for

up to 2MSL. It is RECOMMENDED that they do so by retaining the

pre-update keying material, but they MAY remove the pre-update

keying material only upon receipt and successful decryption of a message

using the new keys.

=93



Ciao

Hannes





From: Hanno Becker <Hanno.Becker@arm.com>
Sent: Monday, March 30, 2020 8:02 PM
To: Hannes Tschofenig <Hannes.Tschofenig@arm.com>; tls@ietf.org
Subject: Re: [TLS] Possible deadlock when ACKing KeyUpdate messages?



Hi Hannes,



>  In your example below, the sender of the initial KeyUpdate has to re-sen=
d it because of the lost ACK. In order to resubmit it, it has to use the ol=
d keying material (or cache the message). The receiver cannot immediately d=
elete keying material after processing the initial KeyUpdate message becaus=
e it does not know whether the ACK will subsequently get lost.



My point is that the paragraph cited at the top of my post appears to say t=
hat receivers MAY immediately delete keying material after

receiving a KeyUpdate IF they blindly ACK retransmissions of the KeyUpdate =
(even though they can't decrypt it anymore). The example

shows that this doesn't work, unless I've made a mistake.



Best,

Hanno

________________________________

From: Hannes Tschofenig <Hannes.Tschofenig@arm.com<mailto:Hannes.Tschofenig=
@arm.com>>
Sent: Monday, March 30, 2020 11:57 AM
To: Hanno Becker <Hanno.Becker@arm.com<mailto:Hanno.Becker@arm.com>>; tls@i=
etf.org<mailto:tls@ietf.org> <tls@ietf.org<mailto:tls@ietf.org>>
Subject: RE: [TLS] Possible deadlock when ACKing KeyUpdate messages?



Hi Hanno, Hi all,



I believe it would be useful to add some extra sentences to the draft to re=
taining the old key material.



In your example below, the sender of the initial KeyUpdate has to re-send i=
t because of the lost ACK. In order to resubmit it, it has to use the old k=
eying material (or cache the message). The receiver cannot immediately dele=
te keying material after processing the initial KeyUpdate message because i=
t does not know whether the ACK will subsequently get lost.



Ciao

Hannes



From: TLS <tls-bounces@ietf.org<mailto:tls-bounces@ietf.org>> On Behalf Of =
Hanno Becker
Sent: Saturday, March 28, 2020 11:31 PM
To: tls@ietf.org<mailto:tls@ietf.org>
Subject: [TLS] Possible deadlock when ACKing KeyUpdate messages?



In relation to ACKs for KeyUpdate messages, DTLS 1.3 Draft 37 states:



   Although KeyUpdate MUST be acknowledged, it is possible for the ACK

   to be lost, in which case the sender of the KeyUpdate will retransmit

   it.  Implementations MUST retain the ability to ACK the KeyUpdate for

   up to 2MSL.  It is RECOMMENDED that they do so by retaining the pre-

   update keying material, but they MAY do so by responding to messages

   which appear to be out-of-epoch with a canned ACK message; in this

   case, implementations SHOULD rate limit how often they send such

   ACKs.



This seems to allow implementations to remove old incoming keys immediately

after ACKing the KeyUpdate, which appears to open the door for the followin=
g

situation leading to deadlock:





  +-------------------------+

  |   KeyUpdate, epoch N    |-------------> received

  +-------------------------+

                                          +------------------------+

                               lost x-----|     ACK,   epoch M     |

                                          +------------------------+



                                          [ new incoming epoch N+1,

                                            remove keys for epoch N ]



-                                         +------------------------+

                  received  <-------------|   KeyUpdate, epoch M   |

                                          +------------------------+

  +-------------------------+

  |       ACK, epoch N      |-------[ irrelevant whether it goes through - =
see below ]

  +-------------------------+



  [ new incoming epoch M+1,

    remove keys for epoch M ]



Note: This isn't an entirely unlikely situation, since a KeyUpdate with upd=
ate_requested flag

will result in a subsequent KeyUpdate from the other side, and the only unl=
ucky thing that

needs to happen is for the original ACK to be lost while both KeyUpdate mes=
sages go through.



At this point, both sides have updated their incoming key material but

not their outgoing key material, since they're still awaiting the ACK -

however, it turns out that they can't actually read those ACKs anymore:



After some time, the peers resend the KeyUpdate messages, which will be

blindly ACKed by the peer according to the recommendation in the spec;

however, the ACKs will be encrypted with the wrong keys and cannot

be parsed on either side:



  +---------------------------+

  | resent KeyUpdate, epoch N |-------------> received, but can't be read

  +---------------------------+               because incoming epoch N+1



                                                send 'blind' ACK



  received, but can't be read                +------------------------+

  because incoming epoch M+1  <--------------|     ACK,   epoch M     |

                                             +------------------------+



The same will happen to KeyUpdate retransmission from the other side.



It seems that this results in a deadlock. Am I missing / misunderstanding s=
omething?



A possible mitigation would be to force retaining the old key material for =
2MSL,

or alternatively, to mandate that old key material must only be removed upo=
n

receipt and successful decryption of a message using the new keys.

IMPORTANT NOTICE: The contents of this email and any attachments are confid=
ential and may also be privileged. If you are not the intended recipient, p=
lease notify the sender immediately and do not disclose the contents to any=
 other person, use it for any purpose, or store or copy the information in =
any medium. Thank you.

IMPORTANT NOTICE: The contents of this email and any attachments are confid=
ential and may also be privileged. If you are not the intended recipient, p=
lease notify the sender immediately and do not disclose the contents to any=
 other person, use it for any purpose, or store or copy the information in =
any medium. Thank you.

--_000_AM6PR08MB3318E2FA31EEF0996CC11CB79BC80AM6PR08MB3318eurp_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
Hi Hannes,</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
Thank for opening a PR!</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
I think the underlying issue here is the conception that all that needs to =
be ensured is the ability to ACK&nbsp;</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
retransmissions of the KeyUpdate, and the modified version still gives that=
 impression. If that was true,&nbsp;</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
the use of 'canned ACKs' as in Draft 37 would be fine. However, the example=
 shows that there's more to&nbsp;</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
retaining old keying material than just ACKing retransmitted KeyUpdates, an=
d I'd therefore opt for a more&nbsp;</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
intrusive&nbsp;<span style=3D"color: rgb(0, 0, 0); font-family: Calibri, Ar=
ial, Helvetica, sans-serif; font-size: 12pt;">change of wording, such as:</=
span></div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<span style=3D"color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,=
 sans-serif; font-size: 12pt;"><span><br>
</span>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">Due t=
o the possibility of an ACK message for a KeyUpdate being lost and thereby<=
/span><br>
</div>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">preve=
nting the sender of the KeyUpdate from updating its keying material,
</span><br>
</div>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">recei=
vers MUST retain the pre-update keying material until receipt and successfu=
l
</span><br>
</div>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">decry=
ption of a message using the new keys. Receivers MUST NOT delete the
</span><br>
</div>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">pre-u=
pdate keying material immediately and use canned ACK messages for
</span><br>
</div>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">retra=
nsmitted KeyUpdate messages, since situations can occur in which receivers<=
/span><br>
</div>
<div><span style=3D"font-family: &quot;Courier New&quot;, monospace;">still=
 need to be able to decrypt messages secured with pre-update keying materia=
l.</span><br>
</div>
<br>
</span></div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<span style=3D"color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,=
 sans-serif; font-size: 12pt; background-color: rgb(246, 248, 250);"><br>
</span></div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<span style=3D"color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica,=
 sans-serif; font-size: 12pt; background-color: rgb(246, 248, 250);">Maybe =
the second part is better treated as a note or implementation warning, thou=
gh.</span></div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
Hanno</div>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Hannes Tschofenig &lt=
;Hannes.Tschofenig@arm.com&gt;<br>
<b>Sent:</b> Tuesday, March 31, 2020 7:28 AM<br>
<b>To:</b> Hanno Becker &lt;Hanno.Becker@arm.com&gt;; tls@ietf.org &lt;tls@=
ietf.org&gt;<br>
<b>Subject:</b> RE: [TLS] Possible deadlock when ACKing KeyUpdate messages?=
</font>
<div>&nbsp;</div>
</div>
<style>
<!--
@font-face
	{font-family:"Cambria Math"}
@font-face
	{font-family:DengXian}
@font-face
	{font-family:Calibri}
@font-face
	{}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
	{color:#0563C1;
	text-decoration:underline}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New"}
p.x_xmsonormal, li.x_xmsonormal, div.x_xmsonormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif}
span.x_HTMLPreformattedChar
	{font-family:"Courier New"}
span.x_EmailStyle26
	{font-family:"Calibri",sans-serif;
	color:windowtext}
.x_MsoChpDefault
	{font-size:10.0pt}
@page WordSection1
	{margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
	{}
-->
</style>
<div lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"x_WordSection1">
<p class=3D"x_MsoNormal">Hi Hanno, </p>
<p class=3D"x_MsoNormal">&nbsp;</p>
<pre><span style=3D"font-family:&quot;Calibri&quot;,sans-serif">I believe t=
he part of the paragraph that talks about =93canned ACKs=94 needs to be cla=
rified. </span></pre>
<pre><span style=3D"font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</spa=
n></pre>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt">In </span><a href=
=3D"https://github.com/tlswg/dtls13-spec/pull/135">https://github.com/tlswg=
/dtls13-spec/pull/135</a>
<span style=3D"font-size:10.0pt">I changed the text &nbsp;from </span></p>
<pre><span style=3D"font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</spa=
n></pre>
<pre><span style=3D"font-family:&quot;Calibri&quot;,sans-serif">=93</span><=
span style=3D"color:black"></span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; Although KeyUpdate MUST be ac=
knowledged, it is possible for the ACK</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; to be lost, in which case the=
 sender of the KeyUpdate will retransmit</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; it.&nbsp; Implementations MUS=
T retain the ability to ACK the KeyUpdate for</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; up to 2MSL.&nbsp; It is RECOM=
MENDED that they do so by retaining the pre-</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; update keying material, but t=
hey MAY do so by responding to messages</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; which appear to be out-of-epo=
ch with a canned ACK message; in this</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; case, implementations SHOULD =
rate limit how often they send such</span></pre>
<pre><span style=3D"color:black">&nbsp;&nbsp; ACKs.</span></pre>
<pre>&quot; </pre>
<pre><span style=3D"font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</spa=
n></pre>
<pre><span style=3D"font-family:&quot;Calibri&quot;,sans-serif">To:</span><=
/pre>
<pre>&nbsp;</pre>
<p class=3D"x_MsoNormal">=93</p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">Although KeyUpdates MUST be acknowledged, =
it is possible for the ACK to be</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">lost, in which case the sender of the KeyU=
pdate will retransmit it.</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">The receiver of the KeyUpdate MUST retain =
the ability to ACK the KeyUpdate for</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">up to 2MSL. It is RECOMMENDED that they do=
 so by retaining the</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">pre-update keying material, but they MAY r=
emove the pre-update
</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">keying material only upon receipt and succ=
essful decryption of a message
</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">using the new keys.</span></p>
<p class=3D"x_MsoNormal"><span style=3D"font-size:10.0pt; font-family:&quot=
;Courier New&quot;; color:black">=93</span></p>
<p class=3D"x_MsoNormal">&nbsp;</p>
<p class=3D"x_MsoNormal">Ciao</p>
<p class=3D"x_MsoNormal">Hannes</p>
<p class=3D"x_MsoNormal">&nbsp;</p>
<p class=3D"x_MsoNormal">&nbsp;</p>
<div>
<div style=3D"border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0i=
n 0in 0in">
<p class=3D"x_MsoNormal"><b>From:</b> Hanno Becker &lt;Hanno.Becker@arm.com=
&gt; <br>
<b>Sent:</b> Monday, March 30, 2020 8:02 PM<br>
<b>To:</b> Hannes Tschofenig &lt;Hannes.Tschofenig@arm.com&gt;; tls@ietf.or=
g<br>
<b>Subject:</b> Re: [TLS] Possible deadlock when ACKing KeyUpdate messages?=
</p>
</div>
</div>
<p class=3D"x_MsoNormal">&nbsp;</p>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">Hi H=
annes,</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">&nbs=
p;</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">&gt;=
&nbsp;&nbsp;<span style=3D"background:white">In your example below, the sen=
der of the initial KeyUpdate has to re-send it because of the lost ACK. In =
order to resubmit it, it has to use the old keying
 material (or cache the message). The receiver cannot immediately delete ke=
ying material after processing the initial KeyUpdate message because it doe=
s not know whether the ACK will subsequently get lost.</span></span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">&nbs=
p;</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">My p=
oint is that the paragraph cited at the top of my post appears to say that =
receivers MAY immediately delete keying material after</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">rece=
iving a KeyUpdate IF they blindly ACK retransmissions of the KeyUpdate (eve=
n though they can't decrypt it anymore).&nbsp;The example&nbsp;</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">show=
s that this doesn't&nbsp;work, unless I've made a mistake.</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">&nbs=
p;</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">Best=
,</span></p>
</div>
<div>
<p class=3D"x_MsoNormal"><span style=3D"font-size:12.0pt; color:black">Hann=
o</span></p>
</div>
<div class=3D"x_MsoNormal" align=3D"center" style=3D"text-align:center">
<hr size=3D"2" width=3D"98%" align=3D"center">
</div>
<div id=3D"x_divRplyFwdMsg">
<p class=3D"x_MsoNormal"><b><span style=3D"color:black">From:</span></b><sp=
an style=3D"color:black"> Hannes Tschofenig &lt;<a href=3D"mailto:Hannes.Ts=
chofenig@arm.com">Hannes.Tschofenig@arm.com</a>&gt;<br>
<b>Sent:</b> Monday, March 30, 2020 11:57 AM<br>
<b>To:</b> Hanno Becker &lt;<a href=3D"mailto:Hanno.Becker@arm.com">Hanno.B=
ecker@arm.com</a>&gt;;
<a href=3D"mailto:tls@ietf.org">tls@ietf.org</a> &lt;<a href=3D"mailto:tls@=
ietf.org">tls@ietf.org</a>&gt;<br>
<b>Subject:</b> RE: [TLS] Possible deadlock when ACKing KeyUpdate messages?=
</span>
</p>
<div>
<p class=3D"x_MsoNormal">&nbsp;</p>
</div>
</div>
<div>
<div>
<p class=3D"x_xmsonormal">Hi Hanno, Hi all, </p>
<p class=3D"x_xmsonormal">&nbsp;</p>
<p class=3D"x_xmsonormal">I believe it would be useful to add some extra se=
ntences to the draft to
<span style=3D"font-size:12.0pt; color:black">retaining the old key materia=
l. </span>
</p>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">In =
your example below, the sender of the initial KeyUpdate has to re-send it b=
ecause of the lost ACK. In order to resubmit it, it has to use the old keyi=
ng material (or cache the message).
 The receiver cannot immediately delete keying material after processing th=
e initial KeyUpdate message because it does not know whether the ACK will s=
ubsequently get lost.
</span></p>
<p class=3D"x_xmsonormal">&nbsp;</p>
<p class=3D"x_xmsonormal">Ciao</p>
<p class=3D"x_xmsonormal">Hannes</p>
<p class=3D"x_xmsonormal">&nbsp;</p>
<div>
<div style=3D"border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0i=
n 0in 0in">
<p class=3D"x_xmsonormal"><b>From:</b> TLS &lt;<a href=3D"mailto:tls-bounce=
s@ietf.org">tls-bounces@ietf.org</a>&gt;
<b>On Behalf Of </b>Hanno Becker<br>
<b>Sent:</b> Saturday, March 28, 2020 11:31 PM<br>
<b>To:</b> <a href=3D"mailto:tls@ietf.org">tls@ietf.org</a><br>
<b>Subject:</b> [TLS] Possible deadlock when ACKing KeyUpdate messages?</p>
</div>
</div>
<p class=3D"x_xmsonormal">&nbsp;</p>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">In =
relation to ACKs for KeyUpdate messages, DTLS 1.3 Draft 37 states:</span></=
p>
</div>
<div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;Although KeyUpdate MUST be acknowledged, it is possible for the A=
CK</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;to be lost, in which case the sender of the KeyUpdate will retran=
smit</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;it. &nbsp;Implementations MUST retain the ability to ACK the KeyU=
pdate for</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;up to 2MSL. &nbsp;It is RECOMMENDED that they do so by retaining =
the pre-</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;update keying material, but they MAY do so by responding to messa=
ges</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;which appear to be out-of-epoch with a canned ACK message; in thi=
s</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;case, implementations SHOULD rate limit how often they send such<=
/span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp; &nbsp;ACKs.</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">Thi=
s seems to allow implementations to remove old incoming keys immediately</s=
pan></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">aft=
er ACKing the KeyUpdate, which appears to open the door for the following&n=
bsp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">sit=
uation leading to deadlock:</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &#43;-------------------------&#43=
;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; | &nbsp; KeyUpdate, epoch N &nbsp;=
 &nbsp;|-------------&gt; received</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &#43;-------------------------&#43=
;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &#43;------------------------&#43;</span></p=
>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lost =
x-----| &nbsp; &nbsp; ACK, &nbsp; epoch M &nbsp; &nbsp; |</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &#43;------------------------&#43;</span></p=
>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; [ new incoming epoch N&#43;1,</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remove keys for epoch N ]</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &#43;------------------------&#43;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; received &nbsp;&lt;-------------| &nbsp; KeyUpdate, e=
poch M &nbsp; |</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &#43;------------------------&#43;</span></p=
>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &#43;-------------------------&#43=
;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; |&nbsp; &nbsp; &nbsp; &nbsp;ACK, e=
poch N&nbsp; &nbsp; &nbsp; |-------[ irrelevant whether it goes through - s=
ee below ]</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &#43;-------------------------&#43=
;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; [ new incoming epoch M&#43;1,</spa=
n></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; remove keys for epoch M ]</=
span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">Not=
e: This isn't an entirely unlikely situation, since a KeyUpdate with update=
_requested flag</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">wil=
l result in a subsequent KeyUpdate from the other side, and the only unluck=
y thing that&nbsp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">nee=
ds to happen is for the original ACK to be lost while both KeyUpdate messag=
es go through.</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">At =
this point, both sides have updated their incoming key material but</span><=
/p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">not=
 their outgoing key material, since they're still awaiting the ACK -&nbsp;<=
/span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">how=
ever, it turns out that they can't actually read those ACKs anymore:</span>=
</p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">Aft=
er some time, the peers resend the KeyUpdate messages, which will be</span>=
</p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">bli=
ndly ACKed by the peer according to the recommendation in the spec;</span><=
/p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">how=
ever, the ACKs will be encrypted with the wrong keys and cannot</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">be =
parsed on either side:</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &#43;---------------------------&#=
43;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; | resent KeyUpdate, epoch N |-----=
--------&gt; received, but can't be read</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &#43;---------------------------&#=
43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; because incoming epoch=
 N&#43;1</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp;
</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; send 'blind' ACK</span>=
</p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; received, but can't be read &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#43;---------------------=
---&#43;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; because incoming epoch M&#43;1 &nb=
sp;&lt;--------------| &nbsp; &nbsp; ACK, &nbsp; epoch M &nbsp; &nbsp; |</s=
pan></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; font-family:&quo=
t;Courier New&quot;; color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#43;------------------------&#=
43;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">The=
 same will happen to KeyUpdate retransmission from the other side.</span></=
p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">It =
seems that this results in a deadlock. Am I missing / misunderstanding some=
thing?</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">&nb=
sp;</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">A p=
ossible mitigation would be to force retaining the old key material for 2MS=
L,</span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">or =
alternatively, to mandate that old key material must only be removed upon</=
span></p>
</div>
<div>
<p class=3D"x_xmsonormal"><span style=3D"font-size:12.0pt; color:black">rec=
eipt and successful decryption of a message using the new keys.</span></p>
</div>
<p class=3D"x_xmsonormal">IMPORTANT NOTICE: The contents of this email and =
any attachments are confidential and may also be privileged. If you are not=
 the intended recipient, please notify the sender immediately and do not di=
sclose the contents to any other person,
 use it for any purpose, or store or copy the information in any medium. Th=
ank you.
</p>
</div>
</div>
</div>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confid=
ential and may also be privileged. If you are not the intended recipient, p=
lease notify the sender immediately and do not disclose the contents to any=
 other person, use it for any purpose,
 or store or copy the information in any medium. Thank you.
</body>
</html>

--_000_AM6PR08MB3318E2FA31EEF0996CC11CB79BC80AM6PR08MB3318eurp_--

