From b7834b432697af8026ae403b5841fedde1697a6f Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Mon, 15 Jun 2015 03:33:19 +0200 Subject: fix recursive log in modifySecretKeyRing --- .../org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index 1da13023d..a018815f3 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -365,14 +365,9 @@ public class PgpKeyOperation { public PgpEditKeyResult modifySecretKeyRing(CanonicalizedSecretKeyRing wsKR, CryptoInputParcel cryptoInput, SaveKeyringParcel saveParcel) { - return modifySecretKeyRing(wsKR, cryptoInput, saveParcel, new OperationLog(), 0); - } - public PgpEditKeyResult modifySecretKeyRing(CanonicalizedSecretKeyRing wsKR, - CryptoInputParcel cryptoInput, - SaveKeyringParcel saveParcel, - OperationLog log, - int indent) { + OperationLog log = new OperationLog(); + int indent = 0; /* * 1. Unlock private key -- cgit v1.2.3 From 7d371d8a39caebfa663ba26d491c5eacd904a19b Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 16 Jun 2015 15:41:08 +0200 Subject: fix returned text of cleartext verify --- .../org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp') 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 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 * 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 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); -- cgit v1.2.3 From 5e771172329e59e3e0b54581d489cb5880388260 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 17 Jun 2015 04:27:42 +0200 Subject: fix filesize reporting in decrypt operation --- .../java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp') 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 85f0ed3df..e3059defb 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -757,6 +757,12 @@ public class PgpDecryptVerify extends BaseOperation // TODO: slow annealing to fake a progress? } + metadata = new OpenPgpMetadata( + originalFilename, + mimeType, + literalData.getModificationTime().getTime(), + alreadyWritten); + if (signature != null) { updateProgress(R.string.progress_verifying_signature, 90, 100); log.add(LogType.MSG_DC_CLEAR_SIGNATURE_CHECK, indent); -- cgit v1.2.3