Add initialization test script with pkcs11
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Submodule pico-hsm-sdk updated: 910b2fb75a...30a2707dd8
@@ -15,12 +15,21 @@ RUN apt install -y libccid \
|
||||
gcc \
|
||||
make \
|
||||
build-essential \
|
||||
opensc \
|
||||
python3 \
|
||||
python3-pip \
|
||||
swig \
|
||||
libssl-dev \
|
||||
cmake \
|
||||
vsmartcard-vpcd \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN pip3 install pytest pycvc cryptography pyscard base58
|
||||
WORKDIR /
|
||||
RUN git clone https://github.com/OpenSC/OpenSC
|
||||
WORKDIR /OpenSC
|
||||
#RUN git checkout tags/0.23.0
|
||||
RUN ./bootstrap
|
||||
RUN ./configure --enable-openssl
|
||||
RUN make -j `nproc`
|
||||
RUN make install
|
||||
RUN ldconfig
|
||||
WORKDIR /
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash -eu
|
||||
#!/bin/bash
|
||||
|
||||
python3 tools/pico-hsm-tool.py --pin 648219 initialize --so-pin 57621880 --silent
|
||||
test $? -eq 0 || exit $?
|
||||
@@ -40,5 +40,5 @@ grep -q CKR_PIN_LOCKED <<< $e || exit $?
|
||||
pkcs11-tool --login --login-type so --so-pin 3537363231383830 --init-pin --new-pin 648219
|
||||
test $? -eq 0 || exit $?
|
||||
|
||||
pkcs11-tool --login --pin 648219 -I > /dev/null
|
||||
pkcs11-tool --login --pin 648219 -I
|
||||
test $? -eq 0 || exit $?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash -eu
|
||||
#!/bin/bash
|
||||
|
||||
rm -rf pypicohsm
|
||||
git clone https://github.com/polhenarejos/pypicohsm.git
|
||||
@@ -7,12 +7,11 @@ pip3 install -e pypicohsm
|
||||
sleep 2
|
||||
rm -f memory.flash
|
||||
tar -xf tests/memory.tar.gz
|
||||
./build_in_docker/pico_hsm > /dev/null &
|
||||
#pytest tests -W ignore::DeprecationWarning
|
||||
./build_in_docker/pico_hsm > /dev/null 2>&1 &
|
||||
pytest tests -W ignore::DeprecationWarning
|
||||
|
||||
chmod a+x tests/scripts/*.sh
|
||||
|
||||
echo -n "Test initialization... "
|
||||
./tests/scripts/initialize.sh
|
||||
echo "\tok"
|
||||
|
||||
./tests/scripts/initialize.sh > /dev/null 2>&1
|
||||
test $? -eq 0 && echo -e '\tok' || (echo -e '\tfail' && exit 1)
|
||||
|
||||
Reference in New Issue
Block a user