aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-05-15 15:50:15 -0400
committerRob Austein <sra@hactrn.net>2016-05-15 15:50:15 -0400
commitf0e3e1feff3a3504d4b3d6f48f6d44a0a27ecba0 (patch)
tree7db415748ac75f6ae7cd3eebb3f8461599211ffe
parentc5e8e6b49f04f5679a7a9aa77721c9449a2fd55d (diff)
Update hsmbully recipe for libhsm RPC.
-rw-r--r--GNUmakefile25
1 files changed, 20 insertions, 5 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 07eb372..4a7df7c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -131,11 +131,26 @@ ifneq "${HSMBULLY}" ""
--pin fnord --so-pin fnord --pkcs11lib $(abspath libpkcs11.so) \
--verbose=9 --fast-and-frivolous --skip-fragmentation --skip-keysizing
+ HSMBULLY_DATABASE=$(abspath hsmbully.pkcs11.db)
+ HSMBULLY_KS_CLIENT=$(abspath hsmbully.client-keystore)
+ HSMBULLY_KS_SERVER=$(abspath hsmbully.server-keystore)
+
+ HSMBULLY_SERVER_BIN=$(wildcard $(abspath ../libhal/tests/test-rpc_server))
+
bully: all
- export PKCS11_DATABASE=$(abspath hsmbully.pkcs11.db); \
- sudo -E rm -f ${PKCS11_DATABASE} ${PKCS11_DATABASE}-journal; \
- (echo fnord; echo fnord) | sudo -E ./p11util --set-so-pin --set-user-pin --pin-from-stdin; \
- sudo -E ${HSMBULLY} ${HSMBULLY_OPTIONS}; \
- sudo -E rm -f ${PKCS11_DATABASE} ${PKCS11_DATABASE}-journal
+ set -x; \
+ sudo rm -f ${HSMBULLY_DATABASE} ${HSMBULLY_DATABASE}-journal ${HSMBULLY_KS_CLIENT} ${HSMBULLY_KS_SERVER}; \
+ if test -x ${HSMBULLY_SERVER_BIN}; \
+ then \
+ sudo CRYPTECH_KEYSTORE=${HSMBULLY_KS_SERVER} ${HSMBULLY_SERVER_BIN} & \
+ pid=$$!; \
+ fi; \
+ (echo fnord; echo fnord) | sudo ./p11util --set-so-pin --set-user-pin --pin-from-stdin; \
+ sudo PKCS11_DATABASE=${HSMBULLY_DATABASE} CRYPTECH_KEYSTORE=${HSMBULLY_KS_CLIENT} ${HSMBULLY} ${HSMBULLY_OPTIONS}; \
+ if test -x ${HSMBULLY_SERVER_BIN}; \
+ then \
+ sudo kill $$pid; \
+ fi; \
+ sudo rm -f ${HSMBULLY_DATABASE} ${HSMBULLY_DATABASE}-journal ${HSMBULLY_KS_CLIENT} ${HSMBULLY_KS_SERVER}
endif