From f0e3e1feff3a3504d4b3d6f48f6d44a0a27ecba0 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 15 May 2016 15:50:15 -0400 Subject: Update hsmbully recipe for libhsm RPC. --- GNUmakefile | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'GNUmakefile') 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 -- cgit v1.2.3