Re: [TLS] Truncated HMAC: what to do with the MAC key?

Benjamin Kaduk <bkaduk@akamai.com> Fri, 07 July 2017 16:27 UTC

Return-Path: <bkaduk@akamai.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 7B45E131613 for <tls@ietfa.amsl.com>; Fri, 7 Jul 2017 09:27:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=akamai.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 CwqaXAYmRYYy for <tls@ietfa.amsl.com>; Fri, 7 Jul 2017 09:27:20 -0700 (PDT)
Received: from mx0b-00190b01.pphosted.com (mx0a-00190b01.pphosted.com [IPv6:2620:100:9001:583::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E8B2712EC0D for <tls@ietf.org>; Fri, 7 Jul 2017 09:27:19 -0700 (PDT)
Received: from pps.filterd (m0050093.ppops.net [127.0.0.1]) by m0050093.ppops.net-00190b01. (8.16.0.21/8.16.0.21) with SMTP id v67GPwi0024560; Fri, 7 Jul 2017 17:27:07 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type; s=jan2016.eng; bh=4CyZvixhD3LCN0vpk5td6ZepE0UFuhid4VkuLSR+Aqs=; b=RiXlmn/x9ZxigkO7a+SKJPJo8EsRmEOhBleOIGnwowLLg56nzyvAQlKK5pxIhU19eIQ0 AOjcbn3c/ja4HyakVgkG+5x8QFE3mQBhau9bhQiCFoaRzWQoZi4aY0ChJBEpU8XKJodX NkGEZTKSFBUN2lkCU0BXBnaTEqgQncEzxnbftE5qhzawjoAoKmj/DaBEHsgtAqvEZzb3 EogtfmrO7gQTYbRCMDHhY8Oswcq6d+7jAPmXOyDBFE3CdMEdqTUEqhzSbnAUAMl4QjfO x8ZseXS4sF06i1PDQWjjsILdN5IfX8KGTMQ0bBw8nEUE566S5e3hide8+WZkavigRSe1 jQ==
Received: from prod-mail-ppoint2 (a184-51-33-19.deploy.static.akamaitechnologies.com [184.51.33.19] (may be forged)) by m0050093.ppops.net-00190b01. with ESMTP id 2bhry24gja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jul 2017 17:27:07 +0100
Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.16.0.17/8.16.0.17) with SMTP id v67GQ3s5015749; Fri, 7 Jul 2017 12:27:06 -0400
Received: from prod-mail-relay11.akamai.com ([172.27.118.250]) by prod-mail-ppoint2.akamai.com with ESMTP id 2bhm6e3skj-1; Fri, 07 Jul 2017 12:27:06 -0400
Received: from [172.19.17.86] (bos-lpczi.kendall.corp.akamai.com [172.19.17.86]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id D6AD61FC7E; Fri, 7 Jul 2017 16:27:05 +0000 (GMT)
To: Andreas Walz <andreas.walz@hs-offenburg.de>, tls@ietf.org
References: <595F99DA020000AC00136830@gwia2.rz.hs-offenburg.de> <595F99DA020000AC00136830@gwia2.rz.hs-offenburg.de>
From: Benjamin Kaduk <bkaduk@akamai.com>
Message-ID: <d5873ac1-5525-4fb7-bd2d-51ea05d4da30@akamai.com>
Date: Fri, 07 Jul 2017 11:27:05 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <595F99DA020000AC00136830@gwia2.rz.hs-offenburg.de>
Content-Type: multipart/alternative; boundary="------------C8FCC341FF1354F7F68733B5"
Content-Language: en-US
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-07_08:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707070274
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-07_08:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707070273
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/aa5PUw4fSaXC-8Qp44OLVJM2k8k>
Subject: Re: [TLS] Truncated HMAC: what to do with the MAC key?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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, 07 Jul 2017 16:27:21 -0000

On 07/07/2017 09:25 AM, Andreas Walz wrote:
> Dear all,
>
> today I encountered something that confuses me: different TLS
> implementations do not seem to agree on how to implement truncated
> HMAC. All implementations I tested truncate the HMAC output correctly,
> but they seem to use different MAC keys. When truncated HMAC is
> negotiated:
>
> -> MatrixSSL does not change the length of the MAC key but zeros all
> its bytes beyond index 10,
> -> mbedTLS truncates the MAC key to length 10,
> -> WolfSSL does not touch the MAC key at all.
>
> From RFC 6066 I would infer that the MAC key should not be affected by
> the negotiation of the truncated HMAC extension (as WolfSSL is
> implementing it). Is that correct?

I agree with your reading of RFC 6066 (and RFC 2104).

-Ben