aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-08-29 22:34:49 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-08-29 22:34:49 +0000
commit49876d0eadd2eee9be91a09bcf7d04e45a95aa4b (patch)
tree26458f058ebddb8510c3c022b83280b464e43dfb
parent5e4710662a5efe9418a0c9cf7aed3945c75fea59 (diff)
parent1b8fddc7f671613101671a94d5f5270ffcf71086 (diff)
downloadlibese-49876d0eadd2eee9be91a09bcf7d04e45a95aa4b.tar.gz
Merge "Return appropriate error when an invalid timestamptoken is provided." into main
-rw-r--r--ready_se/google/keymint/KM300/Applet/src/com/android/javacard/keymaster/KMKeymasterApplet.java8
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);
}
}