SoftHSM 2.4.0 only supports softhsm2.conf now, rewrite GitLab CI commands to properly support that

This commit is contained in:
Ondřej Surý 2018-08-13 11:24:36 +02:00
parent 51286ec006
commit 2c7c3b79bd
2 changed files with 11 additions and 0 deletions

View file

@ -4436,6 +4436,7 @@
./util/nanny.pl PERL 2000,2001,2004,2007,2012,2016,2018
./util/new-func PERL 2005,2007,2012,2016,2018
./util/nt-kit SH 1999,2000,2001,2004,2007,2012,2016,2018
./util/prepare-softhsm2.sh X 2018
./util/spacewhack.pl PERL 2000,2001,2004,2007,2012,2016,2018
./util/tabify-changes SH 2004,2007,2012,2016,2018
./util/update-drafts.pl PERL 2000,2001,2004,2007,2012,2016,2018

10
util/prepare-softhsm2.sh Normal file
View file

@ -0,0 +1,10 @@
#!/bin/sh
if [ -n "${SOFTHSM2_CONF}" ] && command -v softhsm2-util >/dev/null; then
SOFTHSM2_DIR=$(dirname "$SOFTHSM2_CONF")
mkdir -p "${SOFTHSM2_DIR}/tokens"
echo "directories.tokendir = ${SOFTHSM2_DIR}/tokens" > "${SOFTHSM2_CONF}"
echo "objectstore.backend = file" >> "${SOFTHSM2_CONF}"
echo "log.level = DEBUG" >> "${SOFTHSM2_CONF}"
softhsm2-util --init-token --free --pin 0000 --so-pin 0000 --label "softhsm2";
fi
exit 0