From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: "Sven Püschel" <s.pueschel@pengutronix.de>
Subject: Re: [ptxdist] [APPLIED] ptxd_lib_code_signing: only import public key in cs_import_pubkey_from_pem
Date: Thu, 25 Jun 2026 21:23:45 +0200 [thread overview]
Message-ID: <20260625192345.833105-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20260623141303.1126598-1-s.pueschel@pengutronix.de>
Thanks, applied as ca81a4eb281623c0273fefcfdc8e23a8aab62a6c.
Michael
[sent from post-receive hook]
On Thu, 25 Jun 2026 21:23:45 +0200, Sven Püschel <s.pueschel@pengutronix.de> wrote:
> Only import the public key in cs_import_pubkey_from_pem, as without
> the -pubin flag the 'openssl pkey' command tries to import
> a private key. This is a problem, when only the public key is available
> in the PEM file (e.g. production key instead of a development key).
> This results in the following error:
>
> Could not find private key of key from pubkey.pem
> 40238C2FB57F0000:error:1608010C:STORE routines:ossl_store_handle_load_result:unsupported:crypto/store/store_result.c:160:provider=default
>
> >From the man page of `openssl pkey` the -pubin flag also works with a
> private key input. In this case openssl will only read the public part.
>
> Signed-off-by: Martin Domig <martin.domig@wolfvision.net>
> Co-developed-by: Sven Püschel <s.pueschel@pengutronix.de>
> Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
> Message-Id: <20260623141303.1126598-1-s.pueschel@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> diff --git a/scripts/lib/ptxd_lib_code_signing.sh b/scripts/lib/ptxd_lib_code_signing.sh
> index c7bcfc2570f4..aa4ef99848c2 100644
> --- a/scripts/lib/ptxd_lib_code_signing.sh
> +++ b/scripts/lib/ptxd_lib_code_signing.sh
> @@ -237,7 +237,7 @@ cs_import_pubkey_from_pem() {
>
> openssl pkey \
> "${openssl_keyopt[@]}" \
> - -in "${pem}" -inform pem -pubout -outform der -out "/proc/self/fd/${tmpfd}"
> + -pubin -in "${pem}" -inform pem -pubout -outform der -out "/proc/self/fd/${tmpfd}"
> softhsm_pkcs11_tool --type pubkey --write-object "/proc/self/fd/${tmpfd}" --label "${role}"
> check_pipe_status
> }
prev parent reply other threads:[~2026-06-25 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 14:12 [ptxdist] [PATCH] " Sven Püschel
2026-06-25 19:23 ` Michael Olbrich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260625192345.833105-1-m.olbrich@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=ptxdist@pengutronix.de \
--cc=s.pueschel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox