aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-08-29 23:16:21 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-08-29 23:16:21 +0000
commit5bd95d43baf1c917ed744cf4da79e3ef938c54d3 (patch)
tree3e95db9dcb7ebffbefc04866cf7838efb4e753ec
parentd815a20c05c4f4110a322db15c6735282d932e6e (diff)
parentde9f7cf7c1462b1e0e730b30f7c54bd3de025fa2 (diff)
downloadlibese-5bd95d43baf1c917ed744cf4da79e3ef938c54d3.tar.gz
Merge "Return appropriate error when an invalid timestamptoken is provided." into main am: 5e4710662a am: 7658f2143b am: de9f7cf7c1
Original change: https://android-review.googlesource.com/c/platform/external/libese/+/2663757 Change-Id: I5ab1b68c2c048878c30c46e0fec99a484ad224d7 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.java8
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);
}
}