Merge remote-tracking branch 'origin/master'
Conflicts: OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user