Commit e2939205 authored by Josh Ji's avatar Josh Ji

code review

parent a1b44688
# Project exclude paths # Project exclude paths
/.gradle/ /.gradle/
/build/ /build/
.idea
.idea/jarRepositories.xml
.idea/jarRepositories.xml
...@@ -2,7 +2,6 @@ buildscript{ ...@@ -2,7 +2,6 @@ buildscript{
repositories{ repositories{
mavenCentral() mavenCentral()
maven{url 'https://javacard.pro/maven'} maven{url 'https://javacard.pro/maven'}
maven{url 'https://deadcode.me/mvn'}
} }
dependencies{ dependencies{
classpath 'com.klinec:gradle-javacard:1.8.0' classpath 'com.klinec:gradle-javacard:1.8.0'
...@@ -22,20 +21,12 @@ sourceCompatibility = 1.8 ...@@ -22,20 +21,12 @@ sourceCompatibility = 1.8
repositories { repositories {
mavenCentral() mavenCentral()
maven{url 'https://javacard.pro/maven'} maven{url 'https://javacard.pro/maven'}
maven{url 'https://deadcode.me/mvn'}
flatDir{ flatDir{
dirs 'libs' dirs 'libs'
} }
} }
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
}
final def sdk_dir = 'sdks/jc304_kit' final def sdk_dir = 'sdks/jc304_kit'
javacard{ javacard{
......
...@@ -240,7 +240,7 @@ public class PassportApplet extends Applet implements ISO7816 { ...@@ -240,7 +240,7 @@ public class PassportApplet extends Applet implements ISO7816 {
byte cla = buffer[OFFSET_CLA]; byte cla = buffer[OFFSET_CLA];
byte ins = buffer[OFFSET_INS]; byte ins = buffer[OFFSET_INS];
short sw1sw2 = SW_OK; short sw1sw2 = SW_OK;
boolean protectedApdu = (byte)(cla & CLA_PROTECTED_APDU) == CLA_PROTECTED_APDU; boolean protectedApdu = (byte)(cla & CLA_PROTECTED_APDU) == CLA_PROTECTED_APDU; // 0x0c
short responseLength = 0; short responseLength = 0;
short le = 0; short le = 0;
...@@ -271,7 +271,7 @@ public class PassportApplet extends Applet implements ISO7816 { ...@@ -271,7 +271,7 @@ public class PassportApplet extends Applet implements ISO7816 {
sw1sw2 = e.getReason(); sw1sw2 = e.getReason();
} }
} else if (protectedApdu) { } else if (protectedApdu) {
ISOException.throwIt(ISO7816.SW_SECURE_MESSAGING_NOT_SUPPORTED); ISOException.throwIt(ISO7816.SW_SECURE_MESSAGING_NOT_SUPPORTED); // 0x6882
} }
if (sw1sw2 == SW_OK) { if (sw1sw2 == SW_OK) {
...@@ -337,7 +337,7 @@ public class PassportApplet extends Applet implements ISO7816 { ...@@ -337,7 +337,7 @@ public class PassportApplet extends Applet implements ISO7816 {
case INS_INTERNAL_AUTHENTICATE: //defined in 9303-11 case INS_INTERNAL_AUTHENTICATE: //defined in 9303-11
responseLength = processInternalAuthenticate(apdu, protectedApdu); responseLength = processInternalAuthenticate(apdu, protectedApdu);
break; break;
case INS_SELECT_FILE: //defined in 9303-10 case INS_SELECT_FILE: //defined in 9303-10 // 0xa4
responseLength = processSelectFile(apdu); responseLength = processSelectFile(apdu);
break; break;
case INS_READ_BINARY: //defined in 9303-10 case INS_READ_BINARY: //defined in 9303-10
...@@ -662,7 +662,7 @@ public class PassportApplet extends Applet implements ISO7816 { ...@@ -662,7 +662,7 @@ public class PassportApplet extends Applet implements ISO7816 {
*/ */
private short processInternalAuthenticate(APDU apdu, boolean protectedApdu) { private short processInternalAuthenticate(APDU apdu, boolean protectedApdu) {
if (!hasInternalAuthenticationKeys() || !hasMutuallyAuthenticated()) { if (!hasInternalAuthenticationKeys() || !hasMutuallyAuthenticated()) {
ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED); ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED); //6982
} }
short buffer_p = (short) (OFFSET_CDATA & 0xff); short buffer_p = (short) (OFFSET_CDATA & 0xff);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment