mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] ptxd_lib_code_signing: Check for errors in cs_import_cert_from_pem()
Date: Tue, 25 Oct 2022 10:59:21 +0200	[thread overview]
Message-ID: <20221025085921.986289-1-u.kleine-koenig@pengutronix.de> (raw)

cs_import_cert_from_pem() uses a pipe command to do the necessary
things. If the first command in that pipe fails the whole command should
be considered failing. So add a call to check_pipe_status as is done in
cs_import_privkey_from_pem().

Fixes: 8f41183e0afe ("Add initial code signing support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/lib/ptxd_lib_code_signing.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/lib/ptxd_lib_code_signing.sh b/scripts/lib/ptxd_lib_code_signing.sh
index 5ba1a4666af4..bafdc16544d3 100644
--- a/scripts/lib/ptxd_lib_code_signing.sh
+++ b/scripts/lib/ptxd_lib_code_signing.sh
@@ -213,6 +213,7 @@ cs_import_cert_from_pem() {
 	"${openssl_keyopt[@]}" \
 	-in "${pem}" -inform pem -outform der |
     softhsm_pkcs11_tool --type cert --write-object /dev/stdin --label "${role}"
+    check_pipe_status
 }
 export -f cs_import_cert_from_pem
 
-- 
2.37.2




             reply	other threads:[~2022-10-25  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  8:59 Uwe Kleine-König [this message]
2022-11-11 14:31 ` [ptxdist] [APPLIED] " Michael Olbrich

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=20221025085921.986289-1-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=ptxdist@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