Re: [lamps] Proposal for PBMAC1 in PKCS#12

Russ Housley <housley@vigilsec.com> Wed, 22 June 2022 14:58 UTC

Return-Path: <housley@vigilsec.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7321EC14F727 for <spasm@ietfa.amsl.com>; Wed, 22 Jun 2022 07:58:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.907
X-Spam-Level:
X-Spam-Status: No, score=-1.907 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=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 13hLCzkv6sdN for <spasm@ietfa.amsl.com>; Wed, 22 Jun 2022 07:58:20 -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 B2438C14F723 for <spasm@ietf.org>; Wed, 22 Jun 2022 07:58:20 -0700 (PDT)
Received: from mail3.g24.pair.com (localhost [127.0.0.1]) by mail3.g24.pair.com (Postfix) with ESMTP id 7B74B188496; Wed, 22 Jun 2022 10:58:19 -0400 (EDT)
Received: from [10.0.1.2] (pfs.iad.rg.net [198.180.150.6]) (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 6E7DC1882C9; Wed, 22 Jun 2022 10:58:19 -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: <c282cba9-f6ae-4412-8e93-0810cffb16f2@redhat.com>
Date: Wed, 22 Jun 2022 10:58:18 -0400
Cc: LAMPS <spasm@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <99D0A4AF-89CF-467A-A934-9144636B6A17@vigilsec.com>
References: <c282cba9-f6ae-4412-8e93-0810cffb16f2@redhat.com>
To: Hubert Kario <hkario@redhat.com>
X-Mailer: Apple Mail (2.3445.104.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/q4g_NkVO2cwvBRmJuzkUKyBiXyo>
Subject: Re: [lamps] Proposal for PBMAC1 in PKCS#12
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Jun 2022 14:58:24 -0000

Hubert:

Please point to the text in RFC 7292 that is causing your concern.

The PFX structure is:

   PFX ::= SEQUENCE {
       version     INTEGER {v3(3)}(v3,...),
       authSafe    ContentInfo,
       macData     MacData OPTIONAL
   }

   MacData ::= SEQUENCE {
       mac         DigestInfo,
       macSalt     OCTET STRING,
       iterations  INTEGER DEFAULT 1
       -- Note: The default is for historical reasons and its
       --       use is deprecated.
   }

  -- IMPORT FROM RFC 2315

   DigestInfo ::= SEQUENCE {
     digestAlgorithm DigestAlgorithmIdentifier,
     digest Digest }

   Digest ::= OCTET STRING

It seems to me that DigestInfo would be better named macInfo.  It carries the MAC algorithm identifier (and optional parameters) as the MAC itself.

Russ


> On Jun 22, 2022, at 6:35 AM, Hubert Kario <hkario@redhat.com> wrote:
> 
> Hello everybody,
> 
> The work on the new NIST FIPS 140-3 implementations made us aware that the
> current PKCS #12 specification uses a legacy PBKDF for the calculation
> of the whole-file MAC value: PBKDF1. The PKCS #12 standard also doesn't
> provide a way to specify any alternative KDF. Since PBKDF1 isn't an approved mechanism in FIPS, the whole file becomes FIPS non-compliant.
> 
> While deciding how to modify the PFX structure we considered two options:
> change the structure completely, so that the whole macData is extensible
> and allows for use of PBMAC1, or by placing the PBMAC1 as as "hash"
> in the existing structure. The first option is much cleaner, but it has
> the unintended consequence of making the file completely unreadable by
> any of the popular software able to process PKCS#12 files that exists now.
> The second option does on the other hand create files that even
> old versions of OpenSSL (like 1.0.1) can read when the user specifies the
> -nomacver option. Allowing for a relatively easy workaround for interoperability with old systems.
> 
> With those two things in mind I'd like to propose the following I-D
> to specify use of PBMAC1 in PKCS#12:
> https://datatracker.ietf.org/doc/draft-kario-pkcs12-pbmac1/
> -- 
> Regards,
> Hubert Kario
> Principal Quality Engineer, RHEL Crypto team
> Web: www.cz.redhat.com
> Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic
> 
> _______________________________________________
> Spasm mailing list
> Spasm@ietf.org
> https://www.ietf.org/mailman/listinfo/spasm