From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 25 Oct 2024 09:34:07 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t4Eph-000XVW-2o for lore@lore.pengutronix.de; Fri, 25 Oct 2024 09:34:07 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1t4Epi-0000o7-SE; Fri, 25 Oct 2024 09:34:06 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t4EoY-00075J-Vn; Fri, 25 Oct 2024 09:32:54 +0200 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t4EoY-000KJm-2Z; Fri, 25 Oct 2024 09:32:54 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1t4EoY-009DFH-2Q; Fri, 25 Oct 2024 09:32:54 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 25 Oct 2024 09:32:54 +0200 Message-Id: <20241025073254.2195860-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241010233115.98774-1-m.grzeschik@pengutronix.de> References: <20241010233115.98774-1-m.grzeschik@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] scripts: lib: ptxd_lib_code_signing: use pkey instead of rsa X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Michael Grzeschik Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as 363a007e38bcfb9205c5e8fb1787aad1f021f1ce. Michael [sent from post-receive hook] On Fri, 25 Oct 2024 09:32:54 +0200, Michael Grzeschik wrote: > This way openssl will automatically detect the used algorithm > of the pem and the helper is not limited to rsa. > > Signed-off-by: Michael Grzeschik > Message-Id: <20241010233115.98774-1-m.grzeschik@pengutronix.de> > Signed-off-by: Michael Olbrich > > diff --git a/scripts/lib/ptxd_lib_code_signing.sh b/scripts/lib/ptxd_lib_code_signing.sh > index bafdc16544d3..a98596b28651 100644 > --- a/scripts/lib/ptxd_lib_code_signing.sh > +++ b/scripts/lib/ptxd_lib_code_signing.sh > @@ -233,7 +233,7 @@ cs_import_pubkey_from_pem() { > openssl_keyopt=( -passin "file:${OPENSSL_KEYPASS}" ) > fi > > - openssl rsa \ > + openssl pkey \ > "${openssl_keyopt[@]}" \ > -in "${pem}" -inform pem -pubout -outform der | > softhsm_pkcs11_tool --type pubkey --write-object /dev/stdin --label "${role}" > @@ -257,7 +257,7 @@ cs_import_privkey_from_pem() { > openssl_keyopt=( -passin "file:${OPENSSL_KEYPASS}" ) > fi > > - openssl rsa \ > + openssl pkey \ > "${openssl_keyopt[@]}" \ > -in "${pem}" -inform pem -outform der | > softhsm_pkcs11_tool --type privkey --write-object /dev/stdin --label "${role}"