Hook in user authenticators and their exceptions.

Bug: 18088752
Change-Id: I2835dbe51d09587a3081597c6aaf536aa1427e24
This commit is contained in:
Alex Klyubin
2015-03-31 19:50:13 -07:00
parent b7a34e4955
commit c8e557470f
9 changed files with 159 additions and 30 deletions

View File

@@ -101,8 +101,7 @@ public abstract class KeyStoreHmacSpi extends MacSpi {
if (opResult == null) {
throw new KeyStoreConnectException();
} else if (opResult.resultCode != KeyStore.NO_ERROR) {
throw new CryptoOperationException("Failed to start keystore operation",
KeymasterUtils.getExceptionForKeymasterError(opResult.resultCode));
throw KeymasterUtils.getCryptoOperationException(opResult.resultCode);
}
mOperationToken = opResult.token;
if (mOperationToken == null) {
@@ -128,7 +127,7 @@ public abstract class KeyStoreHmacSpi extends MacSpi {
try {
output = mChunkedStreamer.update(input, offset, len);
} catch (KeymasterException e) {
throw new CryptoOperationException("Keystore operation failed", e);
throw KeymasterUtils.getCryptoOperationException(e);
}
if ((output != null) && (output.length != 0)) {
throw new CryptoOperationException("Update operation unexpectedly produced output");
@@ -145,7 +144,7 @@ public abstract class KeyStoreHmacSpi extends MacSpi {
try {
result = mChunkedStreamer.doFinal(null, 0, 0);
} catch (KeymasterException e) {
throw new CryptoOperationException("Keystore operation failed", e);
throw KeymasterUtils.getCryptoOperationException(e);
}
engineReset();