diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-07-06 16:37:32 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-07-06 16:37:47 +0200 |
commit | e9e9cf2374cbe9d04ed1820dca03a73f87c41268 (patch) | |
tree | d627bcd19f6b974a969acebb02499fc6b67b90fc /OpenKeychain/src/main/java/org/sufficientlysecure/keychain | |
parent | 60df5a4edf01f1c64b9d335699aea459bdefc964 (diff) | |
download | open-keychain-e9e9cf2374cbe9d04ed1820dca03a73f87c41268.tar.gz open-keychain-e9e9cf2374cbe9d04ed1820dca03a73f87c41268.tar.bz2 open-keychain-e9e9cf2374cbe9d04ed1820dca03a73f87c41268.zip |
also catch DecoderException in decryptverify
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 026d7bb03..f72956981 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -45,6 +45,7 @@ import org.spongycastle.openpgp.operator.jcajce.CachingDataDecryptorFactory; import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider; import org.spongycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; import org.spongycastle.openpgp.operator.jcajce.JcePBEDataDecryptorFactoryBuilder; +import org.spongycastle.util.encoders.DecoderException; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.BaseOperation; @@ -167,10 +168,10 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel> OperationLog log = new OperationLog(); log.add(LogType.MSG_DC_ERROR_PGP_EXCEPTION, 1); return new DecryptVerifyResult(DecryptVerifyResult.RESULT_ERROR, log); - } catch (ArrayIndexOutOfBoundsException e) { + } catch (DecoderException | ArrayIndexOutOfBoundsException e) { // these can happen if assumptions in JcaPGPObjectFactory.nextObject() aren't // fulfilled, so we need to catch them here to handle this gracefully - Log.d(Constants.TAG, "array index out of bounds", e); + Log.d(Constants.TAG, "data error", e); OperationLog log = new OperationLog(); log.add(LogType.MSG_DC_ERROR_IO, 1); return new DecryptVerifyResult(DecryptVerifyResult.RESULT_ERROR, log); |