From a01a167b0d2f6636f15a256aa652a31cebe84b50 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 14 Dec 2016 20:30:47 +0000 Subject: [PATCH] Rely on SoftHSM being installed correctly with a p11-kit .module file I don't actually remember why I added my own; it *ought* to be installed correctly by the distribution's packaging of SoftHSM. There was a brief discussion about my hard-coded version being Fedora-specific, followed by a suggestion that I could pick up the proper path from and existing module file, followed by the realisation that said existing module file would suffice anyway. So just require it. Signed-off-by: David Woodhouse --- tests/.config/pkcs11/modules/softhsm2.module | 1 - tests/Makefile.am | 4 ++-- tests/auth-pkcs11 | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 tests/.config/pkcs11/modules/softhsm2.module diff --git a/tests/.config/pkcs11/modules/softhsm2.module b/tests/.config/pkcs11/modules/softhsm2.module deleted file mode 100644 index 2f06e09d..00000000 --- a/tests/.config/pkcs11/modules/softhsm2.module +++ /dev/null @@ -1 +0,0 @@ -module:/usr/lib64/pkcs11/libsofthsm2.so diff --git a/tests/Makefile.am b/tests/Makefile.am index d79bb84a..06e9cb65 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -171,8 +171,8 @@ $(certsdir)/ec-key-pkcs1-aes128.pem: certs/ec-key-pkcs1.pem $(OPENSSL) x509 -days 3650 -CA $(certsdir)/ca.pem -CAkey $(certsdir)/ca-key.pem \ -set_serial $(shell date +%s) -req -out $@ -in $< -SHM2_UTIL=HOME=$(srcdir) SOFTHSM2_CONF=softhsm2.conf softhsm2-util -P11TOOL=HOME=$(srcdir) SOFTHSM2_CONF=softhsm2.conf p11tool +SHM2_UTIL=SOFTHSM2_CONF=softhsm2.conf softhsm2-util +P11TOOL=SOFTHSM2_CONF=softhsm2.conf p11tool # Nice and simple: Certs visible without login, public keys present in token softhsm-setup0: diff --git a/tests/auth-pkcs11 b/tests/auth-pkcs11 index 5e9bab73..3eb988a8 100755 --- a/tests/auth-pkcs11 +++ b/tests/auth-pkcs11 @@ -36,7 +36,7 @@ for TOKEN in ${pkcs11_tokens}; do for KEY in ${pkcs11_keys}; do echo -n "Connecting to obtain cookie (token ${TOKEN} key ${KEY})... " CERTURI="pkcs11:token=${TOKEN};${KEY};pin-value=1234" - ( echo "test" | HOME=${srcdir} SOFTHSM2_CONF=softhsm2.conf LD_PRELOAD=libsocket_wrapper.so \ + ( echo "test" | SOFTHSM2_CONF=softhsm2.conf LD_PRELOAD=libsocket_wrapper.so \ $OPENCONNECT -q $ADDRESS:443 -u test -c "${CERTURI}" --key-password 1234 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly --passwd-on-stdin ) || fail $PID "Could not connect with token ${TOKEN} key ${KEY##*/}!" done