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 \
|
gcc \
|
||||||
make \
|
make \
|
||||||
build-essential \
|
build-essential \
|
||||||
opensc \
|
|
||||||
python3 \
|
python3 \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
swig \
|
swig \
|
||||||
|
libssl-dev \
|
||||||
cmake \
|
cmake \
|
||||||
vsmartcard-vpcd \
|
vsmartcard-vpcd \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
RUN pip3 install pytest pycvc cryptography pyscard base58
|
RUN pip3 install pytest pycvc cryptography pyscard base58
|
||||||
WORKDIR /
|
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
|
python3 tools/pico-hsm-tool.py --pin 648219 initialize --so-pin 57621880 --silent
|
||||||
test $? -eq 0 || exit $?
|
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
|
pkcs11-tool --login --login-type so --so-pin 3537363231383830 --init-pin --new-pin 648219
|
||||||
test $? -eq 0 || exit $?
|
test $? -eq 0 || exit $?
|
||||||
|
|
||||||
pkcs11-tool --login --pin 648219 -I > /dev/null
|
pkcs11-tool --login --pin 648219 -I
|
||||||
test $? -eq 0 || exit $?
|
test $? -eq 0 || exit $?
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash -eu
|
#!/bin/bash
|
||||||
|
|
||||||
rm -rf pypicohsm
|
rm -rf pypicohsm
|
||||||
git clone https://github.com/polhenarejos/pypicohsm.git
|
git clone https://github.com/polhenarejos/pypicohsm.git
|
||||||
@@ -7,12 +7,11 @@ pip3 install -e pypicohsm
|
|||||||
sleep 2
|
sleep 2
|
||||||
rm -f memory.flash
|
rm -f memory.flash
|
||||||
tar -xf tests/memory.tar.gz
|
tar -xf tests/memory.tar.gz
|
||||||
./build_in_docker/pico_hsm > /dev/null &
|
./build_in_docker/pico_hsm > /dev/null 2>&1 &
|
||||||
#pytest tests -W ignore::DeprecationWarning
|
pytest tests -W ignore::DeprecationWarning
|
||||||
|
|
||||||
chmod a+x tests/scripts/*.sh
|
chmod a+x tests/scripts/*.sh
|
||||||
|
|
||||||
echo -n "Test initialization... "
|
echo -n "Test initialization... "
|
||||||
./tests/scripts/initialize.sh
|
./tests/scripts/initialize.sh > /dev/null 2>&1
|
||||||
echo "\tok"
|
test $? -eq 0 && echo -e '\tok' || (echo -e '\tfail' && exit 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user