mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-27 01:06:14 +00:00
Fix catching ProviderException with KeyStoreException as the cause
We're looking for android.security.KeyStoreException as the cause of ProviderException, not java.security.KeyStoreException. Unfortunately this is a hidden class, so all we can do is check the class name.
This commit is contained in:
parent
c73c29d2ec
commit
7c147befcb
1 changed files with 2 additions and 2 deletions
|
@ -63,9 +63,9 @@ public class KeyStoreHandle {
|
|||
return generator.generateKey();
|
||||
} catch (ProviderException e) {
|
||||
// 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();
|
||||
if (cause instanceof KeyStoreException) {
|
||||
if (cause != null && cause.getClass().getName().equals("android.security.KeyStoreException")) {
|
||||
throw new KeyStoreHandleException(cause);
|
||||
}
|
||||
throw e;
|
||||
|
|
Loading…
Add table
Reference in a new issue