[Cryptech-Commits] [sw/pkcs11] 01/03: Update hsmbully recipe for libhsm RPC.

git at cryptech.is git at cryptech.is
Mon May 16 04:13:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch rpc
in repository sw/pkcs11.

commit f0e3e1feff3a3504d4b3d6f48f6d44a0a27ecba0
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sun May 15 15:50:15 2016 -0400

    Update hsmbully recipe for libhsm RPC.
---
 GNUmakefile | 25 ++++++++++++++++++++-----
 1 file 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



More information about the Commits mailing list