Re: aes128gcm: why verify padding?

Martin Thomson <martin.thomson@gmail.com> Wed, 25 January 2017 23:45 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 2B0311293F8 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 25 Jan 2017 15:45:06 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.72
X-Spam-Level:
X-Spam-Status: No, score=-9.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-3.199, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 3aAgkKXm0n7h for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 25 Jan 2017 15:45:05 -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 12200126D74 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 25 Jan 2017 15:45:05 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1cWXD4-0004G6-FP for ietf-http-wg-dist@listhub.w3.org; Wed, 25 Jan 2017 23:42:38 +0000
Resent-Date: Wed, 25 Jan 2017 23:42:38 +0000
Resent-Message-Id: <E1cWXD4-0004G6-FP@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 <martin.thomson@gmail.com>) id 1cWXD0-0004E6-2x for ietf-http-wg@listhub.w3.org; Wed, 25 Jan 2017 23:42:34 +0000
Received: from mail-qt0-f173.google.com ([209.85.216.173]) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <martin.thomson@gmail.com>) id 1cWXCu-0007T5-8E for ietf-http-wg@w3.org; Wed, 25 Jan 2017 23:42:28 +0000
Received: by mail-qt0-f173.google.com with SMTP id x49so46066165qtc.2 for <ietf-http-wg@w3.org>; Wed, 25 Jan 2017 15:42:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=99Kr4XQtEwncQyQOhkh+ny22iERsNiGu9e8UsJzd9MQ=; b=WSa0YOeN90L2AZH6J0ZsXndY8X5d/3JNAytQCjk/X/Hb/+k/yhAVt1Ly9GFs4ZnbgB 0EOWlI1CIic9gV8VwGxnH3423OQJjO6YJNuNDtK8rvnBpHnyGRkfy0VtVwM1nJR87qRs fbzCNw8cu07YXRQKjXlz4n7tgYo3IpymsRUZf6P7F4U7iHQWa2MgaqjtUO3dUBqENF1/ XvEMGB/h9rM1gSo1ySCf9Rr4+K4k8UmqdmNQejZJ1q+RWrGzflxcPNAwf20kD0uEcQ1T gdpjl2PCKoD+rxNXayUpRkrphAle2hjQIb7MKMXwvxhjVJFWyEKdzkwBFF0lWXqCkAcw vHoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=99Kr4XQtEwncQyQOhkh+ny22iERsNiGu9e8UsJzd9MQ=; b=fK8pNZdMJn4Amfe7oqa2EcigHRpKO2wuYL22QykTgyBo5V82jHz7k3XVJyG6m5pF5f /Gtxx7P9qydL2R8DnmaUPb9ZKMJ7lfTyWkuOpOKnKRgh7AnT2xMyv5aBv++f/DNYPpYO RujUnO7ZjNLnS7sT/+wWyYCJ0F4EDtyZmfbCh3LjIIBoJjA0Rf2FX6z/vQk8hWjw+Xkr tuDTMaw6uOog+Prf4PjjZTr9XpVBmVmZMoxw1DeZKb3NBAioKVybR6D/URMDElaI0TsQ YJ3QuKUzNyhYgHf3NSTa3sCVRq3jtpfHXS9lr2iKUqKGKgzLKz8eRC+rQsJ+tUQfzOdN oVpA==
X-Gm-Message-State: AIkVDXJSKWgaSDXWsCyS1yg6INzYKA/LqaQdtBsDmUHnLodMbAmymzpeBCbsARXYSRuG/Nx1eQbrnN3TJzSHBg==
X-Received: by 10.55.27.65 with SMTP id b62mr38687526qkb.202.1485387722011; Wed, 25 Jan 2017 15:42:02 -0800 (PST)
MIME-Version: 1.0
Received: by 10.140.19.112 with HTTP; Wed, 25 Jan 2017 15:42:01 -0800 (PST)
In-Reply-To: <SYXPR01MB1615AE56D810A0372AF811FCE5750@SYXPR01MB1615.ausprd01.prod.outlook.com>
References: <SYXPR01MB161520224A59CDCE0D433A2CE57A0@SYXPR01MB1615.ausprd01.prod.outlook.com> <CABkgnnUo-tf69AzJC=OUy2rjDZwedTd5Ua9mhOiJBqaA0VKrYw@mail.gmail.com> <SYXPR01MB16150F4D3D19CC69D18E1A09E57D0@SYXPR01MB1615.ausprd01.prod.outlook.com> <CABkgnnV_OatRWyZBE3Rak22gS1jrOZKjCGwOePpbqJCAeJFM4Q@mail.gmail.com> <SYXPR01MB1615DD56268D7EF9929F3DBFE5720@SYXPR01MB1615.ausprd01.prod.outlook.com> <20170123073623.GA28101@LK-Perkele-V2.elisa-laajakaista.fi> <SYXPR01MB1615798CC057FB3232B2FA4BE5720@SYXPR01MB1615.ausprd01.prod.outlook.com> <CABkgnnW4e+FOz+gsu6vZ2d9WOSv9Yohn+OejrNom9HCBiMrRWQ@mail.gmail.com> <SYXPR01MB1615AE56D810A0372AF811FCE5750@SYXPR01MB1615.ausprd01.prod.outlook.com>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Thu, 26 Jan 2017 08:42:01 +0900
Message-ID: <CABkgnnWoSWCeV_TUwDY1J00ivY0TDgU_9NhiSWZpM4_F6XAYfA@mail.gmail.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>
Cc: "ilariliusvaara@welho.com" <ilariliusvaara@welho.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.216.173; envelope-from=martin.thomson@gmail.com; helo=mail-qt0-f173.google.com
X-W3C-Hub-Spam-Status: No, score=-6.1
X-W3C-Hub-Spam-Report: AWL=0.120, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1cWXCu-0007T5-8E 01553f059333865ea51f959ebbfe562d
X-Original-To: ietf-http-wg@w3.org
Subject: Re: aes128gcm: why verify padding?
Archived-At: <http://www.w3.org/mid/CABkgnnWoSWCeV_TUwDY1J00ivY0TDgU_9NhiSWZpM4_F6XAYfA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/33379
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 24 January 2017 at 09:10, Manger, James
<James.H.Manger@team.telstra.com> wrote:
> If we go with this approach, we should also distinguish the 1st record. For instance, for the end-of-padding byte:


I think that might be going too far.  Truncating the first record
requires that you are able to find an input to HKDF that provides the
same key, and a nonce that has just the lower bit flipped (you can
truncate more with higher probability).  That requires several
preimage attacks on SHA-256 in series.  Mostly though, marking the
start also increases complexity.  I think that it's enough to say 0x01
= keep going, 0x02 = all done.