From cac7c3234a6ee1d25f46a9179645e01c1c0512c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 15 Oct 2015 22:50:34 +0200 Subject: Support backupVersion ASCII Armor header --- .../org/sufficientlysecure/keychain/Constants.java | 1 - .../keychain/operations/BackupOperation.java | 1 + .../operations/results/OperationResult.java | 1 + .../keychain/pgp/PgpDecryptVerifyOperation.java | 91 ++++++++++++++++------ .../keychain/pgp/PgpSignEncryptInputParcel.java | 12 +++ .../keychain/pgp/PgpSignEncryptOperation.java | 4 + .../service/input/RequiredInputParcel.java | 9 ++- OpenKeychain/src/main/res/values/strings.xml | 1 + 8 files changed, 95 insertions(+), 25 deletions(-) (limited to 'OpenKeychain/src/main') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java index 17db500ce..1398e2d29 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/Constants.java @@ -82,7 +82,6 @@ public final class Constants { public static final class Path { public static final File APP_DIR = new File(Environment.getExternalStorageDirectory(), "OpenKeychain"); - public static final File APP_DIR_FILE = new File(APP_DIR, "export.asc"); } public static final class Notification { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/BackupOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/BackupOperation.java index 5886f000c..1ec43b625 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/BackupOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/BackupOperation.java @@ -142,6 +142,7 @@ public class BackupOperation extends BaseOperation { PgpSignEncryptInputParcel inputParcel = new PgpSignEncryptInputParcel(); inputParcel.setSymmetricPassphrase(exportInput.mSymmetricPassphrase); inputParcel.setEnableAsciiArmorOutput(true); + inputParcel.setAddBackupHeader(true); InputStream inStream = mContext.getContentResolver().openInputStream(exportOutputUri); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java index 24d1215d4..382d6c46d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java @@ -639,6 +639,7 @@ public abstract class OperationResult implements Parcelable { MSG_DC_ASKIP_NOT_ALLOWED (LogLevel.DEBUG, R.string.msg_dc_askip_not_allowed), MSG_DC_ASYM (LogLevel.DEBUG, R.string.msg_dc_asym), MSG_DC_CHARSET (LogLevel.DEBUG, R.string.msg_dc_charset), + MSG_DC_BACKUP_VERSION (LogLevel.DEBUG, R.string.msg_dc_backup_version), MSG_DC_CLEAR_DATA (LogLevel.DEBUG, R.string.msg_dc_clear_data), MSG_DC_CLEAR_DECOMPRESS (LogLevel.DEBUG, R.string.msg_dc_clear_decompress), MSG_DC_CLEAR_META_FILE (LogLevel.DEBUG, R.string.msg_dc_clear_meta_file), diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyOperation.java index 4a08ab9c1..7fe89b6f2 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerifyOperation.java @@ -31,6 +31,7 @@ import java.util.Iterator; import android.content.Context; import android.support.annotation.NonNull; +import android.text.TextUtils; import android.webkit.MimeTypeMap; import org.openintents.openpgp.OpenPgpDecryptionResult; @@ -201,6 +202,57 @@ public class PgpDecryptVerifyOperation extends BaseOperation"Data not encrypted with allowed key, skipping…" "Found block of asymmetrically encrypted data for key %s" "Found charset header: '%s'" + "Found backupVersion header: '%s'" "Processing literal data" "Unpacking compressed data" "Filename: %s" -- cgit v1.2.3