Re: aes128gcm: is the 1st example wrong?

Julian Reschke <julian.reschke@gmx.de> Sun, 12 February 2017 19:52 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 362E5129AFE for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 12 Feb 2017 11:52:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.902
X-Spam-Level:
X-Spam-Status: No, score=-6.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=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 CH6nOG4__ags for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 12 Feb 2017 11:52:28 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8DB46129AFF for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 12 Feb 2017 11:52:28 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cd08q-0006ft-GN for ietf-http-wg-dist@listhub.w3.org; Sun, 12 Feb 2017 19:49:00 +0000
Resent-Date: Sun, 12 Feb 2017 19:49:00 +0000
Resent-Message-Id: <E1cd08q-0006ft-GN@frink.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <julian.reschke@gmx.de>) id 1cd08Y-0006eh-NW for ietf-http-wg@listhub.w3.org; Sun, 12 Feb 2017 19:48:42 +0000
Received: from mout.gmx.net ([212.227.17.22]) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <julian.reschke@gmx.de>) id 1cd07y-0001Wg-JH for ietf-http-wg@w3.org; Sun, 12 Feb 2017 19:48:37 +0000
Received: from [192.168.178.20] ([93.217.115.200]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Li0dC-1bzlIQ2rf0-00n82U; Sun, 12 Feb 2017 20:47:20 +0100
To: Martin Thomson <martin.thomson@gmail.com>, "Manger, James" <James.H.Manger@team.telstra.com>
References: <SYXPR01MB1615D5823473E6A9B5F0C80DE57C0@SYXPR01MB1615.ausprd01.prod.outlook.com> <CABkgnnWE38wbhKfp+5nF1hfn7qH4-6Uk4QMGBKgGL6-f_em_KA@mail.gmail.com>
Cc: "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
From: Julian Reschke <julian.reschke@gmx.de>
Message-ID: <1459eb07-f8cb-ff90-6101-be05f80c76aa@gmx.de>
Date: Sun, 12 Feb 2017 20:47:19 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
MIME-Version: 1.0
In-Reply-To: <CABkgnnWE38wbhKfp+5nF1hfn7qH4-6Uk4QMGBKgGL6-f_em_KA@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:68AuzG0Sx8/2LFV2Oa4GqxjiQJWxN/CnogYmSb+PAcqmBjqXbLI qWo3BGUrIEmfJ4Yp7oPDbFVfaxEFFoIdI9zERusrsPx1ido62s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eOp5+Z23274ydN3YOgPDc50MBXoIvHRehAf96CarLEteaM/IxfJbDGPYRlm1TNjyvfpBB3G5 jc3VU3wGywrU4BUhsUniWhr2pWdD8m9Hy0boCV3GenFfTYhYqgpaek9YOrqjx6TYeWUlmH2gh 5agGpCtYkiNF2yDgo8OLV488YJ4h4AGn6w2CsYsZTx2tprvhNovAn8K7HTdTThY4fw==
Received-SPF: pass client-ip=212.227.17.22; envelope-from=julian.reschke@gmx.de; helo=mout.gmx.net
X-W3C-Hub-Spam-Status: No, score=-2.6
X-W3C-Hub-Spam-Report: RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1.887, TIME_LIMIT_EXCEEDED=0, URIBL_BLOCKED=0.001
X-W3C-Scan-Sig: mimas.w3.org 1cd07y-0001Wg-JH 2abd946d5bfeb872dcbbeb2c3ceca066
X-Original-To: ietf-http-wg@w3.org
Subject: Re: aes128gcm: is the 1st example wrong?
Archived-At: <http://www.w3.org/mid/1459eb07-f8cb-ff90-6101-be05f80c76aa@gmx.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33473
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 2017-01-17 04:16, Martin Thomson wrote:
> On 17 January 2017 at 15:26, Manger, James
> <James.H.Manger@team.telstra.com> wrote:
>> IKM = B33e_VeFrOyIHwFTIfmesA
>> salt = sJvlboCWzB5jr8hI_q9cOQ
>>
>> Draft gives:
>> PRK = MLAQxt_DHjM15cdlyU1oUnjq7TFlzToGTkdRmvvxVBw
>>
>> But I get:
>> PRK = Mg9ErPx3DpJfkz72kj7Yvx369iqvd4Fmf7tOMTdXELo
>
> Ahh, so do I.  Strange.  I ran those examples many times.  And I even
> have unit tests against them....
>
> ...except that the unit test has the key "6Aqf1aDH8lSxLyCpoCnAqg",
> which I expect will work for you.  Fixed it in 622f21d.

FWIW, I was able to reproduce the examples with the updated code in 
<https://gist.github.com/reschke/46659c912b426dffeac41d9a21421c95>, 
modulo the change Martin mentioned (but which I don't see in Git).

WRT 
<https://greenbytes.de/tech/webdav/draft-ietf-httpbis-encryption-encoding-06.html#rfc.section.3.2>: 
it would be good if the prose mentioned that this specifies a keyid of 
"a1" in the header.

Best regards, Julian