Re: [TLS] Pull request for session hash

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Tue, 23 December 2014 14:26 UTC

Return-Path: <ilari.liusvaara@elisanet.fi>
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 9E7DA1ACEC8 for <tls@ietfa.amsl.com>; Tue, 23 Dec 2014 06:26:58 -0800 (PST)
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=[BAYES_40=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 DfB56BpkkpQW for <tls@ietfa.amsl.com>; Tue, 23 Dec 2014 06:26:52 -0800 (PST)
Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A7D031ACEC6 for <tls@ietf.org>; Tue, 23 Dec 2014 06:26:51 -0800 (PST)
Received: from LK-Perkele-VII (a88-112-44-140.elisa-laajakaista.fi [88.112.44.140]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 30845188824; Tue, 23 Dec 2014 16:26:48 +0200 (EET)
Date: Tue, 23 Dec 2014 16:26:48 +0200
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
To: Eric Rescorla <ekr@rtfm.com>
Message-ID: <20141223142648.GA11149@LK-Perkele-VII>
References: <CABcZeBNj2n-UM-qwVH8PSV+7MgS6kNxzqQZ20J3DtfZ8tLg9-Q@mail.gmail.com> <CABcZeBM9BonSs0PUF4BvRvRQ7L3-TL7n-XLGm_AtDypbWj3a5w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <CABcZeBM9BonSs0PUF4BvRvRQ7L3-TL7n-XLGm_AtDypbWj3a5w@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Sender: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/WXjpIISy2RoD-WRmqvrTxHye0W8
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Pull request for session hash
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: Tue, 23 Dec 2014 14:26:58 -0000

On Mon, Dec 22, 2014 at 01:33:13PM -0800, Eric Rescorla wrote:
> I've posted an updated PR at:
> 
> https://github.com/tlswg/tls13-spec/pull/89
> 
> Note that I did not restore the ChangeCipherSpec message as my sense of
> the WG discussion and private conversations was that people preferred to
> have it gone. If you feel strongly about this change one way or the other,
> and haven't already posted to the list about it, please do so now, as I'd
> like to resolve this and merge this PR this week.
> 

(General philosophical note: I'm in favor of more complicated protocol if:
- It fixes something that is just plain nasty to analyze, or
- It causes bad implementations to break fast instead of being security
timebombs.)


Regarding CCS removal, I'm very much in favor.


Reading through this, some comments:

"At this point, the handshake is complete, and the client and server may
exchange application layer data, which is protected using a new set of
keys derived from both the premaster secret and the handshake transcript
(see {{I-D.ietf-tls-session-hash}} for the security rationale for this.)"
 
AFAIK, I-D.ietf-tls-session-hash doesn't really contain security rationale
for this. It only has security rationale for hashing exchange keys (which
are included in the first keying anyway) and says about including
certificates (paraprhased): "Compliant with NIST recommediations" and
"SSH does this" (actually, it only does that for server key, not client
key).

Now, if EncryptedExtensions contains extensions that twiddle with some
critical parameters, there is very much reason to rekey after that.


"[[OPEN ISSUE: Should we restart the handshake hash?
https://github.com/tlswg/tls13-spec/issues/104.]]"

I regard restarting the hashes as very dangerous (not that I think that
the whole HRR is a good idea, but I don't say more about that).

Yes, I know that the hellos MUST be the same. But didn't we have a
case of MUST being violated leading into a nasty security hole recently?

If hashes are restarted and 1st ClientHello and HelloRetryRequest can be
tampered with, the conseqences are not something I want to even try to
analyze (implementation-dependent!).

If hashes are continued, then it requires MITM to modify anything in
key exchange. And the latter authentication pass should be able to
detect that MITM.


"This master secret value is used to generate the record protection
keys used for the handshake, as described in {{key-calculation}}. It is
also used with TLS Exporters {{RFC5705}}."

Wasn't there an idea for giving TLS Exporter its own master secret?

That would stop applications from exporting important system keys.


"If the server does not request client authentication, the master
secret can be computed at the time that the server sends its Finished,
thus allowing the server to send traffic on its first flight (see
[TODO] for security considerations on this practice.) If the server
requests client authentication, this secret can be computed after the
client's Certificate and CertificateVerify have been sent, or, if the
client refuses client authentication, after the client's empty
Certificate message has been sent."

Server can't send data on first flight (to anonymous recipient) if
it requests client authentication? E.g. HTTP/2 settings blocks,
protocol banners or various other protocol capability negotiations.

Obviously, generating the resumption premaster secret has to wait for
client finished (otherwise one can run into trouble with just
transport glitches, no attackers required).


Looks like for the resume case, the ClientHello and ServerHello are
hashed into keys. I think this should be done (I don't se attacks
otherwise, but that doesn't mean there could not be one... This
is another of those "I don't want to analyze that" places).


-Ilari