diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-08-30 00:04:58 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-08-30 00:04:58 +0000 |
commit | 750765078ffe4a6cf5f30f015e48582a12857ef3 (patch) | |
tree | 26458f058ebddb8510c3c022b83280b464e43dfb | |
parent | de9f7cf7c1462b1e0e730b30f7c54bd3de025fa2 (diff) | |
parent | f5b5ce6978c2c012162cec1c5800b65cc9f9938a (diff) | |
download | libese-750765078ffe4a6cf5f30f015e48582a12857ef3.tar.gz |
Merge "Return appropriate error when an invalid timestamptoken is provided." into main am: 49876d0ead am: f5b5ce6978
Original change: https://android-review.googlesource.com/c/platform/external/libese/+/2663756
Change-Id: I7b47b51553d640a48bc7428b5c33e97ffd0f9ea0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | ready_se/google/keymint/KM300/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ready_se/google/keymint/KM300/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java b/ready_se/google/keymint/KM300/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java index 04fadea..138e505 100644 --- a/ready_se/google/keymint/KM300/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java +++ b/ready_se/google/keymint/KM300/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java @@ -2991,12 +2991,12 @@ public class KMKeymasterApplet extends Applet implements AppletEvent, ExtendedLe // validate operation handle. short ptr = KMVerificationToken.cast(data[VERIFICATION_TOKEN]).getChallenge(); if (KMInteger.compare(ptr, op.getHandle()) != 0) { - KMException.throwIt(KMError.VERIFICATION_FAILED); + KMException.throwIt(KMError.KEY_USER_NOT_AUTHENTICATED); } tmpVariables[0] = op.getAuthTime(); tmpVariables[2] = KMVerificationToken.cast(data[VERIFICATION_TOKEN]).getTimestamp(); if (tmpVariables[2] == KMType.INVALID_VALUE) { - KMException.throwIt(KMError.VERIFICATION_FAILED); + KMException.throwIt(KMError.KEY_USER_NOT_AUTHENTICATED); } if (KMInteger.compare(tmpVariables[0], tmpVariables[2]) < 0) { KMException.throwIt(KMError.KEY_USER_NOT_AUTHENTICATED); @@ -3141,11 +3141,11 @@ public class KMKeymasterApplet extends Applet implements AppletEvent, ExtendedLe short ptr = KMVerificationToken.cast(verToken).getMac(); // If mac length is zero then token is empty. if (KMByteBlob.cast(ptr).length() == 0) { - KMException.throwIt(KMError.INVALID_MAC_LENGTH); + KMException.throwIt(KMError.KEY_USER_NOT_AUTHENTICATED); } if (!verifyVerificationTokenMacInBigEndian(verToken, scratchPad)) { // Throw Exception if none of the combination works. - KMException.throwIt(KMError.VERIFICATION_FAILED); + KMException.throwIt(KMError.KEY_USER_NOT_AUTHENTICATED); } } |