Re: [TLS] Explicit use of client and server random values

Mike Hamburg <> Fri, 18 December 2015 20:55 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 806541B306F for <>; Fri, 18 Dec 2015 12:55:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 1.556
X-Spam-Level: *
X-Spam-Status: No, score=1.556 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FH_HOST_EQ_D_D_D_D=0.765, FH_HOST_EQ_D_D_D_DB=0.888, HELO_MISMATCH_ORG=0.611, HOST_MISMATCH_NET=0.311, HTML_MESSAGE=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id qbj0lCSEjTDq for <>; Fri, 18 Dec 2015 12:55:47 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 136251B2BDF for <>; Fri, 18 Dec 2015 12:55:47 -0800 (PST)
Received: from [] (unknown []) by (Postfix) with ESMTPSA id A79093A9C5; Fri, 18 Dec 2015 12:51:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;; s=sldo; t=1450471892; bh=ey9wVzaFTLYews146mDSB/k1ZQCe27LWuRnjT8aTYAM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=kiyYPXJVYV1sEY6f+3j3SV80bKJeJLP/vtbJFsiDj5nVnBKTX5Yu/KZ0/faR/qKYI HwCi/2/+f1VqzNQVM003MnrwJy0Ve27sOkJAS9GYXGOwvhjLwehuGi14sRwGuDbneY yjTiYWnSZa+J3i3tJjVsG8Vm5gqZ32aZf03HYWlQ=
Content-Type: multipart/alternative; boundary="Apple-Mail=_91EA2F86-008F-4EB7-8943-65F33B2BB420"
Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\))
From: Mike Hamburg <>
In-Reply-To: <>
Date: Fri, 18 Dec 2015 12:55:45 -0800
Message-Id: <>
References: <> <> <> <> <> <> <> <> <>
To: Hugo Krawczyk <>
X-Mailer: Apple Mail (2.3112)
Archived-At: <>
Cc: "" <>
Subject: Re: [TLS] Explicit use of client and server random values
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." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 18 Dec 2015 20:55:49 -0000

Whoops, big-R to reply all...

> On Dec 17, 2015, at 9:39 PM, Hugo Krawczyk <> wrote:
> On Thu, Dec 17, 2015 at 5:33 PM, Mike Hamburg < <>> wrote:
>> On Dec 17, 2015, at 12:11 PM, Eric Rescorla < <>> wrote:
>> On Thu, Dec 17, 2015 at 3:02 PM, Hugo Krawczyk < <>> wrote:
>> I have mentioned this in private conversations but let me say this here: I would prefer that the nonces be explicitly concatenated to the handshake hash.  That is, 
>> handshake_hash = Hash(
>>                             client random            ||
>>                             server random            ||
>>                             Hash(handshake_messages) ||
>>                             Hash(configuration)      ||
>>                            )
>> The reason is that nonces are essential for freshness and session uniqueness and I want to see them explicitly included in the signed/mac-ed/KDF-ed information. I can envision a future variant/mode of the protocol where parties do not transmit nonces but have a synchronized state that they advance separately and use as nonces (e.g., for key refreshing) - in such case the nonces would not be included in the handshake-hash computation.
>> So while the redundancy of having them twice in the handshake_hash calculation may be annoying, this adds robustness to the security (and analysis) of the protocol.
>> This change doesn't make implementation or specification significantly more difficult.
>> Does anyone  else object or feel it makes analysis harder? :)
>> -Ekr
> While I haven’t been following TLS 1.3 development all that closely, I will question this request.
> TLS is annoying to implement and analyze in part because it hashes more-or-less arbitrary parts of the handshake messages together, in arbitrary order, at arbitrary times.  Removal of all the explicit hashing of client/server random in TLS 1.3 makes it clearer what’s going on, and makes implementations simpler. 
> ​How does removal of explicit hashing of the nonces make things clearer? What are the things that are made clearer?
> ​ 
>  Some of the crypto operations still feel pretty arbitrary (particularly Finished), but things seem to be improving overall.  In this context, it feels like​​ adding client random and server random back to the hash is a regression.
> ​What do you mean by ​ ​"​ adding client random and server random back to the hash is a regression​"?
> Why "back"? Were they removed? What's the regression?
> You are probably not suggesting to omit them, right? Are you worried about the redundancy of being hashed twice? Is it a security issue or an implementation issue?
> ​.​
> From an analysis point of view, the client and server random are parseable from Hash(handshake messages) because they are concatenated with framing information.
> ​They are parseable, but I am not sure they are *uniquely* parseable - a fixed location in the stream does make them uniquely parseable.
> ​ 
>  But here, they are concatenated without framing information.  
> ​The nonces are the main framing information - they are the (honest parties') unique identifier of the handshake.
> ​ 
> So I don’t understand Hugo’s contention that the old scheme leads to trouble if the nonce changes sizes in a later version, and that the new scheme does not.  It seems to me that the reverse is more likely to be true.
> ​I'm clearly not following your argument.
> ​Hugo
> ​
> Cheers,
> — Mike

Sorry Hugo, I misread the proposal as using the nonces and handshake hash when signing, but not elsewhere.  On rereading, it is still entirely consistent, and isn’t being added “back” anywhere, except perhaps to some memory structure in the handshake code.  It also definitely isn’t a security problem, and it isn’t as annoying for implementations as I had figured (but it does require extra memory, which I had hoped to see removed).

However, I’m somewhat confused about your statement that the framing information is the honest parties’ unique identifier of the handshake.  I had thought that TLS 1.3 was going to a model where the handshake trace (and configuration, for 0-RTT) was the real session identifier, and the nonces were there exclusively to make that trace unique.  This is a huge improvement from TLS 1.2, where the session identifier is sometimes the nonces and sometimes the trace and sometimes something in between (Server Certificate Verify eg).  It further means that future versions could drop the nonces entirely if they require one-use ephemeral key exchange.  It seems that you’re suggesting that the session identifier is the tuple (nonces, trace, configuration), which seems redundant to me.  Perhaps it is required by the security model (eCK?) to have a stable session identifier?

I’m concerned about parseability in two ways.  One, if the nonces ever change size in future versions, or are omitted due to required one-use ephemeral key exchange, then we will have to change how handshake_hash is calculated, and we will have to make sure that it cannot cause problems due to collisions with the current handshake_hash calculation.

Two, if the handshake messages fed into the hash function are not uniquely parseable, that’s going to be a serious problem for analyzing TLS 1.3, and should be a top priority to fix.

— Mike