summaryrefslogtreecommitdiff
path: root/src/tests/Makefile
diff options
context:
space:
mode:
authorLinus Nordberg <linus@sunet.se>2019-06-19 11:56:42 +0200
committerLinus Nordberg <linus@sunet.se>2019-06-19 11:56:42 +0200
commit46e93c9de955bc8037e9ace9dc73c3d92379d7d6 (patch)
treeddc255625c9a517dbdba35bfd4a7776df9e464fb /src/tests/Makefile
parent76a4de886f1d088cb028329d09e73b92e5aaaf6d (diff)
move tests directory
Diffstat (limited to 'src/tests/Makefile')
-rw-r--r--src/tests/Makefile58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/tests/Makefile b/src/tests/Makefile
deleted file mode 100644
index 9d83a7e..0000000
--- a/src/tests/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
-# Required packages (Debian 9/stretch):
-# libengine-pkcs11-openssl: /usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
-# softhsm2: /usr/bin/softhsm2-util
-# gnutls-bin: /usr/bin/p11tool
-# openssl: /usr/bin/openssl
-
-TEXT = "A foo is a bar"
-SOFTHSM = /usr/bin/softhsm2-util
-
-SOFTHSM_PROVIDER = /usr/lib/softhsm/libsofthsm2.so
-P11P_PROVIDER = /home/linus/usr/lib/pkcs11/p11-kit-client.so
-
-p11p-softhsm: testsig.hsm.p11p.pem
- echo "$(TEXT)" |./do-verify.sh $< $(P11P_PROVIDER) ./openssl.p11p.cnf $(SOFTHSM_PROVIDER)
-
-direct-softhsm: testsig.hsm.pem
- echo "$(TEXT)" | ./do-verify.sh $< $(SOFTHSM_PROVIDER) ./openssl.direct.cnf
-
-softhsm-token-setup: softhsm-token-setup.stamp
-softhsm-token-setup.stamp: softhsm/tokens testkey.pkcs8
- test -x $(SOFTHSM)
- ( \
- BASEDIR=$$(pwd); \
- export SOFTHSM2_CONF=$$BASEDIR/softhsm/softhsm2.conf; \
- echo "directories.tokendir = $$BASEDIR/softhsm/tokens/" > $$SOFTHSM2_CONF; \
- ${SOFTHSM} --init-token --free --label mytoken --so-pin ffffff --pin ffff; \
- ${SOFTHSM} --import testkey.pkcs8 --token mytoken --label mykey --id 00 --pin ffff; \
- )
- touch $@
-
-softhsm/tokens:
- mkdir -p $@
-
-testkey.pkcs8: testkey.pem
- openssl pkey -in $< -outform pem -out $@
-
-testkey.pem:
- openssl genrsa -out $@ 2048
-
-testsig.local.pem: testkey.pem
- echo "$(TEXT)" | openssl dgst -sha256 -sign testkey.pem -out $@
-
-testsig.hsm.pem: softhsm-token-setup
- echo "$(TEXT)" | ./do-sign.sh $@ $(SOFTHSM_PROVIDER) ./openssl.direct.cnf
-
-testsig.hsm.p11p.pem: softhsm-token-setup
- echo "$(TEXT)" | ./do-sign.sh $@ $(P11P_PROVIDER) ./openssl.p11p.cnf $(SOFTHSM_PROVIDER)
-
-server-running:
-# FIXME: use env printed to do 'p11-kit server --kill', at some point
-
-clean:
- -rm -r softhsm
- -rm softhsm-token-setup.stamp
- -rm testkey.pem testkey.pkcs8
- -rm testsig.*.pem
-
-.PHONY: clean