forked from OpenSC/OpenSC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
224 lines (201 loc) · 9.24 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
language: c
matrix:
include:
- compiler: clang
os: osx
env: DO_PUSH_ARTIFACT=yes
- compiler: gcc
os: linux
env:
- DO_SIMULATION=yes
- ENABLE_DOC=--enable-doc
sudo: true
- env:
- HOST=x86_64-w64-mingw32
- DO_PUSH_ARTIFACT=yes
- env:
- HOST=i686-w64-mingw32
- DO_PUSH_ARTIFACT=yes
- env: DO_COVERITY_SCAN=yes
env:
global:
# The next declaration are encrypted envirnmet variables, created via the
# "travis encrypt" command using the project repo's public key
# COVERITY_SCAN_TOKEN
- secure: "UkHn7wy4im8V1nebCWbAetnDSOLRUbOlF6++ovk/7Bnso1/lnhXHelyzgRxfD/oI68wm9nnRV+RQEZ9+72Ug1CyvHxyyxxkwal/tPeHH4B/L+aGdPi0id+5OZSKIm77VP3m5s102sJMJgH7DFd03+nUd0K26p0tk8ad4j1geV4c="
# GH_TOKEN
- secure: "cUAvpN/XUPMIN5cgWAbIOhghRoLXyw7SCydzGaJ1Ucqb9Ml2v5iuLLuN57YbZHTiWw03vy6rYVzzwMDrHX8r3oUALsv7ViJHG4PzIe7fAFZsZpHECmGsp6SEnue7m7BNy3FT8KYbiXxnxDO0SxmFXlrPAYR0WMZCWx2TENYcafs="
- COVERITY_SCAN_BRANCH_PATTERN="(master|coverity.*)"
- COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]"
- COVERITY_SCAN_BUILD_COMMAND="make -j 4"
- COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
- SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
addons:
apt_packages:
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
- docbook-xsl
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- libpcsclite-dev
- mingw-w64
- wine
- xsltproc
- gengetopt
- libcmocka-dev
- help2man
- pcscd
- check
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update;
brew uninstall libtool;
brew install libtool;
brew install gengetopt help2man cmocka ccache;
export PATH="/usr/local/opt/ccache/libexec:$PATH";
fi
before_script:
- if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then
./bootstrap;
fi
- if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" != "false" ]; then
./bootstrap.ci -s "-pr$TRAVIS_PULL_REQUEST";
fi
- if [ "$TRAVIS_BRANCH" != "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then
./bootstrap.ci -s "-$TRAVIS_BRANCH";
fi
- if [ "$TRAVIS_BRANCH" != "master" -a "$TRAVIS_PULL_REQUEST" != "false" ]; then
./bootstrap.ci -s "-$TRAVIS_BRANCH-pr$TRAVIS_PULL_REQUEST";
fi
- if [ -z "$HOST" ]; then
CFLAGS="-Werror" ./configure $ENABLE_DOC --enable-dnie-ui;
else
if [ ! -f "$(winepath 'C:/Program Files (x86)/Inno Setup 5/ISCC.exe')" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16;
export DISPLAY=:99.0;
[ -f isetup-5.5.6.exe ] || wget http://files.jrsoftware.org/is/5/isetup-5.5.6.exe;
wine isetup-5.5.6.exe /SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART;
fi;
unset CC;
unset CXX;
./configure --host=$HOST --with-completiondir=/tmp --disable-openssl --disable-readline --disable-zlib --disable-notify --prefix=${TRAVIS_BUILD_DIR}/win32/opensc || cat config.log;
fi
# Optionally try to upload to Coverity Scan
# On error (propably quota is exhausted), just continue
- if [ "${DO_COVERITY_SCAN}" = "yes" ]; then curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash || true; fi
- if [ "${DO_SIMULATION}" = "yes" ]; then
git clone https://github.com/frankmorgner/vsmartcard.git;
cd vsmartcard/virtualsmartcard;
autoreconf -vis && ./configure && sudo make install;
cd $TRAVIS_BUILD_DIR;
sudo /etc/init.d/pcscd restart;
git clone https://github.com/martinpaljak/oracle_javacard_sdks.git;
export JC_HOME=$PWD/oracle_javacard_sdks/jc222_kit;
export JC_CLASSIC_HOME=$PWD/oracle_javacard_sdks/jc305u3_kit;
git clone https://github.com/arekinath/jcardsim.git;
cd jcardsim;
mvn initialize && mvn clean install;
cd $TRAVIS_BUILD_DIR;
git clone https://github.com/philipWendland/IsoApplet.git;
javac -classpath jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar IsoApplet/src/net/pwendland/javacard/pki/isoapplet/*.java;
echo "com.licel.jcardsim.card.applet.0.AID=F276A288BCFBA69D34F31001" > isoapplet_jcardsim.cfg;
echo "com.licel.jcardsim.card.applet.0.Class=net.pwendland.javacard.pki.isoapplet.IsoApplet" >> isoapplet_jcardsim.cfg;
echo "com.licel.jcardsim.card.ATR=3B80800101" >> isoapplet_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.host=localhost" >> isoapplet_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.port=35963" >> isoapplet_jcardsim.cfg;
git clone https://github.com/vletoux/GidsApplet.git;
javac -classpath jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar GidsApplet/src/com/mysmartlogon/gidsApplet/*.java;
echo "com.licel.jcardsim.card.applet.0.AID=A000000397425446590201" > gids_jcardsim.cfg;
echo "com.licel.jcardsim.card.applet.0.Class=com.mysmartlogon.gidsApplet.GidsApplet" >> gids_jcardsim.cfg;
echo "com.licel.jcardsim.card.ATR=3B80800101" >> gids_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.host=localhost" >> gids_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.port=35963" >> gids_jcardsim.cfg;
git clone --recursive https://github.com/Yubico/ykneo-openpgp.git;
cd ykneo-openpgp;
ant -DJAVACARD_HOME=${JC_HOME};
cd $TRAVIS_BUILD_DIR;
echo "com.licel.jcardsim.card.applet.0.AID=D2760001240102000000000000010000" > openpgp_jcardsim.cfg;
echo "com.licel.jcardsim.card.applet.0.Class=openpgpcard.OpenPGPApplet" >> openpgp_jcardsim.cfg;
echo "com.licel.jcardsim.card.ATR=3B80800101" >> openpgp_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.host=localhost" >> openpgp_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.port=35963" >> openpgp_jcardsim.cfg;
git clone --recursive https://github.com/arekinath/PivApplet.git;
cd PivApplet;
ant dist;
cd $TRAVIS_BUILD_DIR;
git clone https://github.com/Yubico/yubico-piv-tool.git;
cd yubico-piv-tool;
autoreconf -vis && ./configure && sudo make install;
cd $TRAVIS_BUILD_DIR;
fi
script:
- if [ "${DO_COVERITY_SCAN}" != "yes" ]; then
if [ $TRAVIS_OS_NAME == osx ]; then
./MacOSX/build;
else
make -j 4;
fi;
fi
- if [ -z "$HOST" -a "${DO_COVERITY_SCAN}" != "yes" ]; then
make check && make dist;
fi
- if [ ! -z "$HOST" -a "${DO_COVERITY_SCAN}" != "yes" ]; then
make install;
wine "C:/Program Files (x86)/Inno Setup 5/ISCC.exe" win32/OpenSC.iss;
fi
- if [ "${DO_SIMULATION}" = "yes" ]; then
set -ex;
sudo make install;
export LD_LIBRARY_PATH=/usr/local/lib;
java -noverify -cp IsoApplet/src/:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard isoapplet_jcardsim.cfg >/dev/null &
sleep 5;
opensc-tool --card-driver default --send-apdu 80b800001a0cf276a288bcfba69d34f310010cf276a288bcfba69d34f3100100;
opensc-tool -n;
killall java;
java -noverify -cp GidsApplet/src/:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard gids_jcardsim.cfg >/dev/null &
sleep 5;
opensc-tool --card-driver default --send-apdu 80b80000190bA0000003974254465902010bA00000039742544659020100;
opensc-tool -n;
gids-tool --initialize --pin 123456 --admin-key 000000000000000000000000000000000000000000000000 --serial 00000000000000000000000000000000;
killall java;
java -noverify -cp ykneo-openpgp/applet/bin:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard openpgp_jcardsim.cfg >/dev/null &
sleep 5;
opensc-tool --card-driver default --send-apdu 80b800002210D276000124010200000000000001000010D276000124010200000000000001000000;
opensc-tool -n;
pkcs11-tool -l -t -p 123456;
killall java;
java -noverify -cp PivApplet/bin/:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard PivApplet/test/jcardsim.cfg >/dev/null &
sleep 5;
opensc-tool --card-driver default --send-apdu 80b80000120ba000000308000010000100050000020F0F7f;
opensc-tool -n;
yubico-piv-tool -r 'Virtual PCD 00 00' -P 123456 -s 9e -a generate > pubkey-9e.pem;
yubico-piv-tool -r 'Virtual PCD 00 00' -P 123456 -s 9e -a selfsign-certificate -S '/CN=test' < pubkey-9e.pem > cert-9e.pem;
yubico-piv-tool -r 'Virtual PCD 00 00' -P 123456 -s 9e -a import-certificate < cert-9e.pem;
pkcs11-tool -l -t -p 123456;
killall java;
set +ex;
fi
after_script:
# kill process started during compilation to finish the build, see
# https://github.com/moodlerooms/moodle-plugin-ci/issues/33 for details
- if [ ! -z "$HOST" ]; then
killall services.exe;
fi
# keep in sync with appveyor.yml
- if [ "${DO_PUSH_ARTIFACT}" = "yes" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
git config --global user.email "[email protected]";
git config --global user.name "Travis CI";
.github/push_artifacts.sh "Travis CI build ${TRAVIS_JOB_NUMBER}";
fi
before_cache:
- brew cleanup
cache:
apt: true
ccache: true
directories:
- $HOME/.m2/
- $HOME/Library/Caches/Homebrew
- openssl_bin
- openpace_bin
files:
- isetup-5.5.6.exe