-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
It looks like there is an issue when loading (deserializing) an installed applet with a KeyPair class variable that is initialized with ALG_EC_FP and has generated keys.
Using algorithm ALG_RSA does not trigger the crash.
public class OTPApplet extends Applet {
private final KeyPair keyPair;
OTPApplet(byte[] bArray, short bOffset, byte bLength) {
//keyPair = new KeyPair(ALG_RSA, (short) 1024); // works on both installation and on load
keyPair = new KeyPair(ALG_EC_FP, (short) 256); // works on installation but crashes on load
keyPair.genKeyPair(); // note: for the crash to occur the keys must be generatedThe installation / instantiation of the applet works fine.
When the app is restarted it throws an exception in SimulatorRuntime::loadApplet()
Trying to load an instance of com.licel.globalplatform.GpSimulatorRuntime
Failed to load the instance! Will use the default SimulatorRuntime
com.licel.jcardsim.esotericsoftware.kryo.KryoException: java.lang.NullPointerException: Attempt to get length of null array
Serialization trace:
preCompTable (com.licel.jcardsim.bouncycastle.math.ec.ECPoint$Fp)
G (com.licel.jcardsim.bouncycastle.crypto.params.ECDomainParameters)
params (com.licel.jcardsim.bouncycastle.crypto.generators.ECKeyPairGenerator)
engine (com.licel.jcardsim.crypto.KeyPairImpl)
impl (javacard.security.KeyPair)
keyPair (com.licel.samples.applet.OTPApplet)
The issue was found when trying out the app https://github.com/licel/hotp-authenticator which is using jcardsim-3.0.5.jar
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels