Re: [TLS] A small detail in HMAC key generation for Finished message

Eric Rescorla <ekr@rtfm.com> Mon, 04 January 2016 18:04 UTC

Return-Path: <ekr@rtfm.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 BE0E21A9048 for <tls@ietfa.amsl.com>; Mon, 4 Jan 2016 10:04:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level:
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001] autolearn=no
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 EygakYye9xJj for <tls@ietfa.amsl.com>; Mon, 4 Jan 2016 10:04:13 -0800 (PST)
Received: from mail-yk0-x22b.google.com (mail-yk0-x22b.google.com [IPv6:2607:f8b0:4002:c07::22b]) (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 549171A904A for <tls@ietf.org>; Mon, 4 Jan 2016 10:04:13 -0800 (PST)
Received: by mail-yk0-x22b.google.com with SMTP id x67so255380202ykd.2 for <tls@ietf.org>; Mon, 04 Jan 2016 10:04:13 -0800 (PST)
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:content-type; bh=9cxGGVqrIWf/m9PfKhkBE/biq1Vpcbs1YgbHI2roF2Q=; b=lh/Y3BIXdcXQHkBHm8otp/78IfSD5yJRkUd2W/khWQGy5t1o5F+RT3l0FNp/vPvHSf MP5c7b+V7I+Kl6TuH6UH+CCAcnk4INYmdx31I5eUPP2BUPDzN2dNof9PLWI4tbdHf76k 9fel69wD2+P9BwjLFWVkFuk4e2ES0CfElIdi/efMy1VkjgSXReaJRpMj2IbyrWJlA/2d /+2z7dkrAhYzPg6HoX39VvyrhmM4IjKgUvEbtLFhLE6kFaBeiSeejHyYsu+c9A2mTNGB vUeFrLXVqHtyH6/zcknTNavgasiXgg8hMzODcN9aBoCVReDdjfHAILwzQ7rdE/y3vJJ0 bOhA==
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:content-type; bh=9cxGGVqrIWf/m9PfKhkBE/biq1Vpcbs1YgbHI2roF2Q=; b=fhzqrMyW/9dwrYUnHSF/A0qc8NOcssGY2zfJCLqge2RbJUqRo3fNOh5WP0B2hkh3Q+ MwRIPDPBueONuf4T40wVDwMQz8JcVvkIcEOtEUbA5cYmJkbw70YBqeomhkOLRyvUH88g Xvq9d3yZP7Liw0eh8QkBFpPaDwdmtkKj4DEP5QeQOrGVEGKd9E22VoYPn+81Q1y0t/IF 6ZRWpdRUWp4adWNrgqbwIWwNYTAs/26Iqi1wbagZql4Jd6kgo7uArjVCgCBiiH3Zx7hK Q29J8D8rxbFeSUWfZiam4TyCsk0Ii24I54Yr55SKUop9Ujo6oyUXnzAgjh76tRqg97gp nptw==
X-Gm-Message-State: ALoCoQk+LdXzmEW8KB0cqD1BqeYGwDIL1H2W44o/4xMXcbwvfp39YI0kOFkusS4Tat+YbNIFRQZnNXTQ5ylYwIa2T2yLLx1djA==
X-Received: by 10.13.218.198 with SMTP id c189mr71055727ywe.165.1451930652622; Mon, 04 Jan 2016 10:04:12 -0800 (PST)
MIME-Version: 1.0
Received: by 10.13.249.197 with HTTP; Mon, 4 Jan 2016 10:03:33 -0800 (PST)
In-Reply-To: <4038107.aFUxodDpT4@pintsize.usersys.redhat.com>
References: <DM2PR0301MB06550A43EC188A16E8C8464DA8E60@DM2PR0301MB0655.namprd03.prod.outlook.com> <1559494.V2ctEmMh08@pintsize.usersys.redhat.com> <CABcZeBNac32MDfkSE7BbScHNTZOyr2k+oO+7r23VabPz=o+0BQ@mail.gmail.com> <4038107.aFUxodDpT4@pintsize.usersys.redhat.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Mon, 04 Jan 2016 10:03:33 -0800
Message-ID: <CABcZeBPLg--m2OqUW+D0_A_xhtgb7_mOcCTt+DiSHkAkJqbQcQ@mail.gmail.com>
To: Hubert Kario <hkario@redhat.com>
Content-Type: multipart/alternative; boundary="94eb2c08192ac9f51d052885f248"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/gTsSBvfTjveUxomD1NQZjQnsbrg>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] A small detail in HMAC key generation for Finished message
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: <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: Mon, 04 Jan 2016 18:04:14 -0000

On Mon, Jan 4, 2016 at 9:58 AM, Hubert Kario <hkario@redhat.com> wrote:

> On Monday 04 January 2016 09:44:57 Eric Rescorla wrote:
> > On Mon, Jan 4, 2016 at 9:22 AM, Hubert Kario <hkario@redhat.com>
> wrote:
> > > On Thursday 24 December 2015 01:04:59 Christian Huitema wrote:
> > > > On Wednesday, December 23, 2015 3:05 PM, Eric Rescorla wrote:
> > > > >> Similarly, in the HKDF-Expand-Label, do we assume a final null
> > > > >> byte
> > > > >> for the "label"?>
> > > > >
> > > > > No. I wonder if we should instead add the '\0' explicitly in the
> > > > > 4.8.1 for maximal clarity.
> > > >
> > > > Either that, or just remove the trailing 00 from the binary
> > > > description.
> > >
> > > the 0-byte is a C-ism that looks like a wart to me
> > >
> > > neither of the previous TLS versions used null-terminated C-style
> > > strings so why TLS1.3 should? Especially in just one place
> >
> > The idea is to make this prefix-free. I added it as an explicit byte
> > but would
> > be ok with a different separator as long as we banned it from the
> > context strings.
>
> Calling it explicitly a separator would be less confusing.
>

Ask and ye shall receive: http://tlswg.github.io/tls13-spec/#digital-signing


"Following that padding is a context string used to disambiguate signatures
for different purposes.
The context string will be specified whenever a digitally-signed element is
used. A single 0 byte is
appended to the context to act as a separator."


Advising implementers to check other values passed in for it and
> aborting if detected would be even better
>

This seems like it's probably not necessary because these strings are
standardized
and internal to the implementation.

-Ekr


> --
> Regards,
> Hubert Kario
> Senior Quality Engineer, QE BaseOS Security team
> Web: www.cz.redhat.com
> Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic
>