Re: [TLS] Why is resumption_context hashed?

Eric Rescorla <ekr@rtfm.com> Fri, 15 July 2016 11:59 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2FFA012D511 for <tls@ietfa.amsl.com>; Fri, 15 Jul 2016 04:59:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
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 m784iqQOk_-v for <tls@ietfa.amsl.com>; Fri, 15 Jul 2016 04:59:53 -0700 (PDT)
Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (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 6AAEC12B058 for <tls@ietf.org>; Fri, 15 Jul 2016 04:59:53 -0700 (PDT)
Received: by mail-yw0-x233.google.com with SMTP id l125so99430402ywb.2 for <tls@ietf.org>; Fri, 15 Jul 2016 04:59:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tZ2CMwlNHFKRtHQbnZnvy/aVBSgV5LV29pDNROci26I=; b=YC48GF5F8pESEg2LjGdszve4ma4D6tZ8DjSjdCEnXmdCoDk0dVZjqvdkIGwMzi6evW gKDw2AaAu07mh/oj8wEsTuMS2xXyP7deHWQoVU+xwYHPjJSlQ5+OBQSbu5HGAKMBpaEr +hXsv3ODh5I3ZIazoSSF+n5HCHewcbQX1QwEmoGCPQDc+xyzP5TK19a4HjNnLARXeNyC hVEDJxKnzHUY20HdW9eBMvxTxzs9mkzT4SAgwXkXSIrEdAXuIOwseA83EP2ZciOAYn/i EDbJWKppO2cTE0Y6awh6JUo/KObITHcuMG2BNZd9i6A6Fp/BwSWmDp6TCgMuAowJF7OT H7iw==
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:from:date :message-id:subject:to:cc; bh=tZ2CMwlNHFKRtHQbnZnvy/aVBSgV5LV29pDNROci26I=; b=fGMTzWn2qBJlFhDygJUWTj2q9XbvCv8ApJpec2B8KyyLZ/EmZcqAJf36Y5RfZCJKRn vB+Kd3TAdZbnjZfXbItLg5CkijRv6f9lmozdX9jTn/SlhQLdkNAIaAdHjQRbbH8DQNkC 90D2thEh1N81+2KhXJsh9B5ZZxXUIVJagUvVoHMOIYkl1yG5v5Tvj8IQMs0k2HP+Ug8D 2IGtLIqfri6vn2iMlvYaXcOJW1cQbt2bE7fhbD/3Qj4bMTo25C94XLaA5YeNXSwoyXRO jPeMRHRffTIdLF3T3x2CjKGXAmge+2FEKiOjPBAJ1M+Vxd1T4uNmWAn+xe0VtD8RVK/O Eb7g==
X-Gm-Message-State: ALyK8tKmFUv/Tfv3Lt/SPZgSxpp82tEwImnX6CQiyR/Kfr5Heju+XGpNkSqc5ia8Cfvy+CaSG19e6hBdbSNeXA==
X-Received: by 10.37.211.132 with SMTP id e126mr12878825ybf.74.1468583992717; Fri, 15 Jul 2016 04:59:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.152.13 with HTTP; Fri, 15 Jul 2016 04:59:13 -0700 (PDT)
In-Reply-To: <CAF8qwaB8W20pwUk2bFo5854ZXmZ+mmprn4esc=L0v2r84XwdrA@mail.gmail.com>
References: <CAF8qwaB8W20pwUk2bFo5854ZXmZ+mmprn4esc=L0v2r84XwdrA@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Fri, 15 Jul 2016 12:59:13 +0100
Message-ID: <CABcZeBMwpoijh7bJiWQn0T+p78ie+=O_R=+mY8h3=U0QuQ1vrA@mail.gmail.com>
To: David Benjamin <davidben@chromium.org>
Content-Type: multipart/alternative; boundary=94eb2c14710a35a7330537ab5b67
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/z5Ufkh2r6QNLkwyztoMeh2IxlVk>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Why is resumption_context hashed?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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, 15 Jul 2016 11:59:55 -0000

On Fri, Jul 15, 2016 at 11:39 AM, David Benjamin <davidben@chromium.org>;
wrote:

> Every time resumption_context is used, it's fed into the PRF hash.
> Handshake Context gets hashed since that actually expands to the full
> concatenation and we want to be able to maintain a rolling hash.
> But resumption_context is always a short value and is already the size of
> the PRF hash. (If not resuming, it is the zero key, which is sized
> appropriately. If resuming, it is the size of the PRF hash of the original
> connection. But we require that resumptions use the same PRF, so that too
> will be the right size.)
>
> Was there some other reason we needed to hash it, or is a guarantee of
> constant size sufficient to use it directly? If it still needs to be
> hashed, it seems we ought to redefine resumption_context to be
> Hash(HKDF-Expand-Label(...)) instead, mostly as a hint to implementors that
> one may as well store the final value in the ticket.
>

I didn't have a good reason. It was just giving me the heebie jeebies
(technical term) to append something that wasn't hashed to something that
was.

-Ekr


>
> David
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>
>