mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH v3 2/5] ptxd_lib_code_signing: return success in case of ERROR_CA_NOT_YET_SET
Date: Sun, 12 Sep 2021 22:59:22 +0200	[thread overview]
Message-ID: <20210912205925.23644-2-rhi@pengutronix.de> (raw)
In-Reply-To: <20210912205925.23644-1-rhi@pengutronix.de>

This edge case will trigger whenever a BSP is built from scratch and the
code signing provider hasn't been installed yet, but a '='-style make
variable is expanded early. Like in cs_get_uri, this may not be an error
if the variable is expanded again after the code signing provider has
been set up, so return a successful exit code here.

Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Fixes: 235332de090655007e6c (2021-07-15, "ptxd_lib_code_signing: cs_get_ca(): improve error handling")
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
PATCH v3:
 - new in v3
---
 scripts/lib/ptxd_lib_code_signing.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/ptxd_lib_code_signing.sh b/scripts/lib/ptxd_lib_code_signing.sh
index 5ba1a4666af4..b2dbb031d17d 100644
--- a/scripts/lib/ptxd_lib_code_signing.sh
+++ b/scripts/lib/ptxd_lib_code_signing.sh
@@ -291,8 +291,12 @@ cs_get_ca() {
     local ca="${keydir}/${role}/ca.pem"
 
     if [ ! -d "${keydir}" ]; then
+	# cs_get_ca was called directly from make prior to cs_set_ca,
+	# which may not be an error if it is evaluated early *and* later
+	# again - return a unique error string in case it is not expected
+	# and a user stumbles upon this
 	echo "ERROR_CA_NOT_YET_SET"
-	return 1
+	return
     fi
 
     if [ -e "${ca}" ]; then
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


  reply	other threads:[~2021-09-12 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 20:59 [ptxdist] [PATCH v3 1/5] kernel: make sure that kbuild can extract keys from the HSM Roland Hieber
2021-09-12 20:59 ` Roland Hieber [this message]
2021-09-12 20:59 ` [ptxdist] [PATCH v3 3/5] libptxdist: introduce ptxd_exec_silent_stderr Roland Hieber
2021-09-12 20:59 ` [ptxdist] [PATCH v3 4/5] ptxd_lib_code_signing: provide consumer functions with some environment Roland Hieber
2021-09-12 20:59 ` [ptxdist] [PATCH v3 5/5] ptxd_lib_code_signing: add key whitelist checks Roland Hieber
2021-09-29 12:08   ` Michael Olbrich
2021-09-29 11:54 ` [ptxdist] [PATCH v3 1/5] kernel: make sure that kbuild can extract keys from the HSM 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=20210912205925.23644-2-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=mkl@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