Skip to content

Commit c31140c

Browse files
committed
test-piv.sh - Better PIV testing
test-piv.sh has been failing because PivApplet enforceses limited access to card over contactless interface.The ATR used in the virtual card test envirnment is for the contactless intrface. A fictitious ATR is now used which makes the virtual smartcard appear on a contact interface. test-piv.sh now creates a test-piv-jcardsim.cfg with the new ATR. OpenSC card-piv.c identifies the applet based on response to SELECT AID not on the ATR. The test that would fail was with pkcs11-tool -t -l - p 123456 whit the first GENERAL AUTHENTICATE crypto command. On branch sm-nist-2 Changes to be committed: modified: test-piv.sh
1 parent 3b48c5f commit c31140c

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/test-piv.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,20 @@ popd
4040
# prepare pcscd
4141
. .github/restart-pcscd.sh
4242

43+
# PIV has limited contactless interface without NIST SM
44+
# PivApplet does not support NIST SM
45+
# So use PIV contact interface with this fictitious ATR for better test:
46+
47+
echo "com.licel.jcardsim.card.applet.0.AID=A000000308000010000100" > test-piv-jcardsim.cfg
48+
echo "com.licel.jcardsim.card.applet.0.Class=net.cooperi.pivapplet.PivApplet" >> test-piv-jcardsim.cfg
49+
#com.licel.jcardsim.card.ATR=3B80800101
50+
echo "com.licel.jcardsim.card.ATR=3BD79600801103504956544553548A" >> test-piv-jcardsim.cfg
51+
echo "com.licel.jcardsim.vsmartcard.host=localhost" >> test-piv-jcardsim.cfg
52+
echo "com.licel.jcardsim.vsmartcard.port=35963" >> test-piv-jcardsim.cfg
53+
4354

4455
# start the applet and run couple of commands against that
45-
java -noverify -cp PivApplet/bin/:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard PivApplet/test/jcardsim.cfg >/dev/null &
56+
java -noverify -cp PivApplet/bin/:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard test-piv-jcardsim.cfg >/dev/null &
4657
PID=$!
4758
sleep 5
4859

0 commit comments

Comments
 (0)