added keyserver/proxy support to certify operation
This commit is contained in:
@@ -46,6 +46,7 @@ import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
|||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
||||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
import org.sufficientlysecure.keychain.util.ParcelableProxy;
|
||||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||||
|
|
||||||
import java.net.Proxy;
|
import java.net.Proxy;
|
||||||
@@ -213,7 +214,8 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> {
|
|||||||
SaveKeyringResult result = mProviderHelper.savePublicKeyRing(certifiedKey);
|
SaveKeyringResult result = mProviderHelper.savePublicKeyRing(certifiedKey);
|
||||||
|
|
||||||
if (exportOperation != null) {
|
if (exportOperation != null) {
|
||||||
ExportResult uploadResult = importExportOperation.uploadKeyRingToServer(keyServer, certifiedKey, proxy);
|
ExportResult uploadResult = importExportOperation.uploadKeyRingToServer(keyServer, certifiedKey,
|
||||||
|
parcelableProxy.getProxy());
|
||||||
log.add(uploadResult, 2);
|
log.add(uploadResult, 2);
|
||||||
|
|
||||||
if (uploadResult.success()) {
|
if (uploadResult.success()) {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.sufficientlysecure.keychain.pgp.WrappedUserAttribute;
|
import org.sufficientlysecure.keychain.pgp.WrappedUserAttribute;
|
||||||
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
||||||
|
import org.sufficientlysecure.keychain.util.ParcelableProxy;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +45,7 @@ public class CertifyActionsParcel implements Parcelable {
|
|||||||
public ArrayList<CertifyAction> mCertifyActions = new ArrayList<>();
|
public ArrayList<CertifyAction> mCertifyActions = new ArrayList<>();
|
||||||
|
|
||||||
public String keyServerUri;
|
public String keyServerUri;
|
||||||
|
public ParcelableProxy parcelableProxy;
|
||||||
|
|
||||||
public CertifyActionsParcel(long masterKeyId) {
|
public CertifyActionsParcel(long masterKeyId) {
|
||||||
mMasterKeyId = masterKeyId;
|
mMasterKeyId = masterKeyId;
|
||||||
@@ -54,6 +56,8 @@ public class CertifyActionsParcel implements Parcelable {
|
|||||||
mMasterKeyId = source.readLong();
|
mMasterKeyId = source.readLong();
|
||||||
// just like parcelables, this is meant for ad-hoc IPC only and is NOT portable!
|
// just like parcelables, this is meant for ad-hoc IPC only and is NOT portable!
|
||||||
mLevel = CertifyLevel.values()[source.readInt()];
|
mLevel = CertifyLevel.values()[source.readInt()];
|
||||||
|
keyServerUri = source.readString();
|
||||||
|
parcelableProxy = source.readParcelable(ParcelableProxy.class.getClassLoader());
|
||||||
|
|
||||||
mCertifyActions = (ArrayList<CertifyAction>) source.readSerializable();
|
mCertifyActions = (ArrayList<CertifyAction>) source.readSerializable();
|
||||||
}
|
}
|
||||||
@@ -66,6 +70,8 @@ public class CertifyActionsParcel implements Parcelable {
|
|||||||
public void writeToParcel(Parcel destination, int flags) {
|
public void writeToParcel(Parcel destination, int flags) {
|
||||||
destination.writeLong(mMasterKeyId);
|
destination.writeLong(mMasterKeyId);
|
||||||
destination.writeInt(mLevel.ordinal());
|
destination.writeInt(mLevel.ordinal());
|
||||||
|
destination.writeString(keyServerUri);
|
||||||
|
destination.writeParcelable(parcelableProxy, flags);
|
||||||
|
|
||||||
destination.writeSerializable(mCertifyActions);
|
destination.writeSerializable(mCertifyActions);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,6 +311,11 @@ public class CertifyKeyFragment
|
|||||||
CertifyActionsParcel actionsParcel = new CertifyActionsParcel(selectedKeyId);
|
CertifyActionsParcel actionsParcel = new CertifyActionsParcel(selectedKeyId);
|
||||||
actionsParcel.mCertifyActions.addAll(certifyActions);
|
actionsParcel.mCertifyActions.addAll(certifyActions);
|
||||||
|
|
||||||
|
if (mUploadKeyCheckbox.isChecked()) {
|
||||||
|
actionsParcel.keyServerUri = Preferences.getPreferences(getActivity()).getPreferredKeyserver();
|
||||||
|
actionsParcel.parcelableProxy = mProxyPrefs.parcelableProxy;
|
||||||
|
}
|
||||||
|
|
||||||
// cached for next cryptoOperation loop
|
// cached for next cryptoOperation loop
|
||||||
cacheActionsParcel(actionsParcel);
|
cacheActionsParcel(actionsParcel);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user