summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeymasterUtils.java
diff options
context:
space:
mode:
authorAlex Klyubin <klyubin@google.com>2015-03-27 16:53:44 -0700
committerAlex Klyubin <klyubin@google.com>2015-03-30 12:53:23 -0700
commit4ab8ea4498aa25eafdbaadd238fed6eab3f6ee59 (patch)
tree57c29e100d399530f239961857c47598bb471b19 /keystore/java/android/security/KeymasterUtils.java
parent36ee836d2f6e6df59d6a20a69421639bacf25559 (diff)
Add HmacSHA256 backed by AndroidKeyStore.
This also adds the MAC length constraint on imported HMAC keys. HMAC doesn't work without this constraint at the moment. Bug: 18088752 Change-Id: I8613f58f5d2a84df00bcf6179d13e30619440330
Diffstat (limited to 'keystore/java/android/security/KeymasterUtils.java')
-rw-r--r--keystore/java/android/security/KeymasterUtils.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/keystore/java/android/security/KeymasterUtils.java b/keystore/java/android/security/KeymasterUtils.java
index e6e88c741dfd..4f175864a9df 100644
--- a/keystore/java/android/security/KeymasterUtils.java
+++ b/keystore/java/android/security/KeymasterUtils.java
@@ -13,9 +13,11 @@ public abstract class KeymasterUtils {
case KeymasterDefs.KM_ERROR_INVALID_AUTHORIZATION_TIMEOUT:
// The name of this parameter significantly differs between Keymaster and framework
// APIs. Use the framework wording to make life easier for developers.
- return new KeymasterException("Invalid user authentication validity duration");
+ return new KeymasterException(keymasterErrorCode,
+ "Invalid user authentication validity duration");
default:
- return new KeymasterException(KeymasterDefs.getErrorMessage(keymasterErrorCode));
+ return new KeymasterException(keymasterErrorCode,
+ KeymasterDefs.getErrorMessage(keymasterErrorCode));
}
}
}