Re: [TLS] Kill Finished (and other tricks for hardware)

Michael StJohns <msj@nthpermutation.com> Fri, 18 April 2014 16:10 UTC

Return-Path: <msj@nthpermutation.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 887F91A02A4 for <tls@ietfa.amsl.com>; Fri, 18 Apr 2014 09:10:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] 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 MBcgAwDvWO6D for <tls@ietfa.amsl.com>; Fri, 18 Apr 2014 09:10:50 -0700 (PDT)
Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178]) by ietfa.amsl.com (Postfix) with ESMTP id AA8051A0256 for <tls@ietf.org>; Fri, 18 Apr 2014 09:10:50 -0700 (PDT)
Received: by mail-qc0-f178.google.com with SMTP id i8so1809500qcq.23 for <tls@ietf.org>; Fri, 18 Apr 2014 09:10:46 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=HTcWalu2iPMkaoICaDzXpVou4LJudN6HDVCGzOABXcU=; b=b2YtylSXrWm6lJx0K1fCqrsu2Cdex3qItP83qE3GbubieXSKMOFrtcjAEGJpOtk8Uj /sxn6LqkHxg1HLt5Lf2yFshezs5rZOAaqpXSziYFwGJR/JYmzHmSqJ4N4z5+kUfdTRNG rLmz0YY4gUfwx/sxWD65T4G16bm+RWDWZkaPV3sLPEFvYiA0nqY6r/vE/DHMhETkN2+3 IDM73SZovY31aSmFKXBeknZ2yG1xz6rYZg5FDpcM+HzTgITW2XJleh8/8EEUI7WrBo1A 339wDcbcL5ytCiPxwNuWdMSVxdysn7TkTYsGTIXgmA2GBBSikEkbFuxxQ0w3PF2aLLeI 4OSg==
X-Gm-Message-State: ALoCoQkfzdbdYd2dX2TYK6KUBnCeD/4Ta7FXfh4XnV39QTbpPdg7s2LRPq9UdfiqJDv76wkBgaci
X-Received: by 10.224.22.65 with SMTP id m1mr3626983qab.103.1397837446533; Fri, 18 Apr 2014 09:10:46 -0700 (PDT)
Received: from [192.168.1.105] (c-68-34-113-195.hsd1.md.comcast.net. [68.34.113.195]) by mx.google.com with ESMTPSA id b3sm56403878qae.2.2014.04.18.09.10.45 for <tls@ietf.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Apr 2014 09:10:45 -0700 (PDT)
Message-ID: <53514E89.5000208@nthpermutation.com>
Date: Fri, 18 Apr 2014 12:10:49 -0400
From: Michael StJohns <msj@nthpermutation.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version: 1.0
To: tls@ietf.org
References: <CACsn0cm7CU3HBOY-m90+HwGBuw+nZ7vyqRdHZcfDjw7wiTmDMw@mail.gmail.com>
In-Reply-To: <CACsn0cm7CU3HBOY-m90+HwGBuw+nZ7vyqRdHZcfDjw7wiTmDMw@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/3HDLvHk9AxSSeDtzTgZSv1Efgbc
Subject: Re: [TLS] Kill Finished (and other tricks for hardware)
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, 18 Apr 2014 16:10:52 -0000

On 4/17/2014 9:03 PM, Watson Ladd wrote:
>
> Finished dies. Instead we hash the entire handshake, certs and all
> into the master secret. This has the side effect of making life for
> cryptographers a lot nicer. I've not figured out resumption quite yet:
> maybe this is a problem there. I've also probably missed some other
> outputs that need munging or replacements.
>
> This way the PRF is only used to generate keys, so it can be marked at
> such. There aren't any security implications: we've replaced finished
> with the master secret hashing, so the only way to get two identical
> master secrets is from identical exchanges.
>
>

Not quite.  You missed that IVs are generated using the PRF and that's 
another problem.


My PRF proposal is to change the PRF to a counter based PRF

prf_step (i, secret, label, context, total_length) =
      MAC (secret, i + label + 0x00 + context + total_length); // i and 
total_length are uint32 big endian

prf_data (secret, label, context, total_length) =
      CONCAT (i = 1 to CEIL(total_length/blocksize), prf_step (i, 
secret, label, context, total_length))[0..total_length-1];


For deriving keys, you use the above construct and a master secret. For 
using this for the production of random public data (e.g. IVs), you use 
a '0' key of the appropriate length.  The externalized functions are the 
KDF function (which passes in a key) and the DRBG (deterministic random 
bit generator) (which doesn't pass in a key), but the underlying 
implementation is common.  The PRF function is never externalized.

The above construct is the same as defined in NIST SP800-108 (no, not 
dual EC...) and is similar to KDF and DRBG constructs used with X9.63, 
ECDH etc

Mike