Skip to content

Commit 6b642ed

Browse files
committed
First spark implementation
1 parent 0d0e7aa commit 6b642ed

File tree

5 files changed

+50
-3
lines changed

5 files changed

+50
-3
lines changed

.vscode/tasks.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@
224224
"type": "shell",
225225
"command": "${workspaceFolder}/.vscode/setup_totp.sh",
226226
"problemMatcher": [],
227-
}
227+
},
228+
{
229+
"label": "Setup Spark",
230+
"type": "shell",
231+
"command": "${workspaceFolder}/.vscode/setup_spark.sh",
232+
"problemMatcher": [],
233+
},
228234
]
229235
}

applets/apex-spark

applets/javacard-memory

scripts/test/apex-spark.bats

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bats
2+
3+
load res/common.sh
4+
5+
setup_file() {
6+
_setup_file
7+
}
8+
9+
teardown_file() {
10+
_teardown_file
11+
}
12+
13+
setup() {
14+
cd /tmp/builds/apex-spark
15+
java -cp /app/tools/jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar:./target com.licel.jcardsim.remote.VSmartCard /app/src/scripts/test/res/apex-spark.jcardsim.cfg > /dev/null &
16+
JCSIM_PID="$!"
17+
sleep 2
18+
KEY='20f780716ba49ae163bd638486c71723'
19+
opensc-tool -r 'Virtual PCD 00 00' -s "80 b8 00 00 1F 0C A000000846737061726B3201 00 10 $KEY FF"
20+
}
21+
22+
teardown() {
23+
_teardown
24+
}
25+
26+
27+
@test "Authentication positive" {
28+
cd /tmp/builds/apex-spark/test
29+
./authenticate.py -k $KEY
30+
}
31+
32+
@test "Authentication negative" {
33+
cd /tmp/builds/apex-spark/test
34+
run ./authenticate.py -k "ec96ca0a9bb855fac4bde8c2781f3f3d"
35+
[ "$status" -eq 1 ]
36+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
com.licel.jcardsim.card.applet.0.AID=A000000846737061726B3201
2+
com.licel.jcardsim.card.applet.0.Class=com.vivokey.spark.Spark2
3+
com.licel.jcardsim.card.ATR=3BF91800FF8131FE4550565F4A334130343040
4+
com.licel.jcardsim.vsmartcard.host=localhost
5+
com.licel.jcardsim.vsmartcard.port=35963

0 commit comments

Comments
 (0)