summaryrefslogtreecommitdiffstats
path: root/keystore/java/android/security/KeyStoreHmacSpi.java
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-04-28 18:58:47 -0700
committerAlex Klyubin <klyubin@google.com>2015-04-29 12:44:10 -0700
commit708fc9404501ac42b6cac925fe3e10801b5f633b (patch)
tree7ac523612e9aac429bf1df2cd0a191551888fba3 /keystore/java/android/security/KeyStoreHmacSpi.java
parent47ea8b3d6bcef193a2d0ec9f0141525c83a0bcda (diff)
downloadframeworks_base-708fc9404501ac42b6cac925fe3e10801b5f633b.zip
frameworks_base-708fc9404501ac42b6cac925fe3e10801b5f633b.tar.gz
frameworks_base-708fc9404501ac42b6cac925fe3e10801b5f633b.tar.bz2
Add KeyPermanentlyInvalidatedException.
This enables users of AndroidKeyStore crypto to differentiate between the key being unusable until the user is authenticated (UserNotAuthenticatedException) and the key being permanently unusable (KeyPermanentlyInvalidatedException). The latter is the case when the secure lock screen has been disabled or reset, and, for keys that require user authentication for every use, when a new fingerprint is enrolled or all fingerprints are unenrolled. NOTE: The KeyPermanentlyInvalidatedException subsumes/replaces the NewFingerprintEnrolledException which has thus been removed. There is no way to find out whether a key was permenently invalidated specifically because a new fingerprint was added. Bug: 20642549 Bug: 20526234 Change-Id: I0206cd99eef5c605c9c4d6afc5eea02eb3b1fe6b
Diffstat (limited to 'keystore/java/android/security/KeyStoreHmacSpi.java')
-rw-r--r--keystore/java/android/security/KeyStoreHmacSpi.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/keystore/java/android/security/KeyStoreHmacSpi.java b/keystore/java/android/security/KeyStoreHmacSpi.java
index 175369c..8d71d1d 100644
--- a/keystore/java/android/security/KeyStoreHmacSpi.java
+++ b/keystore/java/android/security/KeyStoreHmacSpi.java
@@ -169,7 +169,7 @@ public abstract class KeyStoreHmacSpi extends MacSpi implements KeyStoreCryptoOp
if (opResult == null) {
throw new KeyStoreConnectException();
} else if (opResult.resultCode != KeyStore.NO_ERROR) {
- throw KeyStore.getInvalidKeyException(opResult.resultCode);
+ throw mKeyStore.getInvalidKeyException(mKey.getAlias(), opResult.resultCode);
}
if (opResult.token == null) {
throw new IllegalStateException("Keystore returned null operation token");