[TLS] New TLS version negotiation mechanism, take 2

Dave Garrett <davemgarrett@gmail.com> Thu, 26 March 2015 07:30 UTC

Return-Path: <davemgarrett@gmail.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A3FF01A7002 for <tls@ietfa.amsl.com>; Thu, 26 Mar 2015 00:30:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.4
X-Spam-Level:
X-Spam-Status: No, score=-1.4 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, J_CHICKENPOX_55=0.6, SPF_PASS=-0.001] autolearn=no
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 w3zX9mktL1XW for <tls@ietfa.amsl.com>; Thu, 26 Mar 2015 00:30:46 -0700 (PDT)
Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1BF361A8837 for <tls@ietf.org>; Thu, 26 Mar 2015 00:30:46 -0700 (PDT)
Received: by qgh3 with SMTP id 3so69830840qgh.2 for <tls@ietf.org>; Thu, 26 Mar 2015 00:30:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; bh=TSn3LnuzUQkbdHDj3YE66l2KYSowedNVy9C8A1v5EqM=; b=0HzLLd9u5bx6pSszgZmezyY9h7K+r/fJEklF1pEO6xSijTRxlcoZuBNTYy2LNK8YyR gVxxfkXWFMGDc+wneXKu9REsQ0H3yHXQ2ImtwU98dINIInRThYEX9SDgRydXbjtbWUBt ldwf0y+yCcJtzpFzLhTj4UeUwGW2mIYZKe5SzBhyVNxnNh2sgvB3eoC4MIQxvUDKtwVr Sphh8UsTUy8XvEmArPvHsx+dUxSQNrlpBnQg6Ik5Q/ZeKMdKjItLLg0brgDGL3sz9oAd f/nuN4pMR85e82TvnI/09wzMvCvas+ZyHSoSGFM8fhUKo5gPVQWRRI5etYe/sW27iHGt 3Nfw==
X-Received: by 10.229.118.5 with SMTP id t5mr16932087qcq.19.1427355045443; Thu, 26 Mar 2015 00:30:45 -0700 (PDT)
Received: from dave-laptop.localnet (pool-96-245-254-195.phlapa.fios.verizon.net. [96.245.254.195]) by mx.google.com with ESMTPSA id g34sm3072196qgd.0.2015.03.26.00.30.44 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Mar 2015 00:30:44 -0700 (PDT)
From: Dave Garrett <davemgarrett@gmail.com>
To: tls@ietf.org, Brian Smith <brian@briansmith.org>
Date: Thu, 26 Mar 2015 03:30:42 -0400
User-Agent: KMail/1.13.5 (Linux/2.6.32-71-generic-pae; KDE/4.4.5; i686; ; )
MIME-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-Id: <201503260330.43588.davemgarrett@gmail.com>
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/ea8Zzah8vBboQ-XQC5WlLrMRueU>
Subject: [TLS] New TLS version negotiation mechanism, take 2
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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: Thu, 26 Mar 2015 07:30:47 -0000

Based on feedback in the previous discussion, I think I've cobbled together a framework that might be good to use.

* A new extension that contains a single ProtocolVersion, with its value named max_version
* Rename ClientHello.client_version to min_version
* Rename ServerHello.server_version to negotiated_version
* Convert ProtocolVersion to a 16-bit enum, with equivalent values to existing struct format
* The values are as follows:

1) record layer version frozen to TLS_version_1_0(0x0301)  (PR #107)
2) ClientHello.min_version set to TLS_version_1_2(0x0303)
    (for clients supporting TLS 1.2, this is a constant;
     clients not supporting TLS 1.x set this to their higher min version)
3) Both endpoints set their max_version (in ext) to their max supported version
    (all clients send; all servers reply if clients send; these values are constant based on config)
4) ServerHello.negotiated_version is picked in a manner similar to now, but from the endpoints'
    max_version fields. If the new extension is not supported, it transparently falls back to
    TLS 1.2, and old servers will fall back to TLS 1.0/1.1 if needed.

Servers now have a min_version from client to not offer to fall back too far at all. Version IDs 0x0304 through 0x03FF can be assigned as IDs for upcoming draft versions. The final version will be assigned 0x0400. As there's no longer an attempt to do something vaguely akin to major.minor, the values are arbitrary and can be assigned for draft/experimental versions as needed. Negotiation logic specifies that servers picking a lower version must pick a stable version if the client did not explicitly offer a supported experimental version.

This seems to get pretty much what we want here:
+ TLS 1.3+ version intolerance is not an issue, unless the client refuses to negotiate TLS 1.x, in which case it doesn't matter. (it won't work regardless of the server responding ideally or not)
+ Only one extension with one fixed length value
+ Both stable and draft/experimental versions can use the same negotiation mechanism (and get tested)
+ It's more or less as simple as can be, given that we're hacking in a new mechanism on top of the old. Yeah, lots of version fields, but almost all are constants.
+ All the various version fields are now named so as to indicate what they're actually for

Ditching the version field from the encrypted records is a very good idea to go along with this, as it's useless and yet another version field to confuse things.

I've created a branch with a very WIP set of changes. I have not updated the backwards compatibility section for this new system fully yet. (just a bunch of TODOs listed there) The other appendix bits are not added either, and there's a few other spots that need some extra explanation. This is just to get the main idea of this proposal for discussion. This is based on PR #107:

https://github.com/davegarrett/tls13-spec/compare/patch-3...davegarrett:NVN


Dave