catch ArrayIndexOutOfBoundsException in decrypt operation, might be thrown from BouncyCastle
This commit is contained in:
@@ -167,6 +167,13 @@ 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) {
|
||||
// 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);
|
||||
OperationLog log = new OperationLog();
|
||||
log.add(LogType.MSG_DC_ERROR_IO, 1);
|
||||
return new DecryptVerifyResult(DecryptVerifyResult.RESULT_ERROR, log);
|
||||
} catch (IOException e) {
|
||||
Log.d(Constants.TAG, "IOException", e);
|
||||
OperationLog log = new OperationLog();
|
||||
|
||||
@@ -1105,7 +1105,7 @@
|
||||
<string name="msg_dc_error_integrity_check">"Integrity check error!"</string>
|
||||
<string name="msg_dc_error_integrity_missing">"Missing integrity check! This can happen because the encrypting application is out of date, or from a downgrade attack."</string>
|
||||
<string name="msg_dc_error_invalid_data">"No valid OpenPGP encrypted or signed data found!"</string>
|
||||
<string name="msg_dc_error_io">"Encountered IO Exception during operation!"</string>
|
||||
<string name="msg_dc_error_io">"Encountered an error reading input data!"</string>
|
||||
<string name="msg_dc_error_input">"Error opening input data stream!"</string>
|
||||
<string name="msg_dc_error_no_data">"No encrypted data found in stream!"</string>
|
||||
<string name="msg_dc_error_no_key">"No encrypted data with known secret key found in stream!"</string>
|
||||
|
||||
Reference in New Issue
Block a user