call genKeyPair as soon as possible to avoid timeouts on first installation ever on JCOP3 cards. Apparently no "wait" TPDUs are sent when the card does its very first ECC key generation

This commit is contained in:
Michele Balistreri 2018-12-29 11:55:21 +03:00
parent 1f9df5503b
commit 8799ed6dc7
1 changed files with 1 additions and 1 deletions

View File

@ -149,6 +149,7 @@ public class KeycardApplet extends Applet {
public KeycardApplet(byte[] bArray, short bOffset, byte bLength) {
crypto = new Crypto();
secp256k1 = new SECP256k1(crypto);
secureChannel = new SecureChannel(PAIRING_MAX_CLIENT_COUNT, crypto, secp256k1);
uid = new byte[UID_LENGTH];
crypto.random.generateData(uid, (short) 0, UID_LENGTH);
@ -173,7 +174,6 @@ public class KeycardApplet extends Applet {
resetCurveParameters();
signature = Signature.getInstance(Signature.ALG_ECDSA_SHA_256, false);
secureChannel = new SecureChannel(PAIRING_MAX_CLIENT_COUNT, crypto, secp256k1);
duplicationEncKey = new byte[(short)(KeyBuilder.LENGTH_AES_256/8)];
expectedEntropy = -1;