Re: [secdir] Secdir last call review of draft-ietf-cose-aes-ctr-and-cbc-04

Russ Housley <housley@vigilsec.com> Tue, 16 May 2023 19:27 UTC

Return-Path: <housley@vigilsec.com>
X-Original-To: secdir@ietfa.amsl.com
Delivered-To: secdir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6C38EC151068; Tue, 16 May 2023 12:27:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id buJyY1QABAXC; Tue, 16 May 2023 12:27:44 -0700 (PDT)
Received: from mail3.g24.pair.com (mail3.g24.pair.com [66.39.134.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 681D7C13AE5B; Tue, 16 May 2023 12:27:44 -0700 (PDT)
Received: from mail3.g24.pair.com (localhost [127.0.0.1]) by mail3.g24.pair.com (Postfix) with ESMTP id 9D69E15E297; Tue, 16 May 2023 15:27:43 -0400 (EDT)
Received: from [192.168.1.161] (unknown [96.241.2.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail3.g24.pair.com (Postfix) with ESMTPSA id 87D7415E207; Tue, 16 May 2023 15:27:43 -0400 (EDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\))
From: Russ Housley <housley@vigilsec.com>
In-Reply-To: <168426133976.16012.18353276769573616615@ietfa.amsl.com>
Date: Tue, 16 May 2023 15:27:43 -0400
Cc: IETF SecDir <secdir@ietf.org>, cose <cose@ietf.org>, draft-ietf-cose-aes-ctr-and-cbc.all@ietf.org, last-call@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <E96F7DC2-F4D7-407E-B64D-D88FB0F4E17B@vigilsec.com>
References: <168426133976.16012.18353276769573616615@ietfa.amsl.com>
To: Daniel Migault <daniel.migault@ericsson.com>
X-Mailer: Apple Mail (2.3445.104.21)
X-Scanned-By: mailmunge 3.11 on 66.39.134.11
Archived-At: <https://mailarchive.ietf.org/arch/msg/secdir/zzcBUcH7bYlMCh_-zLUZnTQYIWA>
Subject: Re: [secdir] Secdir last call review of draft-ietf-cose-aes-ctr-and-cbc-04
X-BeenThere: secdir@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Security Area Directorate <secdir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/secdir>, <mailto:secdir-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/secdir/>
List-Post: <mailto:secdir@ietf.org>
List-Help: <mailto:secdir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/secdir>, <mailto:secdir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 May 2023 19:27:45 -0000


> On May 16, 2023, at 2:22 PM, Daniel Migault via Datatracker <noreply@ietf.org> wrote:
> 
> Reviewer: Daniel Migault
> Review result: Ready
> 
> Reviewer: Daniel Migault
> Review result: Ready
> 
> I have reviewed this document as part of the security directorate's ongoing
> effort to review all IETF documents being processed by the IESG. These comments
> were written primarily for the benefit of the security area directors. Document
> editors and WG chairs should treat these comments just like any other
> 
> section 4 AES counter mode
> 
> In "AES encryption of (IV +1) mod 2^128" I am wondering if "mod 2^128" is
> needed as I see the encryption returning a 128 bit block. That said we
> understand why it is there, it is more that I am curious if there is any reason.

If the IV is zero, then the "mod 2^128" has no impact.  If you start with another value, it needs to wrap.

> I am also wondering if we should mention the IV + i is called the counter block
> as this is mentioned in section 8.

Okay.  I think the following does the job:

   AES-CTR has many properties that make it an attractive COSE Content
   Encryption algorithm.  AES-CTR uses the AES block cipher to create a
   stream cipher.  Data is encrypted and decrypted by XORing with the
   key stream produced by AES encrypting sequential IV block values,
   called counter blocks.  The first block of the key stream is the AES
   encryption of the IV, the second block of the key stream is the AES
   encryption of (IV + 1) mod 2^128, the third block of the key stream
   is the AES encryption of (IV + 2) mod 2^128, and so on.  AES-CTR is
   easy to implement, and AES-CTR can be pipelined and parallelized.
   AES-CTR also supports key stream precomputation.  Sending of the IV
   is the only source of expansion because the plaintext and ciphertext
   are the same size.

> The following text sounded cryptic to me until I reached section 6. I suspect
> that adding a reference to section 6 might be useful. The same comment applies
> for CBC.
> 
> """
> Since AES-CTR cannot provide integrity protection for external
> additional authenticated data, the decryptor MUST ensure that no
> external additional authenticated data was supplied.
> """

I suggest:

   Since AES-CTR cannot provide integrity protection for external
   additional authenticated data, the decryptor MUST ensure that no
   external additional authenticated data was supplied.  See Section 6.

and:

   Since AES-CBC cannot provide integrity protection for external
   additional authenticated data, the decryptor MUST ensure that no
   external additional authenticated data was supplied.  See Section 6.

> section 4.2.  AES-CTR COSE Algorithm Identifiers
> 
> In the title “Algoritm” needs to be changed.

Fixed.

> It is surprising to define a "Deprecated", but the note provides the rationale.
> I am wondering if that rationale could be also mentioned in the IANA page -
> this is just a suggestion.

This has been discussed on the thread with Rob Wilton.  Not sure where that will land yet.

> section 5.  AES Cipher Block Chaining Mode
> 
> I believe that another reason for using integrity protection is the
> vulnerability to padding oracle.

When CBC decryption returns an "invalid padding" error instead of a generic "decryption failed" error, then attacker can gain a lot of information.  It is better to not distinguish between these two error cases.

Russ