Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using master branch for jcardSim #58

Open
snlgaba opened this issue Aug 26, 2021 · 4 comments
Open

Using master branch for jcardSim #58

snlgaba opened this issue Aug 26, 2021 · 4 comments

Comments

@snlgaba
Copy link

snlgaba commented Aug 26, 2021

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: arekinath/jcardsim@5574374

  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!

@dengert
Copy link

dengert commented Aug 27, 2021

"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.

@snlgaba
Copy link
Author

snlgaba commented Aug 31, 2021

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
Copy link
Author

snlgaba commented Sep 1, 2021

Hi,

Would you be able to help?

@dengert
Copy link

dengert commented Sep 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants