mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 03:02:15 -05:00
added keyserver/proxy support to certify operation
This commit is contained in:
parent
af2f922f06
commit
87c03ecb0d
@ -46,6 +46,7 @@ import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||
import org.sufficientlysecure.keychain.util.Log;
|
||||
import org.sufficientlysecure.keychain.util.ParcelableProxy;
|
||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||
|
||||
import java.net.Proxy;
|
||||
@ -189,6 +190,7 @@ public class CertifyOperation extends BaseOperation {
|
||||
|
||||
HkpKeyserver keyServer = null;
|
||||
ImportExportOperation importExportOperation = null;
|
||||
ParcelableProxy parcelableProxy = parcel.parcelableProxy;
|
||||
if (parcel.keyServerUri != null) {
|
||||
keyServer = new HkpKeyserver(parcel.keyServerUri);
|
||||
importExportOperation = new ImportExportOperation(mContext, mProviderHelper, mProgressable);
|
||||
@ -210,7 +212,8 @@ public class CertifyOperation extends BaseOperation {
|
||||
SaveKeyringResult result = mProviderHelper.savePublicKeyRing(certifiedKey);
|
||||
|
||||
if (importExportOperation != null) {
|
||||
ExportResult uploadResult = importExportOperation.uploadKeyRingToServer(keyServer, certifiedKey, proxy);
|
||||
ExportResult uploadResult = importExportOperation.uploadKeyRingToServer(keyServer, certifiedKey,
|
||||
parcelableProxy.getProxy());
|
||||
log.add(uploadResult, 2);
|
||||
|
||||
if (uploadResult.success()) {
|
||||
|
@ -29,6 +29,7 @@ import java.util.Map;
|
||||
|
||||
import org.sufficientlysecure.keychain.pgp.WrappedUserAttribute;
|
||||
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 String keyServerUri;
|
||||
public ParcelableProxy parcelableProxy;
|
||||
|
||||
public CertifyActionsParcel(long masterKeyId) {
|
||||
mMasterKeyId = masterKeyId;
|
||||
@ -54,6 +56,8 @@ public class CertifyActionsParcel implements Parcelable {
|
||||
mMasterKeyId = source.readLong();
|
||||
// just like parcelables, this is meant for ad-hoc IPC only and is NOT portable!
|
||||
mLevel = CertifyLevel.values()[source.readInt()];
|
||||
keyServerUri = source.readString();
|
||||
parcelableProxy = source.readParcelable(ParcelableProxy.class.getClassLoader());
|
||||
|
||||
mCertifyActions = (ArrayList<CertifyAction>) source.readSerializable();
|
||||
}
|
||||
@ -66,6 +70,8 @@ public class CertifyActionsParcel implements Parcelable {
|
||||
public void writeToParcel(Parcel destination, int flags) {
|
||||
destination.writeLong(mMasterKeyId);
|
||||
destination.writeInt(mLevel.ordinal());
|
||||
destination.writeString(keyServerUri);
|
||||
destination.writeParcelable(parcelableProxy, flags);
|
||||
|
||||
destination.writeSerializable(mCertifyActions);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import android.database.MatrixCursor;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.Messenger;
|
||||
import android.os.Parcel;
|
||||
@ -340,6 +341,11 @@ public class CertifyKeyFragment
|
||||
CertifyActionsParcel actionsParcel = new CertifyActionsParcel(selectedKeyId);
|
||||
actionsParcel.mCertifyActions.addAll(certifyActions);
|
||||
|
||||
if (mUploadKeyCheckbox.isChecked()) {
|
||||
actionsParcel.keyServerUri = Preferences.getPreferences(getActivity()).getPreferredKeyserver();
|
||||
actionsParcel.parcelableProxy = mProxyPrefs.parcelableProxy;
|
||||
}
|
||||
|
||||
// cached for next cryptoOperation loop
|
||||
cacheActionsParcel(actionsParcel);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user