aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-06-16 15:41:08 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-06-17 18:53:02 +0200
commit7d371d8a39caebfa663ba26d491c5eacd904a19b (patch)
treebe9006d30502b966ac91ea41f695ce0dd0f9e5eb /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java
parentf677446d512a206a64e8fe9316baf42127a13435 (diff)
downloadopen-keychain-7d371d8a39caebfa663ba26d491c5eacd904a19b.tar.gz
open-keychain-7d371d8a39caebfa663ba26d491c5eacd904a19b.tar.bz2
open-keychain-7d371d8a39caebfa663ba26d491c5eacd904a19b.zip
fix returned text of cleartext verify
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java9
1 files changed, 5 insertions, 4 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 fd3d41f93..85f0ed3df 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java
@@ -149,7 +149,7 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
return verifySignedLiteralData(input, aIn, outputStream, 0);
} else if (aIn.isClearText()) {
// a cleartext signature, verify it with the other method
- return verifyCleartextSignature(aIn, 0);
+ return verifyCleartextSignature(aIn, outputStream, 0);
} else {
// else: ascii armored encryption! go on...
return decryptVerify(input, cryptoInput, in, outputStream, 0);
@@ -833,7 +833,7 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
* pg/src/main/java/org/spongycastle/openpgp/examples/ClearSignedFileProcessor.java
*/
private DecryptVerifyResult verifyCleartextSignature(
- ArmoredInputStream aIn, int indent) throws IOException, PGPException {
+ ArmoredInputStream aIn, OutputStream outputStream, int indent) throws IOException, PGPException {
OperationLog log = new OperationLog();
@@ -863,8 +863,9 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
out.close();
byte[] clearText = out.toByteArray();
- if (out != null) {
- out.write(clearText);
+ if (outputStream != null) {
+ outputStream.write(clearText);
+ outputStream.close();
}
updateProgress(R.string.progress_processing_signature, 60, 100);