Re: [openpgp] Remarks on Brainpool missing in -06

"Kousidis, Stavros" <stavros.kousidis@bsi.bund.de> Fri, 17 June 2022 16:00 UTC

Return-Path: <stavros.kousidis@bsi.bund.de>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 34206C14F74C for <openpgp@ietfa.amsl.com>; Fri, 17 Jun 2022 09:00:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.027
X-Spam-Level:
X-Spam-Status: No, score=-2.027 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_BLOCKED=0.001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=bsi.bund.de header.b=zbXOPGRE; dkim=pass (2048-bit key) header.d=bsi.bund.de header.b=deMtoEXt
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 dy5pVKI7Uoh5 for <openpgp@ietfa.amsl.com>; Fri, 17 Jun 2022 09:00:08 -0700 (PDT)
Received: from m2-bn.bund.de (m2-bn.bund.de [77.87.228.74]) (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 3BD18C15D861 for <openpgp@ietf.org>; Fri, 17 Jun 2022 09:00:07 -0700 (PDT)
Received: from m2-bn.bund.de (localhost [127.0.0.1]) by m2-bn.bund.de (Postfix) with ESMTP id AA8EF7295EC; Fri, 17 Jun 2022 18:00:04 +0200 (CEST)
Received: (from localhost) by m2-bn.bund.de (MSCAN) id 4/m2-bn.bund.de/smtp-gw/mscan; Fri Jun 17 18:00:04 2022
X-NdB-Source: NdB
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=bsi.bund.de; s=211014-e768-ed25519; t=1655481590; bh=gPiu+p01eWuE9yhftlUzFqUqcAD3jai6wEtEDxTcbo8=; h=From:To:CC:Subject:Date:References:In-Reply-To:Content-Type: MIME-Version:Autocrypt:Cc:Content-Transfer-Encoding:Content-Type: Date:From:In-Reply-To:Mime-Version:Openpgp:References:Reply-To: Resent-To:Sender:Subject:To; b=zbXOPGRE9g1izIEMDljesE075tdKLKRkbs/u+R7iUZgp7L5nS8AKXi1HlCLkOne2o rKlJ3L1KgfhVm5HPsV/Dw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bsi.bund.de; s=211014-e768-rsa; t=1655481590; bh=gPiu+p01eWuE9yhftlUzFqUqcAD3jai6wEtEDxTcbo8=; h=From:To:CC:Subject:Date:References:In-Reply-To:Content-Type: MIME-Version:Autocrypt:Cc:Content-Transfer-Encoding:Content-Type: Date:From:In-Reply-To:Mime-Version:Openpgp:References:Reply-To: Resent-To:Sender:Subject:To; b=deMtoEXtRHqpy0XZpd+tOLLkCQkPCliWYEdHU138+9qObVP4WXHHlG1yCufmmNfBk umvKn/UGHh5NHsAhqGWOHhE2aEi2vb43YD389jhLWBX/eeBpq2DkD8tMBPu0zrHyfo b+/h3606lpeyH1l+bNZYNVURGS65yuT1W4aojv5Xdox/+M4PVOBIYZFpZiUCTX8meU kxDAH5tjat6DMiBJ/nOXoaZy+jbTDR/Q3U8oCeoyLUDOqxPoe1J01Lz/2knptUc1Vf 2WrAjx4gQFPZ2cF+VcPWlhw98AaLuoVy1SBkvSihI/aNpTVXroIdCeUYsMqR7feQ5t fQoumI0QB68fw==
X-P350-Id: 156527aa4c135f10
X-Virus-Scanned: amavisd-new at bsi.bund.de
From: "Kousidis, Stavros" <stavros.kousidis@bsi.bund.de>
To: Werner Koch <wk@gnupg.org>, Daniel Kahn Gillmor <dkg@fifthhorseman.net>
CC: "openpgp@ietf.org" <openpgp@ietf.org>
Thread-Topic: [openpgp] Remarks on Brainpool missing in -06
Thread-Index: AQHYgJ5FOwmbd3rVskSYmH0Hx9yMqa1TwJtQ
Date: Fri, 17 Jun 2022 15:59:35 +0000
Message-ID: <e6df3f15b0324ad09134c4b79ca3aa0d@bsi.bund.de>
References: <874k0wjva7.fsf@wheatstone.g10code.de> <87tu8onpf3.fsf@fifthhorseman.net> <87tu8nbstv.fsf@wheatstone.g10code.de> <87r13ro29z.fsf@fifthhorseman.net> <871qvqba8p.fsf@wheatstone.g10code.de>
In-Reply-To: <871qvqba8p.fsf@wheatstone.g10code.de>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-esetresult: clean, is OK
x-esetid: 37303A293417A2516D7262
Content-Type: multipart/alternative; boundary="_000_e6df3f15b0324ad09134c4b79ca3aa0dbsibundde_"
MIME-Version: 1.0
X-Rusd: domwl, Pass through domain bsi.bund.de
X-Rurd: query_ok, Pass through domain ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/nIKnJ-n65x4ajNta7dMkPHFo2Ug>
Subject: Re: [openpgp] Remarks on Brainpool missing in -06
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Jun 2022 16:00:13 -0000

Dear all,

I do not see why RFC 6637 defines Brainpool curves simply through the introduction of an OID adressing scheme. Curves have to be defined and described explicitely so that implementations know the necessary metadata that accompanies a curve.

However, I think what Daniel is mainly asking for is just a simple quality assurance for the brainpool-curves merge request and this is an absolutely legitimate question.

The reason why I think that the data given in the merge request stands up to reality is that I've done some certificate generations/dumps to cross-check before submission.

I've used GnuPG 2.3.6 and Libgcrypt 1.10.1 to generate a certificate for each Brainpool curve (i.e. brainpoolP256r1, brainpoolP384r1, brainpoolP512r1) and verify that the Brainpool curve data described in the merge request corresponds to the values in the generated certificates. I've used Sequioa-PGP to (hex) dump the certificates and do the comparison (my compliments to the creators of this great tool!).

That is,

1) The OIDs given in "§9.2 ECC Curves for OpenPGP" for the Brainpool curves match the ones in the generated certificates, i.e. 2B 24 03 03 02 08 01 01 07 (brainpoolP256r1), 2B 24 03 03 02 08 01 01 0B (brainpoolP384r1), and 2B 24 03 03 02 08 01 01 0D (brainpoolP512r1).

2) The formats given in "§9.2.1 Curve-specific Wire Formats" of the merge request match the ones in the generated certificates, i.e. "SEC1" (ECDH Point Format) and "integer" (ECDH Secret Key MPI).

3) The MPI payload counts given in "§12.2.3 Notes on EC Point Wire Formats" of the merge request match the "ecdsa_pub_len" and "ecdh_pub_len" values in the generated certificates, i.e. 0x0203 (515 bits) for brainpoolP256r1, 0x0303 (717 bits) for brainpoolP384r1, and 0x0403 (1027 bits) for brainpoolP512r1.

4) The octet counts in "§12.5 EC DH Algorithm (ECDH)" are pretty straightforward. Those I did by hand and with my pocket calculator.

5) The combinations of curve+hash+encaps in "§12.5.1 ECDH Parameters" correspond to the ones I found in the generated certificates, i.e. brainpoolP256r1+SHA2-256+AES-128, brainpoolP384r1+SHA2-384+AES-192, and brainpoolP512r1+SHA2-512+AES-256.

For reproducability these are the commands I've used

gpg --expert --full-gen-key
gpg --output dummy.pgp --armor --export-secret-key dummy@id
sq packet dump -x --mpis dummy.pgp -o dummy.pgp.dump

Best
Stavros

Von: Werner Koch <wk@gnupg.org>
Gesendet: Mittwoch, 15. Juni 2022 10:29
An: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Cc: openpgp@ietf.org
Betreff: Re: [openpgp] Remarks on Brainpool missing in -06


On Tue, 14 Jun 2022 08:30, Daniel Kahn Gillmor said:

> I'm puzzled by this assertion.  RFC 6637 says nothing about Brainpool,
> and the structure of the crypto-refresh draft in -06 is itself no

Read the discussions about RFC-6637 were we decided that the
introduction of an OID is sufficient to implement Brainpool curves
without delaying the publication of that RFC.

> that support Brainpool, in a way that has not been formally
> standardized.

  "We believe in rough consensus and running code." Implementation
  experience provides critical feedback to the standardization process.

Now moving to Geneve?

> I believe that Stavros's proposed change offers the formalization that
> you're asking for.  It would be great to have more comments on it.

We don't need to discuss that because there is running code on millions
of devices.  It the specification is up to the reality, good.  If not,
it is just another bug in an RFC.


Salam-Shalom,

   Werner

--
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein