update github workflow
This commit is contained in:
parent
8b1463c399
commit
efdbcb6274
@ -1,20 +0,0 @@
|
|||||||
diff --git a/src/main/java/com/licel/jcardsim/crypto/SecureRandomNullProvider.java b/src/main/java/com/licel/jcardsim/crypto/SecureRandomNullProvider.java
|
|
||||||
index f4cca44..70d41a3 100644
|
|
||||||
--- a/src/main/java/com/licel/jcardsim/crypto/SecureRandomNullProvider.java
|
|
||||||
+++ b/src/main/java/com/licel/jcardsim/crypto/SecureRandomNullProvider.java
|
|
||||||
@@ -32,7 +32,14 @@ class SecureRandomNullProvider extends SecureRandom {
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void engineNextBytes(byte[] arg) {
|
|
||||||
- engine.nextBytes(arg);
|
|
||||||
+ final String doSecureRandom = System.getProperty("com.licel.jcardsim.randomdata.secure", "0");
|
|
||||||
+ if ("1".equals(doSecureRandom)){
|
|
||||||
+ SecureRandom randomGenerator = new SecureRandom();
|
|
||||||
+ randomGenerator.nextBytes(arg);
|
|
||||||
+ }
|
|
||||||
+ else{
|
|
||||||
+ engine.nextBytes(arg);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected byte[] engineGenerateSeed(int len) {
|
|
62
.github/workflows/main.yml
vendored
62
.github/workflows/main.yml
vendored
@ -5,7 +5,7 @@ on: push
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
applet_tests:
|
applet_tests:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
# Checkout repository
|
# Checkout repository
|
||||||
- name: checkout repository
|
- name: checkout repository
|
||||||
@ -15,44 +15,40 @@ jobs:
|
|||||||
- name: applet tests
|
- name: applet tests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# 1) Get dependencies
|
# get dependencies
|
||||||
|
echo "==== get dependencies";
|
||||||
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;
|
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;
|
||||||
# 2) Get JDK
|
sudo apt-get install -y python3-setuptools python3-pyscard python3-pyasn1;
|
||||||
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -;
|
pip3 install OpenPGPpy;
|
||||||
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/;
|
# get JavaCard SDKs
|
||||||
sudo apt-get update && sudo apt-get install --reinstall adoptopenjdk-8-hotspot;
|
echo "==== get JavaCard SDKs";
|
||||||
sudo update-java-alternatives -s adoptopenjdk-8-hotspot-amd64;
|
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;
|
||||||
# 3) Get Javacard SDKs
|
# compile SmartPGP
|
||||||
git clone https://github.com/martinpaljak/oracle_javacard_sdks && mv oracle_javacard_sdks/jc303_kit/ /tmp/ && mv oracle_javacard_sdks/jc305u3_kit/ /tmp/ &&rm -rf oracle_javacard_sdks;
|
echo "==== compile SmartPGP";
|
||||||
# 4) Compile our applet
|
cat build.xml | sed 's/<cap /<cap export="SmartPGPApplet" /' > /tmp/build.xml && mv /tmp/build.xml ./;
|
||||||
cat build.xml | sed 's/<cap /<cap export="SmartPGPApplet" /' > /tmp/build.xml && mv /tmp/build.xml ./; # export jar for simulator
|
|
||||||
JC_HOME=/tmp/jc303_kit/ ant;
|
JC_HOME=/tmp/jc303_kit/ ant;
|
||||||
# 5) Clone jcardsim repository, compile and install
|
# clone jcardsim repository, compile and install
|
||||||
git clone https://github.com/licel/jcardsim && cd jcardsim && git fetch origin pull/155/head:pr155 && git config --global user.name "John Doe" && git merge pr155 -m "AA" && cd -;
|
echo "==== clone jcardsim repository, compile and install";
|
||||||
# Patch random
|
git clone https://github.com/licel/jcardsim;
|
||||||
cd jcardsim && patch -p1 < ../.github/workflows/jcardsim_patches/jcardsim_random_patch && cd -;
|
cd jcardsim && export JC_CLASSIC_HOME=/tmp/jc305u4_kit/ && mvn initialize && mvn clean package && cd -;
|
||||||
# Compile
|
# clone vsmartcard, compile and install
|
||||||
cd jcardsim && export JC_CLASSIC_HOME=/tmp/jc305u3_kit/ && mvn initialize && mvn clean install && cd -;
|
echo "==== clone vsmartcard, compile and install";
|
||||||
# 7) Clone vsmartcard, compile and install
|
|
||||||
git clone https://github.com/frankmorgner/vsmartcard.git;
|
git clone https://github.com/frankmorgner/vsmartcard.git;
|
||||||
cd vsmartcard/virtualsmartcard && autoreconf --verbose --install && ./configure --sysconfdir=/etc && make && sudo make install && cd -;
|
cd vsmartcard/virtualsmartcard && autoreconf --verbose --install && ./configure --sysconfdir=/etc && make && sudo make install && cd -;
|
||||||
# 8) (re)Launch PCSCD
|
# relaunch PCSC
|
||||||
sudo killall pcscd && sudo pcscd -fad &>/tmp/log_pcsc & echo "PCSCD launched";
|
echo "==== relaunch PCSC";
|
||||||
|
sudo killall -KILL pcscd 2> /dev/null || true;
|
||||||
|
sudo pcscd -fad 2>&1 > /tmp/log_pcsc &
|
||||||
sleep 2;
|
sleep 2;
|
||||||
# 9) launch jcardsim
|
# launch jcardsim
|
||||||
java -cp jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar:SmartPGPApplet/smartpgp.jar com.licel.jcardsim.remote.VSmartCard .github/workflows/smartpgp.cfg &>/tmp/log_jcardsim & echo "jcardsim launched!";
|
echo "==== launch jcardsim";
|
||||||
# Wait a bit for insertion
|
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 2;
|
sleep 5;
|
||||||
echo "========= PCSCD log" && cat /tmp/log_pcsc;
|
# install SmartPGP
|
||||||
echo "========= jcard sim log" && cat /tmp/log_jcardsim;
|
echo "==== test SmartPGP";
|
||||||
# 10) Test our applet
|
|
||||||
# Execute tests
|
|
||||||
sudo apt-get install -y python3-setuptools python3-pyscard python-setuptools python-pyscard python-pyasn1;
|
|
||||||
pip3 install OpenPGPpy;
|
|
||||||
# Install applet
|
|
||||||
opensc-tool -l;
|
opensc-tool -l;
|
||||||
opensc-tool -s 80b800001810d276000124010304AFAF000000000000050000020F0F00;
|
opensc-tool -s 80b800001810d276000124010304AFAF000000000000050000020F0F00;
|
||||||
# Get card status
|
# get card status
|
||||||
python3 .github/workflows/card-status.py;
|
python3 .github/workflows/card-status.py;
|
||||||
# Main tests
|
# main tests
|
||||||
python3 .github/workflows/test_SmartPGP.py;
|
python3 .github/workflows/test_SmartPGP.py;
|
||||||
|
Loading…
Reference in New Issue
Block a user