From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sun, 12 Sep 2021 23:00:00 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mPWa0-0004ir-TR for lore@lore.pengutronix.de; Sun, 12 Sep 2021 23:00:00 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mPWa0-0006fv-Fu; Sun, 12 Sep 2021 23:00:00 +0200 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mPWZU-00063j-U7; Sun, 12 Sep 2021 22:59:28 +0200 Received: from rhi by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mPWZU-0006BP-KI; Sun, 12 Sep 2021 22:59:28 +0200 From: Roland Hieber To: ptxdist@pengutronix.de Date: Sun, 12 Sep 2021 22:59:22 +0200 Message-Id: <20210912205925.23644-2-rhi@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210912205925.23644-1-rhi@pengutronix.de> References: <20210912205925.23644-1-rhi@pengutronix.de> MIME-Version: 1.0 Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de Subject: [ptxdist] [PATCH v3 2/5] ptxd_lib_code_signing: return success in case of ERROR_CA_NOT_YET_SET 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: Marc Kleine-Budde , Roland Hieber Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.ext.pengutronix.de); SAEximRunCond expanded to false 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 Fixes: 235332de090655007e6c (2021-07-15, "ptxd_lib_code_signing: cs_get_ca(): improve error handling") Signed-off-by: Roland Hieber --- 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