mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-24 18:10:58 +00:00
Merge pull request #489 from alexbakker/fix-keystore-catch
Fix catching ProviderException with KeyStoreException as the cause
This commit is contained in:
commit
b55bdf8f04
1 changed files with 2 additions and 2 deletions
|
@ -63,9 +63,9 @@ public class KeyStoreHandle {
|
||||||
return generator.generateKey();
|
return generator.generateKey();
|
||||||
} catch (ProviderException e) {
|
} catch (ProviderException e) {
|
||||||
// a ProviderException can occur at runtime with buggy Keymaster HAL implementations
|
// a ProviderException can occur at runtime with buggy Keymaster HAL implementations
|
||||||
// so if this was caused by a KeyStoreException, throw a KeyStoreHandleException instead
|
// so if this was caused by an android.security.KeyStoreException, throw a KeyStoreHandleException instead
|
||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
if (cause instanceof KeyStoreException) {
|
if (cause != null && cause.getClass().getName().equals("android.security.KeyStoreException")) {
|
||||||
throw new KeyStoreHandleException(cause);
|
throw new KeyStoreHandleException(cause);
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue