mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-01-07 19:21:09 +00:00
samples: Escape the GnuTLS PKCS11 URL before using in command line
GnuTLS PKCS11 URLs have ';' in the string that we need to preserve for passing to GnuTLS. So we escape the semicolons before using them on the command line. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
eaf2a1db22
commit
ccb00a55cd
@ -114,6 +114,12 @@ get_config_value() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Escape the GnuTLS PKCS11 URL
|
||||
# @param1: The string with the GnuTLS PKCS11 URL
|
||||
escape_pkcs11_url() {
|
||||
echo "$1" | sed 's/;/\\;/g'
|
||||
}
|
||||
|
||||
make_dir() {
|
||||
local dir="$1"
|
||||
|
||||
@ -232,7 +238,7 @@ create_cert() {
|
||||
$options \
|
||||
$tpm_spec_params \
|
||||
$tpm_attr_params \
|
||||
--signkey ${SIGNKEY} \
|
||||
--signkey "$(escape_pkcs11_url ${SIGNKEY})" \
|
||||
--issuercert ${ISSUERCERT} \
|
||||
--out-cert ${dir}/ek.cert \
|
||||
$keyparms \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user