Re: [TLS] Connection ID Draft

"Fossati, Thomas (Nokia - GB/Cambridge, UK)" <thomas.fossati@nokia.com> Wed, 18 October 2017 06:44 UTC

Return-Path: <thomas.fossati@nokia.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 08424132D17 for <tls@ietfa.amsl.com>; Tue, 17 Oct 2017 23:44:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.92
X-Spam-Level:
X-Spam-Status: No, score=-1.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-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=nokia.onmicrosoft.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 i553iy6iR_rO for <tls@ietfa.amsl.com>; Tue, 17 Oct 2017 23:44:04 -0700 (PDT)
Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30120.outbound.protection.outlook.com [40.107.3.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8E0CE132F2C for <tls@ietf.org>; Tue, 17 Oct 2017 23:44:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tpXJDjTn8Ng4A1vlMjlWFQ/ufBTlzrl7Pb6FoQ54Ec4=; b=R7VmWdOcASZTINJ5A/s9urKlyB4H8pTSy44OoRtQp2i5BMGp2ctqBAbSbLN9h2N3UbLBvrcJ3GQvhYrQ1LQG70WqXDMZaUZHun+QIGamtDAnrMgosNcRJEaVhGGPEX1nJYJNpuU2Rw822t6Qg4yQtsA4OAaewmiXGyvLb44qLoI=
Received: from VI1PR07MB1102.eurprd07.prod.outlook.com (10.163.168.26) by VI1PR07MB1103.eurprd07.prod.outlook.com (10.163.168.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.5; Wed, 18 Oct 2017 06:44:01 +0000
Received: from VI1PR07MB1102.eurprd07.prod.outlook.com ([fe80::e157:80bf:7ba7:b2ed]) by VI1PR07MB1102.eurprd07.prod.outlook.com ([fe80::e157:80bf:7ba7:b2ed%13]) with mapi id 15.20.0156.004; Wed, 18 Oct 2017 06:44:00 +0000
From: "Fossati, Thomas (Nokia - GB/Cambridge, UK)" <thomas.fossati@nokia.com>
To: Martin Thomson <martin.thomson@gmail.com>
CC: Eric Rescorla <ekr@rtfm.com>, "tls@ietf.org" <tls@ietf.org>, "Fossati, Thomas (Nokia - GB/Cambridge, UK)" <thomas.fossati@nokia.com>
Thread-Topic: [TLS] Connection ID Draft
Thread-Index: AQHTQ6/ei1Eh6DPTUUK7WLQddJSSYqLnKXUAgADEnwCAAKpMgIAAqfeA
Date: Wed, 18 Oct 2017 06:44:00 +0000
Message-ID: <6F9A34A1-7F33-462D-96F6-92081256E83B@nokia.com>
References: <CABcZeBPXB6cOSztzDHtKSWUCJrgET+9cF_rAiiE8CYCUSY_uLA@mail.gmail.com> <CABkgnnXT7nv9aNQh12deeitF1CurENpxgUicn9GHjMbojcEvJg@mail.gmail.com> <D0524862-083C-4576-98B8-6D8A4825D458@nokia.com> <CABkgnnW4d=H5RZ0E+Hwo4jQptDpshVVuFtD-xQudJzxLXyReAQ@mail.gmail.com>
In-Reply-To: <CABkgnnW4d=H5RZ0E+Hwo4jQptDpshVVuFtD-xQudJzxLXyReAQ@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.20.0.170309
authentication-results: spf=none (sender IP is ) smtp.mailfrom=thomas.fossati@nokia.com;
x-originating-ip: [88.109.173.195]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; VI1PR07MB1103; 6:W5oq7nPTYBiscnH4wl6/lIy6nGVgxlMCOA/aXYnKy8hiCf/eaNw5P+jc4FsNPBctAJmZ6b8LXS5NTmlupMnSv8pKJ6qzIyZEwhlqgfXsEXPtDO2ro/W1SievGym9WdfpmvBmRctE6QLUFrpTdilXtqE02tXwBNwXSEzhdHyc696GzkOFDeP/951nmzkpudvpRLCKgtzW03mRJh+cl5okV76AcQFFrbhmpzNMDY6hEO5K16KCQ3V7eemvXv3L22AFQNw4IbxSXqCUGFtWt0GNKrUWSTlDsDjP8uLMerRpjENjjp/KsnXESIZu0lLCiTf8zZRyNcAF/0GNrlgBJo8BnA==; 5:1f9klCQ6Nl19HIeellNVpEh9yWjMFXRu5/yyjefUovhpbYqGsgByLqJDk0Bh44Y3CIM4l2Rb8AJy0+kydShMtQo5Lv0c2w1F2/E6LdnFSep6ED77LZSOUu11MzwB0UMb8A8uuvjfq35Dq8GSKs9j7A==; 24:pi50gzcFI3rvrcZ9mOWbsorFM74W0O2KpQHzzWw1HOBw7aguCfjQWwIprk/0CrPkbgTy/QcscVzWbot8Qt4AT3nTdkdNiIElidkQG898GXM=; 7:XtTMcMtaw0duhLpXjVryvoZK/NbrsRdaR7ttqWOp/r/bVxXKOCqpShodh++zcF4yxnRSeEJFSnFaRCYW4ADKj7zPvKP+6wb/w1ASWILRJHMu1EWEdbStH7+HvGkbjYUghZ2W8VGTmY+7grnRNDVRzUyP5MSvyTgU8iXtWUbbAhwH5fMkuh6FgnCOW2bkYemSWQvw5RIunNiosNQt8gUdSM9xRGqB3xTlhaFob6JRZNw=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR;
x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(6009001)(376002)(346002)(39860400002)(199003)(189002)(24454002)(377454003)(50986999)(2950100002)(7736002)(53936002)(6116002)(4326008)(68736007)(102836003)(305945005)(105586002)(106356001)(2900100001)(66066001)(6512007)(6916009)(6306002)(316002)(83716003)(82746002)(99286003)(93886005)(58126008)(83506001)(36756003)(81156014)(54356999)(8936002)(8676002)(76176999)(229853002)(966005)(54906003)(53546010)(6436002)(2906002)(3660700001)(6506006)(86362001)(5250100002)(39060400002)(6486002)(97736004)(5660300001)(6246003)(107886003)(478600001)(3280700002)(189998001)(3846002)(101416001)(25786009)(33656002)(81166006)(14454004); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB1103; H:VI1PR07MB1102.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
x-ms-office365-filtering-correlation-id: 4a997d49-fce3-45c7-e775-08d515f39d7d
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:VI1PR07MB1103;
x-ms-traffictypediagnostic: VI1PR07MB1103:
x-exchange-antispam-report-test: UriScan:(82608151540597);
x-microsoft-antispam-prvs: <VI1PR07MB11037A9BB9CB397A588C619E804D0@VI1PR07MB1103.eurprd07.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR07MB1103; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR07MB1103;
x-forefront-prvs: 0464DBBBC4
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <10A2281F38968941A91554A84138FAA0@eurprd07.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2017 06:44:00.4372 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB1103
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/uyfIjeNkDEADPntSMzGkJkZ_SKg>
Subject: Re: [TLS] Connection ID Draft
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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: Wed, 18 Oct 2017 06:44:06 -0000

On 17/10/2017, 22:35, "Martin Thomson" <martin.thomson@gmail.com> wrote:
> On Tue, Oct 17, 2017 at 9:26 PM, Fossati, Thomas (Nokia -
> GB/Cambridge, UK) <thomas.fossati@nokia.com> wrote:
> > The following case (NAT box reboot) is problematic:
> >
> > 1. Application '1' on host A (A.1) uses DTLS+CID with application
> >    '1' on host B (B.1);
> > 2. Application '2' on host A (A.2) uses plain-old DTLS with B.1;
> > 3. The NAT box reboots (all previous 5-tuple mappings are lost);
> > 4. B.1 receives a record from A.1 (whose 5-tuple has changed in the
> >    meanwhile);
> >
> > How is B.1 supposed to correctly interpret the bytes starting at
> > offset +11?  (For what it knows, it could be CID from A.1 or the
> > length field from A.2.)
> 
> I don't think that this is a problem.
> 
> connection = five_tuples.lookup(packet.five_tuple)
> if (!connection) {
>   connection = connection_ids.lookup(packet[connection_id_offset:connection_id_offset+connection_id_length])
> }
> if (!connection) {
>   // is this a ClientHello?  otherwise drop it
> }

This is quite similar to the trial and error / heuristic that I was
mentioning in [1].

Note that if A.1 and A.2's 5-tuples are swapped, the algorithm fails to
recognise A.1 as CID-enabled and sends it forward to the crypto handler
when it shouldn't. 

It looks simple, but it introduces subtle complexity in that parsing is
not self-contained anymore: it depends on a couple of things (the
connection_ids and five_tuples stores) that in principle should have
nothing to do with making sense of an incoming record.

And the already discussed limitations:
- Fragility on corner cases (e.g., the 5-tuple swap above);
- Forcing middleware to keep state;
- Breaking wireshark & co unless they can see the whole session;
- (Depending on the use case, the cost of the two lookups per record
  on the parsing might have a performance impact.)

> > I might be missing something fundamental here, but isn't the length
> > encoded in the CID field on the wire?
> 
> Not by my understanding.  There isn't any need (the intent is to have
> the CID only consumable by the entity that created it, and any others
> that it collaborates with, like a load balancer).

You are right.  For some reasons, I was implying cid was encoded as a
variable-length array.  That said, I don't think saving 1 byte here is
worth the self-inflicted pain of making tshark unusable :-)

Cheers

[1] https://www.ietf.org/mail-archive/web/tls/current/msg24575.html