mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-25 07:08:30 +01:00
Invalid key file is an expected error
This commit is contained in:
@@ -1121,7 +1121,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
// throws DecoderException extends IllegalStateException
|
||||
PemObject pem = new PemReader(new InputStreamReader(is)).readPemObject();
|
||||
if (pem == null)
|
||||
throw new IllegalStateException("Invalid key file");
|
||||
throw new IllegalArgumentException("Invalid key file");
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(pem.getContent());
|
||||
cert = (X509Certificate) fact.generateCertificate(bis);
|
||||
}
|
||||
@@ -1147,7 +1147,9 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
|
||||
@Override
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
boolean expected = (ex instanceof SecurityException);
|
||||
boolean expected =
|
||||
(ex instanceof IllegalArgumentException ||
|
||||
ex instanceof SecurityException);
|
||||
Log.unexpectedError(getSupportFragmentManager(), ex, !expected);
|
||||
}
|
||||
}.execute(this, args, "setup:cert");
|
||||
|
||||
Reference in New Issue
Block a user