From: Roland Hieber <rhi@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH v1 3/5] ptxd_lib_code_signing: refactor hard-coded SoftHSM PIN in PKCS11 URIs
Date: Wed, 4 Aug 2021 16:23:28 +0200 [thread overview]
Message-ID: <20210804142330.32739-3-rhi@pengutronix.de> (raw)
In-Reply-To: <20210804142330.32739-1-rhi@pengutronix.de>
We'll need this type of function more often later.
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
scripts/lib/ptxd_lib_code_signing.sh | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/scripts/lib/ptxd_lib_code_signing.sh b/scripts/lib/ptxd_lib_code_signing.sh
index 5ba1a4666af4..66a2cab81395 100644
--- a/scripts/lib/ptxd_lib_code_signing.sh
+++ b/scripts/lib/ptxd_lib_code_signing.sh
@@ -49,6 +49,17 @@ softhsm_pkcs11_tool() {
}
export -f softhsm_pkcs11_tool
+#
+# softhsm_pkcs11_uri <uri>
+#
+# Add the SoftHSM PIN to the given URI.
+#
+softhsm_pkcs11_uri() {
+ local role="$1"
+ printf "pkcs11:token=%s;object=%s;pin-value=1111\n" "${keyprovider}" "${role}"
+}
+export -f softhsm_pkcs11_uri
+
#
# cs_init_variables
#
@@ -95,7 +106,8 @@ cs_define_role() {
mkdir -p "${keydir}/${role}" &&
# default for SoftHSM
- cs_set_uri "${role}" "pkcs11:token=${keyprovider};object=${role};pin-value=1111"
+ local uri=$(softhsm_pkcs11_uri "${role}")
+ cs_set_uri "${role}" "${uri}"
}
export -f cs_define_role
--
2.30.2
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
next prev parent reply other threads:[~2021-08-04 14:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 14:23 [ptxdist] [PATCH v1 1/5] ptxd_make_world_common: make the package name available to scripts Roland Hieber
2021-08-04 14:23 ` [ptxdist] [PATCH v1 2/5] libptxdist: introduce ptxd_exec_silent_stderr Roland Hieber
2021-08-04 14:23 ` Roland Hieber [this message]
2021-08-04 14:23 ` [ptxdist] [PATCH v1 4/5] ptxd_lib_code_signing: provide consumer functions with some environment Roland Hieber
2021-08-04 15:23 ` Michael Olbrich
2021-08-04 14:23 ` [ptxdist] [PATCH v1 5/5] ptxd_lib_code_signing: add key whitelist checks Roland Hieber
2021-08-04 15:58 ` 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=20210804142330.32739-3-rhi@pengutronix.de \
--to=rhi@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