From 7b08b18d251d4d3df681ea3be2235338c6a07c65 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 13 Sep 2014 21:21:48 +0200 Subject: some DecryptVerify log refinements --- .../keychain/pgp/PgpDecryptVerify.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure') 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 769a48a8e..bfa504bfd 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -64,6 +64,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.URLConnection; import java.security.SignatureException; +import java.util.Date; import java.util.Iterator; import java.util.Set; @@ -403,7 +404,7 @@ public class PgpDecryptVerify { updateProgress(R.string.progress_extracting_key, currentProgress, 100); try { - log.add(LogLevel.WARN, LogType.MSG_DC_UNLOCKING, indent +1); + log.add(LogLevel.INFO, LogType.MSG_DC_UNLOCKING, indent +1); if (!secretEncryptionKey.unlock(mPassphrase)) { log.add(LogLevel.ERROR, LogType.MSG_DC_ERROR_BAD_PASSPHRASE, indent +1); return new DecryptVerifyResult(DecryptVerifyResult.RESULT_ERROR, log); @@ -554,10 +555,17 @@ public class PgpDecryptVerify { literalData.getModificationTime().getTime(), originalSize); - log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_FILE, indent +1); - log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_MIME, indent +1); - log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_TIME, indent +1); - log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_SIZE, indent +1); + if ( ! originalFilename.equals("")) { + log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_FILE, indent + 1, originalFilename); + } + log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_MIME, indent +1, + mimeType); + log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_TIME, indent +1, + new Date(literalData.getModificationTime().getTime()).toString()); + if (originalSize != 0) { + log.add(LogLevel.DEBUG, LogType.MSG_DC_CLEAR_META_SIZE, indent + 1, + Long.toString(originalSize)); + } // return here if we want to decrypt the metadata only if (mDecryptMetadataOnly) { -- cgit v1.2.3