-
Notifications
You must be signed in to change notification settings - Fork 123
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
test: Do not reuse KeyPair context to generate second key pair #174
Open
Jakuje
wants to merge
1
commit into
licel:master
Choose a base branch
from
Jakuje:pr-174
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jakuje
added a commit
to Jakuje/OpenSC
that referenced
this pull request
Sep 1, 2021
Jakuje
added a commit
to Jakuje/OpenSC
that referenced
this pull request
Sep 2, 2021
Jakuje
referenced
this pull request
in Jakuje/jcardsim
Sep 3, 2021
This occasionally fails with java.lang.ArrayIndexOutOfBoundsException when the ECDSA key starts with 0 and the length is trimmed in setBigInteger() of ByteContainer for the first key pair and the second one does not fit. Backtraces collected from OpenSC testsuite were sometimes very different, but all point to this place: Error: testGenerateSecretECDH(com.licel.jcardsim.crypto.KeyAgreementImplTest) Time elapsed: 0.2 s <<< ERROR! java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at javacard.framework.Util.arrayCopy(Unknown Source) at com.licel.jcardsim.crypto.ByteContainer.setBytes(ByteContainer.java:122) at com.licel.jcardsim.crypto.ByteContainer.setBytes(ByteContainer.java:99) at com.licel.jcardsim.crypto.ByteContainer.setBigInteger(ByteContainer.java:87) at com.licel.jcardsim.crypto.ECPrivateKeyImpl.setParameters(ECPrivateKeyImpl.java:57) at com.licel.jcardsim.crypto.KeyPairImpl.genKeyPair(KeyPairImpl.java:93) at javacard.security.KeyPair.genKeyPair(Unknown Source) at com.licel.jcardsim.crypto.KeyAgreementImplTest.testGenerateSecret(KeyAgreementImplTest.java:119) at com.licel.jcardsim.crypto.KeyAgreementImplTest.testGenerateSecretECDH(KeyAgreementImplTest.java:56) Error: Errors: Error: com.licel.jcardsim.crypto.KeyAgreementImplTest#testGenerateSecretECDH ArrayIndexOutOfBoundsException
Jakuje
added a commit
to Jakuje/OpenSC
that referenced
this pull request
Sep 8, 2021
Jakuje
added a commit
to OpenSC/OpenSC
that referenced
this pull request
Sep 8, 2021
This occasionally fails with java.lang.ArrayIndexOutOfBoundsException when the ECDSA key starts with 0 and the length is trimmed in setBigInteger() of ByteContainer for the first key pair and the second one does not fit. Backtraces collected from OpenSC testsuite were sometimes very different, but all point to this place: Error: testGenerateSecretECDH(com.licel.jcardsim.crypto.KeyAgreementImplTest) Time elapsed: 0.2 s <<< ERROR! java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at javacard.framework.Util.arrayCopy(Unknown Source) at com.licel.jcardsim.crypto.ByteContainer.setBytes(ByteContainer.java:122) at com.licel.jcardsim.crypto.ByteContainer.setBytes(ByteContainer.java:99) at com.licel.jcardsim.crypto.ByteContainer.setBigInteger(ByteContainer.java:87) at com.licel.jcardsim.crypto.ECPrivateKeyImpl.setParameters(ECPrivateKeyImpl.java:57) at com.licel.jcardsim.crypto.KeyPairImpl.genKeyPair(KeyPairImpl.java:93) at javacard.security.KeyPair.genKeyPair(Unknown Source) at com.licel.jcardsim.crypto.KeyAgreementImplTest.testGenerateSecret(KeyAgreementImplTest.java:119) at com.licel.jcardsim.crypto.KeyAgreementImplTest.testGenerateSecretECDH(KeyAgreementImplTest.java:56) Error: Errors: Error: com.licel.jcardsim.crypto.KeyAgreementImplTest#testGenerateSecretECDH ArrayIndexOutOfBoundsException [ERROR] testGenerateSecretDH(com.licel.jcardsim.crypto.KeyAgreementImplTest) Time elapsed: 0.023 s <<< ERROR! java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at javacard.framework.Util.arrayCopy(Unknown Source) at com.licel.jcardsim.crypto.ByteContainer.setBytes(ByteContainer.java:122) at com.licel.jcardsim.crypto.ByteContainer.setBytes(ByteContainer.java:99) at com.licel.jcardsim.crypto.ByteContainer.setBigInteger(ByteContainer.java:90) at com.licel.jcardsim.crypto.DHPrivateKeyImpl.setParameters(DHPrivateKeyImpl.java:45) at com.licel.jcardsim.crypto.KeyPairImpl.genKeyPair(KeyPairImpl.java:93) at javacard.security.KeyPair.genKeyPair(Unknown Source) at com.licel.jcardsim.crypto.KeyAgreementImplTest.generateSecretDH(KeyAgreementImplTest.java:86) at com.licel.jcardsim.crypto.KeyAgreementImplTest.testGenerateSecretDH(KeyAgreementImplTest.java:71)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This occasionally fails with java.lang.ArrayIndexOutOfBoundsException
when the ECDSA key starts with 0 and the length is trimmed in
setBigInteger() of ByteContainer for the first key pair and the second
one does not fit.
Backtraces collected from OpenSC testsuite were sometimes very
different, but all point to this place: