diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-09-24 01:42:17 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-09-24 01:42:17 +0200 |
commit | c871891f49e2d456c8b5848d12f9c81d3efd6bc7 (patch) | |
tree | 6446333ac0da12cc477721b54ea7aa5b2e792b1c /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service | |
parent | 7654cd54fbba9fa6ecaf47f5ffc5fc21669d6e56 (diff) | |
parent | 6e0938aa9300b3bc8fa5b9c8cfd9c52a97c78506 (diff) | |
download | open-keychain-c871891f49e2d456c8b5848d12f9c81d3efd6bc7.tar.gz open-keychain-c871891f49e2d456c8b5848d12f9c81d3efd6bc7.tar.bz2 open-keychain-c871891f49e2d456c8b5848d12f9c81d3efd6bc7.zip |
Merge remote-tracking branch 'origin/master'
Conflicts:
OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service')
3 files changed, 16 insertions, 9 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index dc0d59e86..971df8ea2 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -140,15 +140,16 @@ public class KeychainIntentService extends IntentService implements Progressable public static final String ENCRYPT_ENCRYPTION_KEYS_IDS = "encryption_keys_ids"; public static final String ENCRYPT_COMPRESSION_ID = "compression_id"; public static final String ENCRYPT_MESSAGE_BYTES = "message_bytes"; - public static final String ENCRYPT_INPUT_URI = "input_uri"; + public static final String ENCRYPT_DECRYPT_INPUT_URI = "input_uri"; public static final String ENCRYPT_INPUT_URIS = "input_uris"; - public static final String ENCRYPT_OUTPUT_URI = "output_uri"; + public static final String ENCRYPT_DECRYPT_OUTPUT_URI = "output_uri"; public static final String ENCRYPT_OUTPUT_URIS = "output_uris"; public static final String ENCRYPT_SYMMETRIC_PASSPHRASE = "passphrase"; // decrypt/verify public static final String DECRYPT_CIPHERTEXT_BYTES = "ciphertext_bytes"; public static final String DECRYPT_PASSPHRASE = "passphrase"; + public static final String DECRYPT_NFC_DECRYPTED_SESSION_KEY = "nfc_decrypted_session_key"; // save keyring public static final String EDIT_KEYRING_PARCEL = "save_parcel"; @@ -337,6 +338,7 @@ public class KeychainIntentService extends IntentService implements Progressable try { /* Input */ String passphrase = data.getString(DECRYPT_PASSPHRASE); + byte[] nfcDecryptedSessionKey = data.getByteArray(DECRYPT_NFC_DECRYPTED_SESSION_KEY); InputData inputData = createDecryptInputData(data); OutputStream outStream = createCryptOutputStream(data); @@ -353,7 +355,8 @@ public class KeychainIntentService extends IntentService implements Progressable ); builder.setProgressable(this) .setAllowSymmetricDecryption(true) - .setPassphrase(passphrase); + .setPassphrase(passphrase) + .setNfcState(nfcDecryptedSessionKey); DecryptVerifyResult decryptVerifyResult = builder.build().execute(); @@ -375,6 +378,7 @@ public class KeychainIntentService extends IntentService implements Progressable try { /* Input */ String passphrase = data.getString(DECRYPT_PASSPHRASE); + byte[] nfcDecryptedSessionKey = data.getByteArray(DECRYPT_NFC_DECRYPTED_SESSION_KEY); InputData inputData = createDecryptInputData(data); @@ -391,7 +395,8 @@ public class KeychainIntentService extends IntentService implements Progressable builder.setProgressable(this) .setAllowSymmetricDecryption(true) .setPassphrase(passphrase) - .setDecryptMetadataOnly(true); + .setDecryptMetadataOnly(true) + .setNfcState(nfcDecryptedSessionKey); DecryptVerifyResult decryptVerifyResult = builder.build().execute(); @@ -860,7 +865,7 @@ public class KeychainIntentService extends IntentService implements Progressable return new InputData(new ByteArrayInputStream(bytes), bytes.length); case IO_URI: /* encrypting content uri */ - Uri providerUri = data.getParcelable(ENCRYPT_INPUT_URI); + Uri providerUri = data.getParcelable(ENCRYPT_DECRYPT_INPUT_URI); // InputStream return new InputData(getContentResolver().openInputStream(providerUri), FileHelper.getFileSize(this, providerUri, 0)); @@ -912,7 +917,7 @@ public class KeychainIntentService extends IntentService implements Progressable return ""; case IO_URI: - Uri providerUri = data.getParcelable(ENCRYPT_INPUT_URI); + Uri providerUri = data.getParcelable(ENCRYPT_DECRYPT_INPUT_URI); return FileHelper.getFilename(this, providerUri); @@ -933,7 +938,7 @@ public class KeychainIntentService extends IntentService implements Progressable return new ByteArrayOutputStream(); case IO_URI: - Uri providerUri = data.getParcelable(ENCRYPT_OUTPUT_URI); + Uri providerUri = data.getParcelable(ENCRYPT_DECRYPT_OUTPUT_URI); return getContentResolver().openOutputStream(providerUri); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java index beaa6f2ba..b0a255162 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/OperationResult.java @@ -519,7 +519,9 @@ public abstract class OperationResult implements Parcelable { MSG_CRT_UPLOAD_SUCCESS (LogLevel.OK, R.string.msg_crt_upload_success), MSG_CRT_SUCCESS (LogLevel.OK, R.string.msg_crt_success), - MSG_ACC_SAVED (LogLevel.INFO, R.string.api_settings_save) + MSG_ACC_SAVED (LogLevel.INFO, R.string.api_settings_save_msg), + + MSG_NO_VALID_ENC (LogLevel.ERROR, R.string.error_invalid_data) ; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java index 642e81246..430c739d9 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/results/SingletonResult.java @@ -34,7 +34,7 @@ public class SingletonResult extends OperationResult { super(source); } - public SingletonResult(int result, LogLevel level, LogType reason) { + public SingletonResult(int result, LogType reason) { super(result, new OperationLog()); // Prepare the log mLog.add(reason, 0); |