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

Eric Rescorla <ekr@rtfm.com> Wed, 23 December 2015 23:05 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 17D281A891E for <tls@ietfa.amsl.com>; Wed, 23 Dec 2015 15:05:37 -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 gKuhvIIOTh43 for <tls@ietfa.amsl.com>; Wed, 23 Dec 2015 15:05:35 -0800 (PST)
Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::22e]) (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 B25501A891D for <tls@ietf.org>; Wed, 23 Dec 2015 15:05:35 -0800 (PST)
Received: by mail-yk0-x22e.google.com with SMTP id x184so210082192yka.3 for <tls@ietf.org>; Wed, 23 Dec 2015 15:05:35 -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=drXk5bmo4NqTDNJQRoqlEfBbdVmJWBupGpoegV9fDXE=; b=rUimjByWqvtKBavk8/dYX6xPkfkMzJOdtjhZlrvzDxihQBzPiyeKqaxg7ISB62/ZeN 4GmclUebqDW7GzKUEgQTtNxIW7DLI0jm74GBbAAKMZcUjHGo5b8jaQww/XJ05VDh53Wl QBsXF7Ao3US/MdtzKE8fxoIqumWXXjiomajOGEmWkh6gdgvM+FRFe+F/Oekdcy2+tAin jic1+KmCvNQ4EqCOHNqkQdjNyphXNf/pWoxevnioAZleTmEVaZ7FnQeiGZ3nncLZl8t8 +Ypd+lChYciCNqqoMn6eDUi6vtAt/67OFl9HTNZ2Pt9jno+y7mDuXoUq9y7tETJ7cOJ0 64fA==
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=drXk5bmo4NqTDNJQRoqlEfBbdVmJWBupGpoegV9fDXE=; b=YqZsz/B/LVSt0BwW79TsRG2wMlyVb7J6ICWrO32rXgoWppt9IN2FIkikL0XJX83FoK N+l9E0JSKruu/js4YKseMA+ZgHNhGr4SBMyuZZrLSEU11MYOhZR6kg59MBYsFp6a6Jou 7Ahk2tO5spBRc8HI/UaEJHKXJ6MUwSGOXLZJAd1UELD2KNzpNCmJbmvJAuuQrdkQd6zX O6ijyY3y0HfDZiR7hGACY3dzJkaluTyUtpj/GH84Q5cFex9KReJDF1LOsWyQsSoFnFt7 ZZ830jWXEED/UpzhCU/zixOuL6TAOIqYHknjEaN3QHpvPtgiLnBH16fkJil/pb+z1IqJ 6B9A==
X-Gm-Message-State: ALoCoQne0cWQSSDhRFsLqUQf2oYPOgT2oEpogkihCjaimIHf2T55/rQSMi/ayQNlTWRcrlShEP2IxGk7uknh3IHCjm/YQiaySw==
X-Received: by 10.129.148.3 with SMTP id l3mr25791040ywg.155.1450911934974; Wed, 23 Dec 2015 15:05:34 -0800 (PST)
MIME-Version: 1.0
Received: by 10.13.249.197 with HTTP; Wed, 23 Dec 2015 15:04:55 -0800 (PST)
In-Reply-To: <DM2PR0301MB06550A43EC188A16E8C8464DA8E60@DM2PR0301MB0655.namprd03.prod.outlook.com>
References: <DM2PR0301MB06550A43EC188A16E8C8464DA8E60@DM2PR0301MB0655.namprd03.prod.outlook.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Wed, 23 Dec 2015 15:04:55 -0800
Message-ID: <CABcZeBO6shkEF1puy+YgEzM8CgRRvmb3sypQUevpKoC=CEj0oQ@mail.gmail.com>
To: Christian Huitema <huitema@microsoft.com>
Content-Type: multipart/alternative; boundary="94eb2c07c8bc7c326c052798c240"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/0hW4Md8_5RsCubzjxpNcMEWQW_0>
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: Wed, 23 Dec 2015 23:05:37 -0000

On Wed, Dec 23, 2015 at 2:19 PM, Christian Huitema <huitema@microsoft.com>
wrote:

> In the current 1.3 draft, section 6.3.4.3 specifies the content of the
> Finished message. It contains this specification for key computation:
>
> client_finished_key =
>     HKDF-Expand-Label(BaseKey, "client finished", "", L)
>
> server_finished_key =
>     HKDF-Expand-Label(BaseKey, "server finished", "", L)
>
> I wonder what the zero length string actually means. Is it a
> null-terminated string that would encode in binary as a one octet byte
> string of value 0, or an empty string that would encode in binary as a zero
> length string?
>

I see what you mean about the ambiguity here. What I meant was 0 bytes
(i.e., no trailing '\0').



There is one example of encoding a string in section 4.8.1, and the binary
> representation shows the encoding of the final null byte. Is that a common
> assumption?
>

No.



> 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.
-Ekr


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