Skip to content

Commit

Permalink
Merge "[FAB-1648] Install SoftHSM for testing PKCS11 CSP"
Browse files Browse the repository at this point in the history
  • Loading branch information
mastersingh24 authored and Gerrit Code Review committed Jan 25, 2017
2 parents 0dea6b1 + a0898e6 commit c6ca34e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ build/image/testenv/payload: build/gotools.tar.bz2 \
orderer/orderer.yaml \
build/docker/bin/peer \
peer/core.yaml \
build/msp-sampleconfig.tar.bz2
build/msp-sampleconfig.tar.bz2 \
images/testenv/install-softhsm2.sh
build/image/runtime/payload: build/docker/busybox
build/image/zookeeper/payload: images/zookeeper/docker-entrypoint.sh
build/image/kafka/payload: images/kafka/docker-entrypoint.sh
Expand Down
4 changes: 4 additions & 0 deletions images/testenv/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ ADD payload/msp-sampleconfig.tar.bz2 $PEER_CFG_PATH
COPY payload/orderer /usr/local/bin
COPY payload/peer /usr/local/bin

# softhsm2
COPY payload/install-softhsm2.sh /tmp
RUN bash /tmp/install-softhsm2.sh && rm -f install-softhsm2.sh

# typically, this is mapped to a developer's dev environment
WORKDIR /opt/gopath/src/github.com/hyperledger/fabric
18 changes: 18 additions & 0 deletions images/testenv/install-softhsm2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -e

ARCH=`uname -m`

if [ $ARCH = "s390x" ]; then
echo "deb http://ftp.us.debian.org/debian sid main" >> /etc/apt/sources.list
fi

# Install softhsm2 package
apt-get update
apt-get -y install softhsm2

# Create tokens directory
mkdir -p /var/lib/softhsm/tokens/

#Initialize token
softhsm2-util --init-token --slot 0 --label "ForFabric" --so-pin 1234 --pin 98765432

0 comments on commit c6ca34e

Please sign in to comment.