Commit e2939205 authored by Josh Ji's avatar Josh Ji

code review

parent a1b44688
# Project exclude paths
/.gradle/
/build/
.idea
.idea/jarRepositories.xml
.idea/jarRepositories.xml
......@@ -2,7 +2,6 @@ buildscript{
repositories{
mavenCentral()
maven{url 'https://javacard.pro/maven'}
maven{url 'https://deadcode.me/mvn'}
}
dependencies{
classpath 'com.klinec:gradle-javacard:1.8.0'
......@@ -22,20 +21,12 @@ sourceCompatibility = 1.8
repositories {
mavenCentral()
maven{url 'https://javacard.pro/maven'}
maven{url 'https://deadcode.me/mvn'}
flatDir{
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'
javacard{
......
......@@ -240,7 +240,7 @@ public class PassportApplet extends Applet implements ISO7816 {
byte cla = buffer[OFFSET_CLA];
byte ins = buffer[OFFSET_INS];
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 le = 0;
......@@ -271,7 +271,7 @@ public class PassportApplet extends Applet implements ISO7816 {
sw1sw2 = e.getReason();
}
} else if (protectedApdu) {
ISOException.throwIt(ISO7816.SW_SECURE_MESSAGING_NOT_SUPPORTED);
ISOException.throwIt(ISO7816.SW_SECURE_MESSAGING_NOT_SUPPORTED); // 0x6882
}
if (sw1sw2 == SW_OK) {
......@@ -337,7 +337,7 @@ public class PassportApplet extends Applet implements ISO7816 {
case INS_INTERNAL_AUTHENTICATE: //defined in 9303-11
responseLength = processInternalAuthenticate(apdu, protectedApdu);
break;
case INS_SELECT_FILE: //defined in 9303-10
case INS_SELECT_FILE: //defined in 9303-10 // 0xa4
responseLength = processSelectFile(apdu);
break;
case INS_READ_BINARY: //defined in 9303-10
......@@ -662,7 +662,7 @@ public class PassportApplet extends Applet implements ISO7816 {
*/
private short processInternalAuthenticate(APDU apdu, boolean protectedApdu) {
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);
......
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