add scripts to install on card and a smoke test

This commit is contained in:
Michele Balistreri 2017-09-21 16:06:36 +03:00
parent d977bac7f9
commit 9427ccf48c
4 changed files with 34 additions and 0 deletions

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# JavaCard Hardware Wallet
Currently just a skeleton for the hardware wallet.
The .gpshell files are meant to be fed to GPShell. The statuswallet_install.gpshell file is actually dependent on the
target hw. Currently it assumes that the default VISA AID and keys for the ISD are used, but the version number is 2.
Other files will come and go until they are formalized as test scripts when we have a meaningful specification
and implementation.
The project is built using Gradle with the [Fidesmo Javacard Gradle plugin](https://github.com/fidesmo/gradle-javacard).

View File

@ -0,0 +1,10 @@
mode_211
enable_trace
establish_context
card_connect
select -AID A000000003000000
open_sc -security 1 -keyind 0 -keyver 2 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key 404142434445464748494a4b4c4d4e4f
send_apdu_nostop -sc 1 -APDU 80E400800E4F0C53746174757357616C6C6574
install -file ../build/javacard/im/status/wallet/javacard/wallet.cap -AID 53746174757357616C6C6574417070 -instAID 53746174757357616C6C6574417070
card_disconnect
release_context

View File

@ -0,0 +1,8 @@
mode_211
enable_trace
establish_context
card_connect
select -AID 53746174757357616C6C6574417070
send_apdu_nostop -APDU 80AA008000
card_disconnect
release_context

View File

@ -15,6 +15,11 @@ public class WalletApplet extends Applet {
}
public void process(APDU apdu) throws ISOException {
if (selectingApplet()) {
apdu.setIncomingAndReceive();
return;
}
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
}
}