2021-03-25 09:38:27 +00:00
|
|
|
name: smartgpg-test-applet
|
|
|
|
|
|
|
|
# Run this workflow every time a new commit pushed to your repository
|
|
|
|
on: push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
applet_tests:
|
2023-04-14 13:19:05 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-03-25 09:38:27 +00:00
|
|
|
steps:
|
|
|
|
# Checkout repository
|
|
|
|
- name: checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
# Run actions
|
|
|
|
# Compilation tests
|
|
|
|
- name: applet tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-04-14 13:19:05 +00:00
|
|
|
# get dependencies
|
|
|
|
echo "==== get dependencies";
|
2021-03-25 09:38:27 +00:00
|
|
|
sudo apt-get install -y --no-install-recommends procps autoconf automake libtool m4 pkg-config help2man make gcc ant automake autotools-dev sudo wget gnupg software-properties-common maven git pcscd libpcsclite-dev opensc;
|
2023-04-14 13:19:05 +00:00
|
|
|
sudo apt-get install -y python3-setuptools python3-pyscard python3-pyasn1;
|
|
|
|
pip3 install OpenPGPpy;
|
|
|
|
# get JavaCard SDKs
|
|
|
|
echo "==== get JavaCard SDKs";
|
|
|
|
git clone https://github.com/martinpaljak/oracle_javacard_sdks && mv oracle_javacard_sdks/jc303_kit/ /tmp/ && mv oracle_javacard_sdks/jc305u4_kit/ /tmp/ && rm -rf oracle_javacard_sdks;
|
|
|
|
# compile SmartPGP
|
|
|
|
echo "==== compile SmartPGP";
|
|
|
|
cat build.xml | sed 's/<cap /<cap export="SmartPGPApplet" /' > /tmp/build.xml && mv /tmp/build.xml ./;
|
2022-01-10 19:36:59 +00:00
|
|
|
JC_HOME=/tmp/jc303_kit/ ant;
|
2023-04-14 13:19:05 +00:00
|
|
|
# clone jcardsim repository, compile and install
|
|
|
|
echo "==== clone jcardsim repository, compile and install";
|
|
|
|
git clone https://github.com/licel/jcardsim;
|
|
|
|
cd jcardsim && export JC_CLASSIC_HOME=/tmp/jc305u4_kit/ && mvn initialize && mvn clean package && cd -;
|
|
|
|
# clone vsmartcard, compile and install
|
|
|
|
echo "==== clone vsmartcard, compile and install";
|
2021-03-25 09:38:27 +00:00
|
|
|
git clone https://github.com/frankmorgner/vsmartcard.git;
|
|
|
|
cd vsmartcard/virtualsmartcard && autoreconf --verbose --install && ./configure --sysconfdir=/etc && make && sudo make install && cd -;
|
2023-04-14 13:19:05 +00:00
|
|
|
# relaunch PCSC
|
|
|
|
echo "==== relaunch PCSC";
|
|
|
|
sudo killall -KILL pcscd 2> /dev/null || true;
|
|
|
|
sudo pcscd -fad 2>&1 > /tmp/log_pcsc &
|
2021-03-25 09:38:27 +00:00
|
|
|
sleep 2;
|
2023-04-14 13:19:05 +00:00
|
|
|
# launch jcardsim
|
|
|
|
echo "==== launch jcardsim";
|
|
|
|
java -cp jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar:SmartPGPApplet/smartpgp.jar com.licel.jcardsim.remote.VSmartCard .github/workflows/smartpgp.cfg 2>&1 > /tmp/log_jcardsim &
|
|
|
|
sleep 5;
|
|
|
|
# install SmartPGP
|
|
|
|
echo "==== test SmartPGP";
|
2021-03-25 09:38:27 +00:00
|
|
|
opensc-tool -l;
|
|
|
|
opensc-tool -s 80b800001810d276000124010304AFAF000000000000050000020F0F00;
|
2023-04-14 13:19:05 +00:00
|
|
|
# get card status
|
2021-03-25 09:38:27 +00:00
|
|
|
python3 .github/workflows/card-status.py;
|
2023-04-14 13:19:05 +00:00
|
|
|
# main tests
|
2021-03-25 09:38:27 +00:00
|
|
|
python3 .github/workflows/test_SmartPGP.py;
|