PivApplet icon indicating copy to clipboard operation
PivApplet copied to clipboard

Using master branch for jcardSim

Open snlgaba opened this issue 3 years ago • 4 comments

Hi,

I see to use PivApplet, we need to use your fork of jcardSim. Few key changes i see in your fork for jcard sim are: https://github.com/arekinath/jcardsim/commit/5574374559598f79be4483081784ddd1f660bcfc

  1.     buffer = JCSystem.makeTransientByteArray((short)(engine.getInputBlockSize() + 1), JCSystem.CLEAR_ON_DESELECT); in src/main/java/com/licel/jcardsim/crypto/AsymmetricCipherImpl.java 
    
  2. private static final short BUFFER_SIZE = 261; in src/main/java/com/licel/jcardsim/framework/APDUProxy.java

a) Could you please help me understand why this change was made? b) And why not merge this change in the master branch of jcardSim as well?

Really appreciate your time and efforts here.

Cheers!

snlgaba avatar Aug 26 '21 21:08 snlgaba

"Add support for smartcard/vpcd integration" which allows the applet to be run in java simulator and use a socket interface to pcsc. https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html

An example of its use: https://github.com/OpenSC/OpenSC/blob/master/.github/test-piv.sh

I don't know why it needs the extra byte I was involved in getting test-piv.sh to work under github actions recently.

Hopefully this is not causing a problem.

dengert avatar Aug 27 '21 22:08 dengert

I do see this exception when i use jcardsim-3.0.5-SNAPSHOT.jar instead of jcardsim-3.0.5.12-SNAPSHOT.jar from arekinath branch of JcardSim.

Method: processGeneralAuthRsa

Exception: javacard.security.CryptoException at javacard.security.CryptoException.throwIt(Unknown Source) at com.licel.jcardsim.crypto.AsymmetricCipherImpl.update(AsymmetricCipherImpl.java:115) at com.licel.jcardsim.crypto.AsymmetricCipherImpl.doFinal(AsymmetricCipherImpl.java:92)

snlgaba avatar Aug 31 '21 04:08 snlgaba

Hi,

Would you be able to help?

snlgaba avatar Sep 01 '21 21:09 snlgaba

Sorry, no. But I am the main developer for the OpenSC PIV driver, if you have questions. 261 comes from APDU (4) + Lc (1) + max data (255) + Le (1) = (261) for short APDUs.

dengert avatar Sep 02 '21 10:09 dengert