diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-08-30 01:39:35 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-08-30 01:39:35 +0000 |
commit | 73bf1dda5d8238bc439a825b313c038a553e2a17 (patch) | |
tree | 3e95db9dcb7ebffbefc04866cf7838efb4e753ec | |
parent | 108bb4a4f73dd5a0a3753a299388cc007bb9dc84 (diff) | |
parent | c3cc04f5186ab3f0b497eaff335a75e7811ae040 (diff) | |
download | libese-73bf1dda5d8238bc439a825b313c038a553e2a17.tar.gz |
Merge "Return appropriate error when an invalid timestamptoken is provided." into main am: 5e4710662a am: 7658f2143b am: de9f7cf7c1 am: 5bd95d43ba am: c3cc04f518
Original change: https://android-review.googlesource.com/c/platform/external/libese/+/2663757
Change-Id: I06cf55a9e78d5bae9d0ac6880b2b25f4e3f19675
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | ready_se/google/keymint/KM200/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ready_se/google/keymint/KM200/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java b/ready_se/google/keymint/KM200/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java index a509edc..715a119 100644 --- a/ready_se/google/keymint/KM200/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java +++ b/ready_se/google/keymint/KM200/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java @@ -2982,12 +2982,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); @@ -3132,11 +3132,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); } } |