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

Always use ECDSA with off card hashing #28

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<target name="dist" description="generate the distribution">
<tstamp/>
<javacard jckit="ext/sdks/jc305u3_kit">
<cap targetsdk="ext/sdks/jc222_kit" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10" output="IsoApplet.cap" sources="src" version="1.0">
<cap targetsdk="ext/sdks/jc304_kit" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10" output="IsoApplet.cap" sources="src" version="1.0">
<applet class="net.pwendland.javacard.pki.isoapplet.IsoApplet" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10:01"/>
</cap>
</javacard>
Expand Down
7 changes: 4 additions & 3 deletions src/net/pwendland/javacard/pki/isoapplet/IsoApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import javacardx.crypto.Cipher;
import javacardx.apdu.ExtendedLength;
import javacard.security.CryptoException;
import javacard.security.MessageDigest;
import javacard.security.Signature;
import javacard.security.RandomData;

Expand All @@ -54,8 +55,8 @@
*/
public class IsoApplet extends Applet implements ExtendedLength {
/* API Version */
public static final byte API_VERSION_MAJOR = (byte) 0x00;
public static final byte API_VERSION_MINOR = (byte) 0x06;
public static final byte API_VERSION_MAJOR = (byte) 0x01;
public static final byte API_VERSION_MINOR = (byte) 0x00;

/* Card-specific configuration */
public static final boolean DEF_EXT_APDU = false;
Expand Down Expand Up @@ -184,7 +185,7 @@ protected IsoApplet() {
rsaPkcs1Cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);

try {
ecdsaSignature = Signature.getInstance(Signature.ALG_ECDSA_SHA, false);
ecdsaSignature = Signature.getInstance(MessageDigest.ALG_NULL, Signature.SIG_CIPHER_ECDSA, Cipher.PAD_NULL, false);
api_features |= API_FEATURE_ECC;
} catch (CryptoException e) {
if(e.getReason() == CryptoException.NO_SUCH_ALGORITHM) {
Expand Down