diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-17 19:24:07 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-17 19:24:07 +0200 |
commit | 374b21410e82877efcdd1e5110376e975bddbf9f (patch) | |
tree | e17df8931d627e58da677aee274249e1d51c34e2 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | |
parent | 1a7677008bae900fb11a383d04766737aaa3f02f (diff) | |
parent | 04d2b6a5076a1a7264687999152f8c24ece773ab (diff) | |
download | open-keychain-374b21410e82877efcdd1e5110376e975bddbf9f.tar.gz open-keychain-374b21410e82877efcdd1e5110376e975bddbf9f.tar.bz2 open-keychain-374b21410e82877efcdd1e5110376e975bddbf9f.zip |
Merge branch 'v/instrument' into v/multi-decrypt
Conflicts:
.travis.yml
OpenKeychain/src/androidTest/java/org/sufficientlysecure/keychain/CreateKeyActivityTest.java
OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java
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.java | 20 |
1 files changed, 6 insertions, 14 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 4651f12d4..6a85ce251 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -148,7 +148,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); @@ -767,20 +767,11 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel> // TODO: slow annealing to fake a progress? } - // after going through the stream, size should be available - Long originalSize = literalData.getDataLengthIfAvailable(); - if (originalSize != null) { - log.add(LogType.MSG_DC_CLEAR_META_SIZE, indent + 1, - Long.toString(originalSize)); - } else { - log.add(LogType.MSG_DC_CLEAR_META_SIZE_UNKNOWN, indent + 1); - } - metadata = new OpenPgpMetadata( originalFilename, mimeType, literalData.getModificationTime().getTime(), - originalSize == null ? 0 : originalSize); + alreadyWritten); if (signature != null) { updateProgress(R.string.progress_verifying_signature, 90, 100); @@ -859,7 +850,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(); @@ -889,8 +880,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); |