Re: PEM feedback on draft-ietf-httpbis-message-signatures-13

Justin Richer <jricher@mit.edu> Mon, 07 November 2022 11: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 B0154C152566 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 7 Nov 2022 03:45:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.762
X-Spam-Level:
X-Spam-Status: No, score=-7.762 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.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mit.edu
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 bBuOKKzWsCau for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 7 Nov 2022 03:45:15 -0800 (PST)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 49BD8C14F73D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 7 Nov 2022 03:38:26 -0800 (PST)
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1os0Pd-0053Ms-Cw for ietf-http-wg-dist@listhub.w3.org; Mon, 07 Nov 2022 11:35:33 +0000
Resent-Date: Mon, 07 Nov 2022 11:35:33 +0000
Resent-Message-Id: <E1os0Pd-0053Ms-Cw@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <jricher@mit.edu>) id 1os0Pb-0053Lv-Fi for ietf-http-wg@listhub.w3.org; Mon, 07 Nov 2022 11:35:31 +0000
Received: from outgoing-exchange-7.mit.edu ([18.9.28.58]) by titan.w3.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <jricher@mit.edu>) id 1os0PZ-007css-Rx for ietf-http-wg@w3.org; Mon, 07 Nov 2022 11:35:31 +0000
Received: from w92exedge3.exchange.mit.edu (W92EXEDGE3.EXCHANGE.MIT.EDU [18.7.73.15]) by outgoing-exchange-7.mit.edu (8.14.7/8.12.4) with ESMTP id 2A7BZIEL028850; Mon, 7 Nov 2022 06:35:18 -0500
Received: from oc11expo18.exchange.mit.edu (18.9.4.49) by w92exedge3.exchange.mit.edu (18.7.73.15) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 7 Nov 2022 06:34:41 -0500
Received: from oc11exhyb5.exchange.mit.edu (18.9.1.110) by oc11expo18.exchange.mit.edu (18.9.4.49) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 7 Nov 2022 06:35:17 -0500
Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by oc11exhyb5.exchange.mit.edu (18.9.1.110) with Microsoft SMTP Server (TLS) id 15.0.1497.42 via Frontend Transport; Mon, 7 Nov 2022 06:35:17 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mM+mfmzcMa661nVXsev/xIo+IJH0cnwNRO5YrPr12ohCfe5kpFC0kSnUNdp/3dQVEWPUIhdDmp81p6yRJ+6paUwTIPzHa+WWAyF1EWd9vH1+wZUs/5B0bYqjz5Eorj2iGHABgoiv2Ixgi1tFtiJJlENnEvQdkes/f7Z8zPLcbWXg8Zm+iHNKdW1spqjH0GNP8bDsT/Sf8a9kIu9LVj5cOVZnSZyRqk+rNZnlZExxY7ivnpkgdfebeDRv2axBRkPvRJWd/W6RJiZJYlPhOi/BezSyGDPNBVh03vwMTzBIj+JDuq46bUFxi0cOKfookK4+W7d8gyZ5UsuqH3g6HVfpVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E8pWfXMl7u97AvAO+IZskUqBq6+5xiy5qlXngdQIFa4=; b=E0V7DDVsXRe+hpitzleJDXJ/L/Ul0ylwqoCz4Ox/6o7Sj/LbxcqXPQvA40jp2cvBanu/iac5JhpHJlHgBzETbUlH1jYmE9zngVffFY5wsZbIY0mNnFpIQmNaUFKAQfgl5wbFfMCaHqqbltfV8htqqE8tjMWZV7fVvXMDtSTGVpUtnqedMTAZnLuYD3LaaKVrXpXwyOfqtQ0pLdYJLVKCBW9mR4NTLr1TOk0jortgIi3SHFqBpzFzBqbfMqvaCJjdhBy/+KsSB0kyQKkl3cwdXJ++WkiOX2GJ9g5ujtH2i9gdpHrcCd6ODRGfAdtxt1jLyE/IFr4+rtc5Ve246gj0tw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mit.edu; dmarc=pass action=none header.from=mit.edu; dkim=pass header.d=mit.edu; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E8pWfXMl7u97AvAO+IZskUqBq6+5xiy5qlXngdQIFa4=; b=o2JvAcK4q1YAKgIqH1IPuJG2h5bQz1TwnsQv0uj+UJhKR/3tFZqdihdX4dEDeV7JLofGZkBRW5w6NsetwDd6xdYkewOnPZx1LsiwjZAFG7b2GJ4ieqEBZBcXJIxfPu4aCXCcOdcvYXkrGPBNu893a0TV8Z6wXruWbTb93yYcTzg=
Received: from DM6PR01MB4444.prod.exchangelabs.com (2603:10b6:5:78::15) by MW2PR0102MB3371.prod.exchangelabs.com (2603:10b6:302:5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.25; Mon, 7 Nov 2022 11:35:16 +0000
Received: from DM6PR01MB4444.prod.exchangelabs.com ([fe80::475d:556c:f5ad:2be5]) by DM6PR01MB4444.prod.exchangelabs.com ([fe80::475d:556c:f5ad:2be5%4]) with mapi id 15.20.5791.026; Mon, 7 Nov 2022 11:35:16 +0000
From: Justin Richer <jricher@mit.edu>
To: Henry Story <henry.story@gmail.com>
CC: HTTP Working Group <ietf-http-wg@w3.org>
Thread-Topic: PEM feedback on draft-ietf-httpbis-message-signatures-13
Thread-Index: AQHY8c5YlwUntp957US31E+KzXe5ga4zVmWA
Date: Mon, 07 Nov 2022 11:35:16 +0000
Message-ID: <63B092A7-94F6-4FB9-A7BF-44ADD2E1431F@mit.edu>
References: <B0AAE75E-05F0-4CC6-AEA6-3DE49BB09A81@gmail.com>
In-Reply-To: <B0AAE75E-05F0-4CC6-AEA6-3DE49BB09A81@gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mit.edu;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DM6PR01MB4444:EE_|MW2PR0102MB3371:EE_
x-ms-office365-filtering-correlation-id: 7b52d49c-735d-4c16-3223-08dac0b42456
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: RWhUTEjkwlnU+YAROhcNTrH8nb7A0ApGrCIo7yFBxXWYTdQ3Ze0XUIIzP0Il9QtxImh/k1+yPKc8qINgNJMGKJz84IIaMd5mMpgXVapqcnOnwdZ1ZJ0Z1AoI4GLP3ersSNEFj4OtH5HVS2nN4k7j8tEgbFybkZwCn+dpjBeChSxhKvaGfvRR6zu1y3z6pNOYMsAF1O4CH1oVdTlBLKVWrW2sqoMEAgihBxrVSfr7LFK4NHyx+1QASs3XsI/xNtsSpOLICLVhrvmdlp7RP/5tSXah69PyveXkXdEoFr8mIRUYby7yKqkRWT+O4QFZq69XjbtUY/elBf6HM1+4CYrsKdro7HKn5LAb+OPHEmtYXCGybX/MbmIr8z5J7Hwr5Lss4n0VsQJMm+lzQPYGErm8+7J07MUC5VOWqwmd0igoxyfLOlw8aRo0u69j4bCFWqB9j1uGbB/GaIk8GBj844PnROd68CXukP+Ye/RtRrtMsrLPknH8sSEerP2xg5ZUh89AsjAS/nYuajAr2x/Gs5/wzHLLY7VFSnKpG/TWaMrHLXaRw5KZYc5/3kyOvmJaRS6Gn5vmckY2XLSD9bc9mAnEkSEBYE70jlL6LYJO2tX9Mk6jWDtYLN9gMTZiAEPq9SB4yspJKGoOs1WelKl0jaMi13Bh5pJr21MM2BTYGOqYsMJ0OJcsKJJmPN7gvP4s67IeAulrKPPF+JpQLU27Ws0LSFa1fLX8fTqU2aiU3h6TS8LqLVK9oT4qvVVUYuEhRTyfBsph0SjqywsXJOunwVUOPRpOwEH1SwJ85cHFSNX6RkgULmmkbdEx8MeuSp0b98HgI+kvHRDYWJhd4lIwb8VBFw==
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB4444.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(36756003)(41300700001)(75432002)(122000001)(38070700005)(6916009)(316002)(8676002)(4326008)(64756008)(66446008)(66476007)(76116006)(66556008)(66946007)(786003)(5660300002)(8936002)(86362001)(38100700002)(33656002)(478600001)(966005)(6486002)(186003)(6512007)(53546011)(6506007)(71200400001)(91956017)(2616005)(2906002)(66574015);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: Kfbap00tZ6lZxrEwW8wruGOFePv+zSKMOETIu0gSTCW5sEmcdfsF75ai/Bd1vSWK1nS4Ao4wblx72MI9soYqH1QjAVfkQiC2H21woeEa+AuDgwWwR0C2uJ7d7p/ZnHf8+UeNiWDBK0BnjN8MfrvmR9NCdSWiutotrRGddoak0BqiZKu3hYRLh1B7ejOvZ+2hM+X/KNaE8FL2cWMIUmlPxkjY3y7Zg2NrrpVyXYcCvLm5H3pQUQUSKGvf+ofn41AoYfwCiI/3MqJUukPhtLyI4qD7X3NFGq4b9pL9xjVJ52WqxIqBrkxU325U0v7waZsfLUQldazXeq1UWcAV3d1XgJ6TgQ4QZt+Zfo/QB57T0E3bHPf1eVaL5NvbfjG8H1XBBSbSh8PlozXH063fS0B2vLSi4lmfPObKCb2JH9Db6i2YHSdGy/bwGa3E77hYTG9CVIQWgGgZwZng4KC0jJLxcztIuqcW9EEsNPYglpFMbTTbyJiMgfUSIt0EZw1FXIZviUFhnD6QTMgsMNcBWA2AT9gqs9feHjvR5Q8JyHhVwFFcZYG7U2Ea6r2cNSYAysIHcBCw75BjstbP081kzBJSt5yR/wFcKoIFSpgUki8T9I+hqrQ0Ux/b8N0vWOZx65ocZ+ahgJJ8VItDIWYXUp1gPh9vUz91Tp8CCG8v/8UFaJyacuJIwVLMSc9PzaPWDOgu6De+Za98prv7BEr4MTPXB1qdTUhN/owzmicoTaOr8Ovm7zRDV6UhrEkC7BoRkg1Zu5enZSCOs3WVbv3kjGEUwGrXWI/L14BGZTXxA/rtMS2Q2npLEmkYlzfGADPNeHDTNPVisET53QDkg/RszESjg3xXy4dLne/WzqVe9xzyG0swaczQc4CAWJ2enbE+OG2ZIR6BuAovVr5e91cFj2Ni5HSMQWTmH9thHH9Y+0u5tX5JdS7j9iADHjAo7SAet7q6vIFlAFTjuW5wtNSWxM9O1xNiMJfRGCl4BrofspQgvQF3q8yNeaU3Gw/sTrjMkwS1Zwh6q95DmQ34JWegOfrgBtEcZnEw7tzZLgIW8frz/WiWeyCGMeqO3zjInZgr/zgzc4ZVtFKH+YBANR9aE2OhNRPWnmW+tewQyNk/OXZBodoQJ04W26Wv/G4sNcCgejZszDfxvCyWtC7ei/M0v68ZLU1G3YpD8LDaRxZsdB8cfWOytSUkM5UzopLO8JXgmoNp5XwG5pfh3ZUVHLl2Y5typI7wjtXuPj1JTcay6d95849as5WbrDi/wQRB63Thzj2R0fddTTOGe9+FyuVUk7CDWr/7CuyXwdFHNLsLINyOwGD9z2H8yZFLmM1+LvpYsudmZiDZ5dMLaBytMXCmcAIT8YNFMAwxEGFushtl6RIxzEIfHh0VMyhsc9bN4EJTZs7ly13jTl5i0O6RSx/nPE6De9DtOn+df08eDTiikDACRpd15L/3CS37blX63NV3hyXqsdwmn8VL9eGpBkbtfwQZ64WBXx1vCb4ddmhzkXVKB+nxO3ywvmtwa9MH6++ZCuOupfGed6tKg4+i485oqZPhnYuElPwavPKE0cJuZm1TDga4uATvj1toXKUMZxabeF9IzSEm+BclJgjOej1YhFFzqHtdCXTmocE1kx/MQ2v+kgR/ly3CQd8iCS/+e8K8yTAJ
Content-Type: text/plain; charset="utf-8"
Content-ID: <DC6B5949B1F4C6409BF45C5D79C26D5A@prod.exchangelabs.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB4444.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b52d49c-735d-4c16-3223-08dac0b42456
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2022 11:35:16.1996 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 40qVi2cmGLDyPsSWXZcTHia/mEJUixaOW/XhY1SdOHr9JvtU0Y4klgtYnQ6IeJ5i
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR0102MB3371
X-OriginatorOrg: mit.edu
X-W3C-Hub-DKIM-Status: validation passed: (address=jricher@mit.edu domain=mit.edu), signature is good
X-W3C-Hub-Spam-Status: No, score=-7.4
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1os0PZ-007css-Rx 29077cb310cece2043cd848827b3d35a
X-Original-To: ietf-http-wg@w3.org
Subject: Re: PEM feedback on draft-ietf-httpbis-message-signatures-13
Archived-At: <https://www.w3.org/mid/63B092A7-94F6-4FB9-A7BF-44ADD2E1431F@mit.edu>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40530
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: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Henry,

As I mentioned in the filed issue, I think it makes sense to simply add JWK formatted versions of all the keys in the examples section. Even our own test libraries have had issues with PKCS8 vs PCKS1.

 — Justin

> On Nov 6, 2022, at 10:41 AM, Henry Story <henry.story@gmail.com> wrote:
> 
> Hi,
> 
> 
>   I am very keen on this protocol becoming a standard.
> 
> The following feedback comes from trying to implement it carefully
> in Scala, compiling to JS and to JVM bytecode, so that the libraries
> can work in the browser and on the server.
> 
> I was just now at the stage of testing that the keys in the document
> can be used to correctly sign the base strings published there (see [0])
> Having such examples is very useful to test the spec, and to test
> one’s implementation of course.
> 
> Everything is fine on the Java VM, but the PEM encoded keys do not
> work well with the JS Web Crypto API. I wrote up one problem in [1].
> The Web Crypto API being deployed in all browsers is a major platform.
> As it becomes more widely adopted on NodeJS this will become
> even more important. So having examples that library devs can get to
> work on those platforms seems to me like an important requirement.
> 
> I asked the Web Crypto API folks in [2] what their feedback was,
> and got this very helpful response by @panva which I think is worth quoting in full:
> 
>> The keys in appendix-B.1.1 are in PKCS1, which isn't accepted by webcrypto at all. Recommend using rsaEncryption OID PKCS8 and SPKI PEM or JWK if they ought to be imported as CryptoKey reliably.
>> 
>> The private key in appendix-B.1.2 is 1.2.840.113549.1.1.10 (id-RSASSA-PSS). WebCryptoAPI implementations only generally accept 1.2.840.113549.1.1.1 (rsaEncryption) keys. Recommend using rsaEncryption OID PKCS8 PEM or JWK if they ought to be imported as CryptoKey reliably.
>> 
>> The private key in appendix-B.1.3 is in SEC1 format, which isn't accepted by webcrypto at all. Recommend using id-ecPublicKey OID PKCS8 PEM or JWK if they ought to be imported as CryptoKey reliably.
>> 
>> The keys in appendix-B.1.4 are fine but currently only Node.js and Deno runtimes implement Ed25519 as per Secure Curves in the Web Cryptography API.
>> 
>> Hope this helps inform the WG. I would propose to keep the PEM keys as is and add their JWK representation.
> 
> I also think there is good reason to publish both the PEM and the JWK as we are in a
> transition phase between the old binary ASN1 encodings and more semantic encodings.
> 
> I will continue working next on updating the the protocol library after
> version 07 in [3]
> 
> Henry Story
> 
> [0] https://github.com/bblfish/bobcats/pull/7
> [1] https://github.com/httpwg/http-extensions/issues/2290
> [2] https://github.com/w3c/webcrypto/issues/330#issuecomment-1304759709
> [3] https://github.com/bblfish/httpsig
> 
> 
> 
>