Re: [TLS] Interaction between session resumption and negotiated protocol version

Brian Smith <brian@briansmith.org> Fri, 03 April 2015 23:48 UTC

Return-Path: <brian@briansmith.org>
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 BEAC01A87AE for <tls@ietfa.amsl.com>; Fri, 3 Apr 2015 16:48:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.979
X-Spam-Level:
X-Spam-Status: No, score=-1.979 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
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 o6ZwQHCGD3Ke for <tls@ietfa.amsl.com>; Fri, 3 Apr 2015 16:48:58 -0700 (PDT)
Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171]) (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 36C9A1A87A7 for <tls@ietf.org>; Fri, 3 Apr 2015 16:48:58 -0700 (PDT)
Received: by obbfy7 with SMTP id fy7so102841771obb.2 for <tls@ietf.org>; Fri, 03 Apr 2015 16:48:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=DXXV+AcUXDu/xQePrv4HnvGKgJts2Xl3KuFU3jL5r24=; b=XU0On6wEeQr2OlUaE47VxlORSlBLtGwsjGloNeIpPv9yXpPWSdcpSyGqciDEzHhgsB KBZjbO7nKo79nAc2PFxlkb1M/meogVJmNoGot6pyGw1klU9s+00aOMsYbFOUF9RNpbXW KE6o29S3yr4oe+d6sItJUjUGA7HMTDZDtbCUvHMoFFmpQsDiG0hY4RvX1HBvifL356VO kZOvD84/j8sE23CDjzBBIkUtD23/0SkV0ZW1iTSzVtMEo5GYoPtlaHEcCplB9IDa0QSj HkqyqJ8XbZjwW6Fu/elbumbjeZ4n5h0zWF8swjxtY1XjYAzi/j0A9aVbXaa5AjWso8vi 8zFw==
X-Gm-Message-State: ALoCoQk0iCcPh1RH/W1xykZdCgbfJL6DPUVFSSnwrcxWn8jPBCgazj67CMNbpYnLd+papndJL1ze
MIME-Version: 1.0
X-Received: by 10.182.255.231 with SMTP id at7mr5573288obd.20.1428104937660; Fri, 03 Apr 2015 16:48:57 -0700 (PDT)
Received: by 10.76.20.146 with HTTP; Fri, 3 Apr 2015 16:48:57 -0700 (PDT)
In-Reply-To: <CANOyrg9BSVAtVC4y34jMi-OAbK5OHMFsTUOhxRJqgGKGzO41xQ@mail.gmail.com>
References: <CANOyrg9BSVAtVC4y34jMi-OAbK5OHMFsTUOhxRJqgGKGzO41xQ@mail.gmail.com>
Date: Fri, 03 Apr 2015 13:48:57 -1000
Message-ID: <CAFewVt7TJMKrQ+jxUYN2gh6rB2BFN_gT+xN_HgT8j0h3Qf1wpg@mail.gmail.com>
From: Brian Smith <brian@briansmith.org>
To: Fabrice Gautier <fabrice.gautier@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/e0BtfwP5_YtFVFbn8MXhmUP6l0s>
Cc: "<tls@ietf.org>" <tls@ietf.org>
Subject: Re: [TLS] Interaction between session resumption and negotiated protocol version
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: Fri, 03 Apr 2015 23:48:59 -0000

Fabrice Gautier <fabrice.gautier@gmail.com> wrote:
> Given that, it seems that it's acceptable for a server to attempt to
> resume a session with TLS 1.2 that was originally established with TLS
> 1.0, or vice-versa.

Perhaps one could construct a logical argument for that. However, is
it really worth the complication for the server to try to resume a
session that was established at a different version than it would
otherwise create a new session? I doubt any potential benefit would
outweigh the likely harm of doing so.

> That seems wrong, but I also guess this is a very plausible scenario
> given that many implementation do version fallback if something goes
> wrong.

Two wrongs don't make a right.

> (3) Cache the old ServerHello.version and do not resume unless the
> cached version is the max of ClientHello.version and max supported
> Server version. (e.g.: Do full handshake at best version instead of
> downgrading to a lower cached version)

<snip>

> My guts tell me that (3) is the right thing to do.

Yes!

Here's another way of thinking about it: Given
ClientHello.client_version and the max version the server supports,
calculate ServerHello.server_version. Then, look in the session cache
for an entry that has the *exact same* ServerHello.server_version. If
you find one, resume that session. Otherwise, do a full handshake.

If you want to be really careful, also calculate cipher_suite before
resuming, and only resume a session that has the same cipher_suite.

Cheers,
Brian