diff --git a/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java b/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java index ebde5d27..03d8369b 100644 --- a/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java +++ b/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java @@ -456,7 +456,7 @@ public void process(APDU apdu) { } byte[] apduBuffer = apdu.getBuffer(); byte apduIns = apduBuffer[ISO7816.OFFSET_INS]; - if (!isKeymintReady(apduIns)) { + if (!isKeyMintReady(apduIns)) { ISOException.throwIt(ISO7816.SW_COMMAND_NOT_ALLOWED); } switch (apduIns) { @@ -568,7 +568,7 @@ public void process(APDU apdu) { // 1. boot parameters are set, // 2. system properties are set and // 3. computed the shared secret successfully. - private boolean isKeymintReady(byte apduIns) { + private boolean isKeyMintReady(byte apduIns) { if(kmDataStore.isDeviceReady()) { return true; } diff --git a/Applet/src/com/android/javacard/keymaster/KMKeymintDataStore.java b/Applet/src/com/android/javacard/keymaster/KMKeymintDataStore.java index 4380cb67..c65e4d8e 100644 --- a/Applet/src/com/android/javacard/keymaster/KMKeymintDataStore.java +++ b/Applet/src/com/android/javacard/keymaster/KMKeymintDataStore.java @@ -345,12 +345,12 @@ public void setDeviceBootStatus(byte initStatus) { } public boolean isDeviceReady() { - boolean result = false; - short offset = repository.allocReclaimableMemory(DEVICE_STATUS_FLAG_SIZE); - byte[] buf = repository.getHeap(); - getDeviceBootStatus(buf, offset); - byte bootCompleteStatus = SET_BOOT_PARAMS_SUCCESS | SET_SYSTEM_PROPERTIES_SUCCESS | - SET_SYSTEM_PROPERTIES_SUCCESS; + boolean result = false; + short offset = repository.allocReclaimableMemory(DEVICE_STATUS_FLAG_SIZE); + byte[] buf = repository.getHeap(); + getDeviceBootStatus(buf, offset); + byte bootCompleteStatus = (SET_BOOT_PARAMS_SUCCESS | SET_SYSTEM_PROPERTIES_SUCCESS | + NEGOTIATED_SHARED_SECRET_SUCCESS); if (bootCompleteStatus == (buf[offset] & bootCompleteStatus)) { result = true; }