allowed operations to modify CryptoInputParcel they receive
This commit is contained in:
@@ -103,7 +103,10 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> {
|
|||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
return new CertifyResult(log,
|
return new CertifyResult(log,
|
||||||
RequiredInputParcel.createRequiredSignPassphrase(
|
RequiredInputParcel.createRequiredSignPassphrase(
|
||||||
certificationKey.getKeyId(), certificationKey.getKeyId(), null)
|
certificationKey.getKeyId(),
|
||||||
|
certificationKey.getKeyId(),
|
||||||
|
null),
|
||||||
|
cryptoInput
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -189,7 +192,7 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> {
|
|||||||
|
|
||||||
if (!allRequiredInput.isEmpty()) {
|
if (!allRequiredInput.isEmpty()) {
|
||||||
log.add(LogType.MSG_CRT_NFC_RETURN, 1);
|
log.add(LogType.MSG_CRT_NFC_RETURN, 1);
|
||||||
return new CertifyResult(log, allRequiredInput.build());
|
return new CertifyResult(log, allRequiredInput.build(), cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.add(LogType.MSG_CRT_SAVING, 1);
|
log.add(LogType.MSG_CRT_SAVING, 1);
|
||||||
@@ -211,7 +214,7 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> {
|
|||||||
// explicit proxy not set
|
// explicit proxy not set
|
||||||
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
||||||
return new CertifyResult(null,
|
return new CertifyResult(null,
|
||||||
RequiredInputParcel.createOrbotRequiredOperation());
|
RequiredInputParcel.createOrbotRequiredOperation(), cryptoInput);
|
||||||
}
|
}
|
||||||
proxy = Preferences.getPreferences(mContext).getProxyPrefs()
|
proxy = Preferences.getPreferences(mContext).getProxyPrefs()
|
||||||
.parcelableProxy.getProxy();
|
.parcelableProxy.getProxy();
|
||||||
|
|||||||
@@ -130,18 +130,6 @@ public class ExportOperation extends BaseOperation<ExportKeyringParcel> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* returns null if no user input required for upload, an InputPendingResult otherwise
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
public InputPendingResult getUploadPendingInput() {
|
|
||||||
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
|
||||||
return new ExportResult(null,
|
|
||||||
RequiredInputParcel.createOrbotRequiredOperation());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExportResult exportToFile(long[] masterKeyIds, boolean exportSecret, String outputFile) {
|
public ExportResult exportToFile(long[] masterKeyIds, boolean exportSecret, String outputFile) {
|
||||||
|
|
||||||
OperationLog log = new OperationLog();
|
OperationLog log = new OperationLog();
|
||||||
@@ -355,7 +343,7 @@ public class ExportOperation extends BaseOperation<ExportKeyringParcel> {
|
|||||||
// explicit proxy not set
|
// explicit proxy not set
|
||||||
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
||||||
return new ExportResult(null,
|
return new ExportResult(null,
|
||||||
RequiredInputParcel.createOrbotRequiredOperation());
|
RequiredInputParcel.createOrbotRequiredOperation(), cryptoInput);
|
||||||
}
|
}
|
||||||
proxy = Preferences.getPreferences(mContext).getProxyPrefs()
|
proxy = Preferences.getPreferences(mContext).getProxyPrefs()
|
||||||
.parcelableProxy.getProxy();
|
.parcelableProxy.getProxy();
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ public class ImportOperation extends BaseOperation<ImportKeyringParcel> {
|
|||||||
if(!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
if(!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
||||||
// show dialog to enable/install dialog
|
// show dialog to enable/install dialog
|
||||||
return new ImportKeyResult(null,
|
return new ImportKeyResult(null,
|
||||||
RequiredInputParcel.createOrbotRequiredOperation());
|
RequiredInputParcel.createOrbotRequiredOperation(), cryptoInput);
|
||||||
}
|
}
|
||||||
proxy = Preferences.getPreferences(mContext).getProxyPrefs().parcelableProxy
|
proxy = Preferences.getPreferences(mContext).getProxyPrefs().parcelableProxy
|
||||||
.getProxy();
|
.getProxy();
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class KeybaseVerificationOperation extends BaseOperation<KeybaseVerificat
|
|||||||
// explicit proxy not set
|
// explicit proxy not set
|
||||||
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
if (!OrbotHelper.isOrbotInRequiredState(mContext)) {
|
||||||
return new KeybaseVerificationResult(null,
|
return new KeybaseVerificationResult(null,
|
||||||
RequiredInputParcel.createOrbotRequiredOperation());
|
RequiredInputParcel.createOrbotRequiredOperation(), cryptoInput);
|
||||||
}
|
}
|
||||||
proxy = Preferences.getPreferences(mContext).getProxyPrefs()
|
proxy = Preferences.getPreferences(mContext).getProxyPrefs()
|
||||||
.parcelableProxy.getProxy();
|
.parcelableProxy.getProxy();
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
|
|||||||
RequiredInputParcel requiredInput = result.getRequiredInputParcel();
|
RequiredInputParcel requiredInput = result.getRequiredInputParcel();
|
||||||
// Passphrase returns immediately, nfc are aggregated
|
// Passphrase returns immediately, nfc are aggregated
|
||||||
if (requiredInput.mType == RequiredInputType.PASSPHRASE) {
|
if (requiredInput.mType == RequiredInputType.PASSPHRASE) {
|
||||||
return new SignEncryptResult(log, requiredInput, results);
|
return new SignEncryptResult(log, requiredInput, results, cryptoInput);
|
||||||
}
|
}
|
||||||
if (pendingInputBuilder == null) {
|
if (pendingInputBuilder == null) {
|
||||||
pendingInputBuilder = new NfcSignOperationsBuilder(requiredInput.mSignatureTime,
|
pendingInputBuilder = new NfcSignOperationsBuilder(requiredInput.mSignatureTime,
|
||||||
@@ -173,7 +173,7 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
|
|||||||
} while (!inputUris.isEmpty());
|
} while (!inputUris.isEmpty());
|
||||||
|
|
||||||
if (pendingInputBuilder != null && !pendingInputBuilder.isEmpty()) {
|
if (pendingInputBuilder != null && !pendingInputBuilder.isEmpty()) {
|
||||||
return new SignEncryptResult(log, pendingInputBuilder.build(), results);
|
return new SignEncryptResult(log, pendingInputBuilder.build(), results, cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!outputUris.isEmpty()) {
|
if (!outputUris.isEmpty()) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.content.Intent;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
|
import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
|
||||||
import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
|
import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
|
||||||
@@ -38,8 +39,9 @@ public class CertifyResult extends InputPendingResult {
|
|||||||
super(result, log);
|
super(result, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CertifyResult(OperationLog log, RequiredInputParcel requiredInput) {
|
public CertifyResult(OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CertifyResult(int result, OperationLog log, int certifyOk, int certifyError, int uploadOk, int uploadError) {
|
public CertifyResult(int result, OperationLog log, int certifyOk, int certifyError, int uploadOk, int uploadError) {
|
||||||
|
|||||||
@@ -45,8 +45,9 @@ public class DecryptVerifyResult extends InputPendingResult {
|
|||||||
super(result, log);
|
super(result, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DecryptVerifyResult(OperationLog log, RequiredInputParcel requiredInput) {
|
public DecryptVerifyResult(OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DecryptVerifyResult(Parcel source) {
|
public DecryptVerifyResult(Parcel source) {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.os.Parcel;
|
|||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
|
import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
|
||||||
import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
|
import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
|
||||||
@@ -47,8 +48,9 @@ public class DeleteResult extends InputPendingResult {
|
|||||||
* @param log operation log upto point of required input, if any
|
* @param log operation log upto point of required input, if any
|
||||||
* @param requiredInput represents input required
|
* @param requiredInput represents input required
|
||||||
*/
|
*/
|
||||||
public DeleteResult(@Nullable OperationLog log, RequiredInputParcel requiredInput) {
|
public DeleteResult(@Nullable OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
// values are not to be used
|
// values are not to be used
|
||||||
mOk = -1;
|
mOk = -1;
|
||||||
mFail = -1;
|
mFail = -1;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.operations.results;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
|
|
||||||
public class ExportResult extends InputPendingResult {
|
public class ExportResult extends InputPendingResult {
|
||||||
@@ -36,8 +37,9 @@ public class ExportResult extends InputPendingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ExportResult(OperationLog log, RequiredInputParcel requiredInputParcel) {
|
public ExportResult(OperationLog log, RequiredInputParcel requiredInputParcel,
|
||||||
super(log, requiredInputParcel);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInputParcel, cryptoInputParcel);
|
||||||
// we won't use these values
|
// we won't use these values
|
||||||
mOkPublic = -1;
|
mOkPublic = -1;
|
||||||
mOkSecret = -1;
|
mOkSecret = -1;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.operations.results;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
|
|
||||||
public class GetKeyResult extends InputPendingResult {
|
public class GetKeyResult extends InputPendingResult {
|
||||||
@@ -38,8 +39,9 @@ public class GetKeyResult extends InputPendingResult {
|
|||||||
super(result, log);
|
super(result, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetKeyResult(OperationLog log, RequiredInputParcel requiredInput) {
|
public GetKeyResult(OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final int RESULT_ERROR_NO_VALID_KEYS = RESULT_ERROR + 8;
|
public static final int RESULT_ERROR_NO_VALID_KEYS = RESULT_ERROR + 8;
|
||||||
|
|||||||
@@ -96,8 +96,9 @@ public class ImportKeyResult extends InputPendingResult {
|
|||||||
mImportedMasterKeyIds = importedMasterKeyIds;
|
mImportedMasterKeyIds = importedMasterKeyIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImportKeyResult(OperationLog log, RequiredInputParcel requiredInputParcel) {
|
public ImportKeyResult(OperationLog log, RequiredInputParcel requiredInputParcel,
|
||||||
super(log, requiredInputParcel);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInputParcel, cryptoInputParcel);
|
||||||
// just assign default values, we won't use them anyway
|
// just assign default values, we won't use them anyway
|
||||||
mNewKeys = 0;
|
mNewKeys = 0;
|
||||||
mUpdatedKeys = 0;
|
mUpdatedKeys = 0;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class InputPendingResult extends OperationResult {
|
|||||||
|
|
||||||
final RequiredInputParcel mRequiredInput;
|
final RequiredInputParcel mRequiredInput;
|
||||||
// in case operation needs to add to/changes the cryptoInputParcel sent to it
|
// in case operation needs to add to/changes the cryptoInputParcel sent to it
|
||||||
final CryptoInputParcel mCryptoInputParcel;
|
public final CryptoInputParcel mCryptoInputParcel;
|
||||||
|
|
||||||
public InputPendingResult(int result, OperationLog log) {
|
public InputPendingResult(int result, OperationLog log) {
|
||||||
super(result, log);
|
super(result, log);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.os.Parcelable;
|
|||||||
import com.textuality.keybase.lib.KeybaseException;
|
import com.textuality.keybase.lib.KeybaseException;
|
||||||
import com.textuality.keybase.lib.prover.Prover;
|
import com.textuality.keybase.lib.prover.Prover;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
|
|
||||||
public class KeybaseVerificationResult extends InputPendingResult {
|
public class KeybaseVerificationResult extends InputPendingResult {
|
||||||
@@ -46,8 +47,9 @@ public class KeybaseVerificationResult extends InputPendingResult {
|
|||||||
mPresenceLabel = prover.getPresenceLabel();
|
mPresenceLabel = prover.getPresenceLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeybaseVerificationResult(OperationLog log, RequiredInputParcel requiredInputParcel) {
|
public KeybaseVerificationResult(OperationLog log, RequiredInputParcel requiredInputParcel,
|
||||||
super(log, requiredInputParcel);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInputParcel, cryptoInputParcel);
|
||||||
mProofUrl = null;
|
mProofUrl = null;
|
||||||
mPresenceUrl = null;
|
mPresenceUrl = null;
|
||||||
mPresenceLabel = null;
|
mPresenceLabel = null;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.os.Parcel;
|
|||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
|
import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
|
|
||||||
|
|
||||||
@@ -37,8 +38,9 @@ public class PgpEditKeyResult extends InputPendingResult {
|
|||||||
mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : Constants.key.none;
|
mRingMasterKeyId = ring != null ? ring.getMasterKeyId() : Constants.key.none;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PgpEditKeyResult(OperationLog log, RequiredInputParcel requiredInput) {
|
public PgpEditKeyResult(OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
mRingMasterKeyId = Constants.key.none;
|
mRingMasterKeyId = Constants.key.none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.operations.results;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
|
|
||||||
|
|
||||||
@@ -38,8 +39,9 @@ public class PgpSignEncryptResult extends InputPendingResult {
|
|||||||
super(result, log);
|
super(result, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PgpSignEncryptResult(OperationLog log, RequiredInputParcel requiredInput) {
|
public PgpSignEncryptResult(OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PgpSignEncryptResult(Parcel source) {
|
public PgpSignEncryptResult(Parcel source) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.os.Parcelable;
|
|||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
|
import org.sufficientlysecure.keychain.ui.LogDisplayActivity;
|
||||||
import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
|
import org.sufficientlysecure.keychain.ui.LogDisplayFragment;
|
||||||
@@ -26,8 +27,9 @@ public class RevokeResult extends InputPendingResult {
|
|||||||
* @param log operation log upto point of required input, if any
|
* @param log operation log upto point of required input, if any
|
||||||
* @param requiredInput represents input required
|
* @param requiredInput represents input required
|
||||||
*/
|
*/
|
||||||
public RevokeResult(@Nullable OperationLog log, RequiredInputParcel requiredInput) {
|
public RevokeResult(@Nullable OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
// we won't use these values
|
// we won't use these values
|
||||||
mMasterKeyId = -1;
|
mMasterKeyId = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.os.Parcel;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
|
|
||||||
|
|
||||||
@@ -29,8 +30,10 @@ public class SignEncryptResult extends InputPendingResult {
|
|||||||
ArrayList<PgpSignEncryptResult> mResults;
|
ArrayList<PgpSignEncryptResult> mResults;
|
||||||
byte[] mResultBytes;
|
byte[] mResultBytes;
|
||||||
|
|
||||||
public SignEncryptResult(OperationLog log, RequiredInputParcel requiredInput, ArrayList<PgpSignEncryptResult> results) {
|
public SignEncryptResult(OperationLog log, RequiredInputParcel requiredInput,
|
||||||
super(log, requiredInput);
|
ArrayList<PgpSignEncryptResult> results,
|
||||||
|
CryptoInputParcel cryptoInputParcel) {
|
||||||
|
super(log, requiredInput, cryptoInputParcel);
|
||||||
mResults = results;
|
mResults = results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -459,7 +459,8 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
|
|||||||
log.add(LogType.MSG_DC_PENDING_PASSPHRASE, indent + 1);
|
log.add(LogType.MSG_DC_PENDING_PASSPHRASE, indent + 1);
|
||||||
return new DecryptVerifyResult(log,
|
return new DecryptVerifyResult(log,
|
||||||
RequiredInputParcel.createRequiredDecryptPassphrase(
|
RequiredInputParcel.createRequiredDecryptPassphrase(
|
||||||
secretKeyRing.getMasterKeyId(), secretEncryptionKey.getKeyId()));
|
secretKeyRing.getMasterKeyId(), secretEncryptionKey.getKeyId()),
|
||||||
|
cryptoInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,7 +499,8 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
|
|||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
log.add(LogType.MSG_DC_PENDING_PASSPHRASE, indent + 1);
|
log.add(LogType.MSG_DC_PENDING_PASSPHRASE, indent + 1);
|
||||||
return new DecryptVerifyResult(log,
|
return new DecryptVerifyResult(log,
|
||||||
RequiredInputParcel.createRequiredSymmetricPassphrase());
|
RequiredInputParcel.createRequiredSymmetricPassphrase(),
|
||||||
|
cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -544,7 +546,7 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
|
|||||||
} catch (PGPDataValidationException e) {
|
} catch (PGPDataValidationException e) {
|
||||||
log.add(LogType.MSG_DC_ERROR_SYM_PASSPHRASE, indent +1);
|
log.add(LogType.MSG_DC_ERROR_SYM_PASSPHRASE, indent +1);
|
||||||
return new DecryptVerifyResult(log,
|
return new DecryptVerifyResult(log,
|
||||||
RequiredInputParcel.createRequiredSymmetricPassphrase());
|
RequiredInputParcel.createRequiredSymmetricPassphrase(), cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
encryptedData = encryptedDataSymmetric;
|
encryptedData = encryptedDataSymmetric;
|
||||||
@@ -580,7 +582,8 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel>
|
|||||||
return new DecryptVerifyResult(log, RequiredInputParcel.createNfcDecryptOperation(
|
return new DecryptVerifyResult(log, RequiredInputParcel.createNfcDecryptOperation(
|
||||||
secretEncryptionKey.getRing().getMasterKeyId(),
|
secretEncryptionKey.getRing().getMasterKeyId(),
|
||||||
secretEncryptionKey.getKeyId(), encryptedDataAsymmetric.getSessionKey()[0]
|
secretEncryptionKey.getKeyId(), encryptedDataAsymmetric.getSessionKey()[0]
|
||||||
));
|
),
|
||||||
|
cryptoInput);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ public class PgpKeyOperation {
|
|||||||
log.add(LogType.MSG_MF_REQUIRE_PASSPHRASE, indent);
|
log.add(LogType.MSG_MF_REQUIRE_PASSPHRASE, indent);
|
||||||
return new PgpEditKeyResult(log, RequiredInputParcel.createRequiredSignPassphrase(
|
return new PgpEditKeyResult(log, RequiredInputParcel.createRequiredSignPassphrase(
|
||||||
masterSecretKey.getKeyID(), masterSecretKey.getKeyID(),
|
masterSecretKey.getKeyID(), masterSecretKey.getKeyID(),
|
||||||
cryptoInput.getSignatureTime()));
|
cryptoInput.getSignatureTime()), cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read masterKeyFlags, and use the same as before.
|
// read masterKeyFlags, and use the same as before.
|
||||||
@@ -1105,12 +1105,12 @@ public class PgpKeyOperation {
|
|||||||
|
|
||||||
if (!nfcSignOps.isEmpty()) {
|
if (!nfcSignOps.isEmpty()) {
|
||||||
log.add(LogType.MSG_MF_REQUIRE_DIVERT, indent);
|
log.add(LogType.MSG_MF_REQUIRE_DIVERT, indent);
|
||||||
return new PgpEditKeyResult(log, nfcSignOps.build());
|
return new PgpEditKeyResult(log, nfcSignOps.build(), cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nfcKeyToCardOps.isEmpty()) {
|
if (!nfcKeyToCardOps.isEmpty()) {
|
||||||
log.add(LogType.MSG_MF_REQUIRE_DIVERT, indent);
|
log.add(LogType.MSG_MF_REQUIRE_DIVERT, indent);
|
||||||
return new PgpEditKeyResult(log, nfcKeyToCardOps.build());
|
return new PgpEditKeyResult(log, nfcKeyToCardOps.build(), cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.add(LogType.MSG_MF_SUCCESS, indent);
|
log.add(LogType.MSG_MF_SUCCESS, indent);
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class PgpSignEncryptOperation extends BaseOperation {
|
|||||||
log.add(LogType.MSG_PSE_PENDING_PASSPHRASE, indent + 1);
|
log.add(LogType.MSG_PSE_PENDING_PASSPHRASE, indent + 1);
|
||||||
return new PgpSignEncryptResult(log, RequiredInputParcel.createRequiredSignPassphrase(
|
return new PgpSignEncryptResult(log, RequiredInputParcel.createRequiredSignPassphrase(
|
||||||
signingKeyRing.getMasterKeyId(), signingKey.getKeyId(),
|
signingKeyRing.getMasterKeyId(), signingKey.getKeyId(),
|
||||||
cryptoInput.getSignatureTime()));
|
cryptoInput.getSignatureTime()), cryptoInput);
|
||||||
}
|
}
|
||||||
if (!signingKey.unlock(localPassphrase)) {
|
if (!signingKey.unlock(localPassphrase)) {
|
||||||
log.add(LogType.MSG_PSE_ERROR_BAD_PASSPHRASE, indent);
|
log.add(LogType.MSG_PSE_ERROR_BAD_PASSPHRASE, indent);
|
||||||
@@ -513,7 +513,7 @@ public class PgpSignEncryptOperation extends BaseOperation {
|
|||||||
log.add(LogType.MSG_PSE_PENDING_NFC, indent);
|
log.add(LogType.MSG_PSE_PENDING_NFC, indent);
|
||||||
return new PgpSignEncryptResult(log, RequiredInputParcel.createNfcSignOperation(
|
return new PgpSignEncryptResult(log, RequiredInputParcel.createNfcSignOperation(
|
||||||
signingKey.getRing().getMasterKeyId(), signingKey.getKeyId(),
|
signingKey.getRing().getMasterKeyId(), signingKey.getKeyId(),
|
||||||
e.hashToSign, e.hashAlgo, cryptoInput.getSignatureTime()));
|
e.hashToSign, e.hashAlgo, cryptoInput.getSignatureTime()), cryptoInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
|
|||||||
import org.sufficientlysecure.keychain.keyimport.Keyserver;
|
import org.sufficientlysecure.keychain.keyimport.Keyserver;
|
||||||
import org.sufficientlysecure.keychain.operations.results.GetKeyResult;
|
import org.sufficientlysecure.keychain.operations.results.GetKeyResult;
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult;
|
||||||
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
import org.sufficientlysecure.keychain.util.ParcelableProxy;
|
import org.sufficientlysecure.keychain.util.ParcelableProxy;
|
||||||
@@ -121,7 +122,8 @@ public class ImportKeysListCloudLoader
|
|||||||
// user needs to enable/install orbot
|
// user needs to enable/install orbot
|
||||||
mEntryList.clear();
|
mEntryList.clear();
|
||||||
GetKeyResult pendingResult = new GetKeyResult(null,
|
GetKeyResult pendingResult = new GetKeyResult(null,
|
||||||
RequiredInputParcel.createOrbotRequiredOperation());
|
RequiredInputParcel.createOrbotRequiredOperation(),
|
||||||
|
new CryptoInputParcel());
|
||||||
mEntryListWrapper = new AsyncTaskResultWrapper<>(mEntryList, pendingResult);
|
mEntryListWrapper = new AsyncTaskResultWrapper<>(mEntryList, pendingResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
|||||||
final OperationResult result =
|
final OperationResult result =
|
||||||
returnData.getParcelable(OperationResult.EXTRA_RESULT);
|
returnData.getParcelable(OperationResult.EXTRA_RESULT);
|
||||||
|
|
||||||
onHandleResult(result, cryptoInput);
|
onHandleResult(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,15 +299,14 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
|||||||
cryptoOperation(new CryptoInputParcel());
|
cryptoOperation(new CryptoInputParcel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onHandleResult(OperationResult result, CryptoInputParcel oldCryptoInput) {
|
public void onHandleResult(OperationResult result) {
|
||||||
Log.d(Constants.TAG, "Handling result in OperationHelper success: " + result.success());
|
Log.d(Constants.TAG, "Handling result in OperationHelper success: " + result.success());
|
||||||
|
|
||||||
if (result instanceof InputPendingResult) {
|
if (result instanceof InputPendingResult) {
|
||||||
InputPendingResult pendingResult = (InputPendingResult) result;
|
InputPendingResult pendingResult = (InputPendingResult) result;
|
||||||
if (pendingResult.isPending()) {
|
if (pendingResult.isPending()) {
|
||||||
|
|
||||||
RequiredInputParcel requiredInput = pendingResult.getRequiredInputParcel();
|
RequiredInputParcel requiredInput = pendingResult.getRequiredInputParcel();
|
||||||
initiateInputActivity(requiredInput, oldCryptoInput);
|
initiateInputActivity(requiredInput, pendingResult.mCryptoInputParcel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user