Update obsolete Nfc class prefixes
This commit is contained in:
parent
28a352a288
commit
163aef4c6b
|
@ -47,7 +47,7 @@ import org.sufficientlysecure.keychain.service.ContactSyncAdapterService;
|
||||||
import org.sufficientlysecure.keychain.service.UploadKeyringParcel;
|
import org.sufficientlysecure.keychain.service.UploadKeyringParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
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.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.SecurityTokenSignOperationsBuilder;
|
||||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ public class CertifyOperation extends BaseOperation<CertifyActionsParcel> {
|
||||||
|
|
||||||
int certifyOk = 0, certifyError = 0, uploadOk = 0, uploadError = 0;
|
int certifyOk = 0, certifyError = 0, uploadOk = 0, uploadError = 0;
|
||||||
|
|
||||||
NfcSignOperationsBuilder allRequiredInput = new NfcSignOperationsBuilder(
|
SecurityTokenSignOperationsBuilder allRequiredInput = new SecurityTokenSignOperationsBuilder(
|
||||||
cryptoInput.getSignatureTime(), masterKeyId, masterKeyId);
|
cryptoInput.getSignatureTime(), masterKeyId, masterKeyId);
|
||||||
|
|
||||||
// Work through all requested certifications
|
// Work through all requested certifications
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException;
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
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.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.SecurityTokenSignOperationsBuilder;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.RequiredInputType;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.RequiredInputType;
|
||||||
import org.sufficientlysecure.keychain.util.FileHelper;
|
import org.sufficientlysecure.keychain.util.FileHelper;
|
||||||
import org.sufficientlysecure.keychain.util.InputData;
|
import org.sufficientlysecure.keychain.util.InputData;
|
||||||
|
@ -80,7 +80,7 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
|
||||||
int total = inputBytes != null ? 1 : inputUris.size(), count = 0;
|
int total = inputBytes != null ? 1 : inputUris.size(), count = 0;
|
||||||
ArrayList<PgpSignEncryptResult> results = new ArrayList<>();
|
ArrayList<PgpSignEncryptResult> results = new ArrayList<>();
|
||||||
|
|
||||||
NfcSignOperationsBuilder pendingInputBuilder = null;
|
SecurityTokenSignOperationsBuilder pendingInputBuilder = null;
|
||||||
|
|
||||||
// if signing subkey has not explicitly been set, get first usable subkey capable of signing
|
// if signing subkey has not explicitly been set, get first usable subkey capable of signing
|
||||||
if (input.getSignatureMasterKeyId() != Constants.key.none
|
if (input.getSignatureMasterKeyId() != Constants.key.none
|
||||||
|
@ -161,7 +161,7 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
|
||||||
return new SignEncryptResult(log, requiredInput, results, cryptoInput);
|
return new SignEncryptResult(log, requiredInput, results, cryptoInput);
|
||||||
}
|
}
|
||||||
if (pendingInputBuilder == null) {
|
if (pendingInputBuilder == null) {
|
||||||
pendingInputBuilder = new NfcSignOperationsBuilder(requiredInput.mSignatureTime,
|
pendingInputBuilder = new SecurityTokenSignOperationsBuilder(requiredInput.mSignatureTime,
|
||||||
input.getSignatureMasterKeyId(), input.getSignatureSubKeyId());
|
input.getSignatureMasterKeyId(), input.getSignatureSubKeyId());
|
||||||
}
|
}
|
||||||
pendingInputBuilder.addAll(requiredInput);
|
pendingInputBuilder.addAll(requiredInput);
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.sufficientlysecure.keychain.operations.results.OperationResult.LogTyp
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog;
|
||||||
import org.sufficientlysecure.keychain.service.CertifyActionsParcel.CertifyAction;
|
import org.sufficientlysecure.keychain.service.CertifyActionsParcel.CertifyAction;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.SecurityTokenSignOperationsBuilder;
|
||||||
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;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class PgpCertifyOperation {
|
||||||
// get the master subkey (which we certify for)
|
// get the master subkey (which we certify for)
|
||||||
PGPPublicKey publicKey = publicRing.getPublicKey().getPublicKey();
|
PGPPublicKey publicKey = publicRing.getPublicKey().getPublicKey();
|
||||||
|
|
||||||
NfcSignOperationsBuilder requiredInput = new NfcSignOperationsBuilder(creationTimestamp,
|
SecurityTokenSignOperationsBuilder requiredInput = new SecurityTokenSignOperationsBuilder(creationTimestamp,
|
||||||
publicKey.getKeyID(), publicKey.getKeyID());
|
publicKey.getKeyID(), publicKey.getKeyID());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -769,7 +769,7 @@ public class PgpDecryptVerifyOperation extends BaseOperation<PgpDecryptVerifyInp
|
||||||
&& !decryptorFactory.hasCachedSessionData(encryptedDataAsymmetric)) {
|
&& !decryptorFactory.hasCachedSessionData(encryptedDataAsymmetric)) {
|
||||||
|
|
||||||
log.add(LogType.MSG_DC_PENDING_NFC, indent + 1);
|
log.add(LogType.MSG_DC_PENDING_NFC, indent + 1);
|
||||||
return result.with(new DecryptVerifyResult(log, RequiredInputParcel.createNfcDecryptOperation(
|
return result.with(new DecryptVerifyResult(log, RequiredInputParcel.createSecurityTokenDecryptOperation(
|
||||||
decryptionKey.getRing().getMasterKeyId(),
|
decryptionKey.getRing().getMasterKeyId(),
|
||||||
decryptionKey.getKeyId(), encryptedDataAsymmetric.getSessionKey()[0]
|
decryptionKey.getKeyId(), encryptedDataAsymmetric.getSessionKey()[0]
|
||||||
), cryptoInput));
|
), cryptoInput));
|
||||||
|
|
|
@ -78,8 +78,8 @@ import org.sufficientlysecure.keychain.service.SaveKeyringParcel.Curve;
|
||||||
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.SubkeyAdd;
|
import org.sufficientlysecure.keychain.service.SaveKeyringParcel.SubkeyAdd;
|
||||||
import org.sufficientlysecure.keychain.service.input.CryptoInputParcel;
|
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.service.input.RequiredInputParcel.NfcKeyToCardOperationsBuilder;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.SecurityTokenKeyToCardOperationsBuilder;
|
||||||
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.NfcSignOperationsBuilder;
|
import org.sufficientlysecure.keychain.service.input.RequiredInputParcel.SecurityTokenSignOperationsBuilder;
|
||||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||||
import org.sufficientlysecure.keychain.util.IterableIterator;
|
import org.sufficientlysecure.keychain.util.IterableIterator;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
@ -496,10 +496,10 @@ public class PgpKeyOperation {
|
||||||
OperationLog log,
|
OperationLog log,
|
||||||
int indent) {
|
int indent) {
|
||||||
|
|
||||||
NfcSignOperationsBuilder nfcSignOps = new NfcSignOperationsBuilder(
|
SecurityTokenSignOperationsBuilder nfcSignOps = new SecurityTokenSignOperationsBuilder(
|
||||||
cryptoInput.getSignatureTime(), masterSecretKey.getKeyID(),
|
cryptoInput.getSignatureTime(), masterSecretKey.getKeyID(),
|
||||||
masterSecretKey.getKeyID());
|
masterSecretKey.getKeyID());
|
||||||
NfcKeyToCardOperationsBuilder nfcKeyToCardOps = new NfcKeyToCardOperationsBuilder(
|
SecurityTokenKeyToCardOperationsBuilder nfcKeyToCardOps = new SecurityTokenKeyToCardOperationsBuilder(
|
||||||
masterSecretKey.getKeyID());
|
masterSecretKey.getKeyID());
|
||||||
|
|
||||||
progress(R.string.progress_modify, 0);
|
progress(R.string.progress_modify, 0);
|
||||||
|
@ -1277,7 +1277,7 @@ public class PgpKeyOperation {
|
||||||
PGPPublicKey masterPublicKey,
|
PGPPublicKey masterPublicKey,
|
||||||
int flags, long expiry,
|
int flags, long expiry,
|
||||||
CryptoInputParcel cryptoInput,
|
CryptoInputParcel cryptoInput,
|
||||||
NfcSignOperationsBuilder nfcSignOps,
|
SecurityTokenSignOperationsBuilder nfcSignOps,
|
||||||
int indent, OperationLog log)
|
int indent, OperationLog log)
|
||||||
throws PGPException, IOException, SignatureException {
|
throws PGPException, IOException, SignatureException {
|
||||||
|
|
||||||
|
|
|
@ -520,7 +520,7 @@ public class PgpSignEncryptOperation extends BaseOperation {
|
||||||
} catch (NfcSyncPGPContentSignerBuilder.NfcInteractionNeeded e) {
|
} catch (NfcSyncPGPContentSignerBuilder.NfcInteractionNeeded e) {
|
||||||
// this secret key diverts to a OpenPGP card, throw exception with hash that will be signed
|
// this secret key diverts to a OpenPGP card, throw exception with hash that will be signed
|
||||||
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.createSecurityTokenSignOperation(
|
||||||
signingKey.getRing().getMasterKeyId(), signingKey.getKeyId(),
|
signingKey.getRing().getMasterKeyId(), signingKey.getKeyId(),
|
||||||
e.hashToSign, e.hashAlgo, cryptoInput.getSignatureTime()), cryptoInput);
|
e.hashToSign, e.hashAlgo, cryptoInput.getSignatureTime()), cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ApiPendingIntentFactory {
|
||||||
case SECURITY_TOKEN_MOVE_KEY_TO_CARD:
|
case SECURITY_TOKEN_MOVE_KEY_TO_CARD:
|
||||||
case SECURITY_TOKEN_DECRYPT:
|
case SECURITY_TOKEN_DECRYPT:
|
||||||
case SECURITY_TOKEN_SIGN: {
|
case SECURITY_TOKEN_SIGN: {
|
||||||
return createNfcOperationPendingIntent(data, requiredInput, cryptoInput);
|
return createSecurityTokenOperationPendingIntent(data, requiredInput, cryptoInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
case PASSPHRASE: {
|
case PASSPHRASE: {
|
||||||
|
@ -65,7 +65,7 @@ public class ApiPendingIntentFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingIntent createNfcOperationPendingIntent(Intent data, RequiredInputParcel requiredInput, CryptoInputParcel cryptoInput) {
|
private PendingIntent createSecurityTokenOperationPendingIntent(Intent data, RequiredInputParcel requiredInput, CryptoInputParcel cryptoInput) {
|
||||||
Intent intent = new Intent(mContext, RemoteSecurityTokenOperationActivity.class);
|
Intent intent = new Intent(mContext, RemoteSecurityTokenOperationActivity.class);
|
||||||
// pass params through to activity that it can be returned again later to repeat pgp operation
|
// pass params through to activity that it can be returned again later to repeat pgp operation
|
||||||
intent.putExtra(RemoteSecurityTokenOperationActivity.EXTRA_REQUIRED_INPUT, requiredInput);
|
intent.putExtra(RemoteSecurityTokenOperationActivity.EXTRA_REQUIRED_INPUT, requiredInput);
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class RequiredInputParcel implements Parcelable {
|
||||||
return new RequiredInputParcel(RequiredInputType.ENABLE_ORBOT, null, null, null, 0L, 0L);
|
return new RequiredInputParcel(RequiredInputType.ENABLE_ORBOT, null, null, null, 0L, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RequiredInputParcel createNfcSignOperation(
|
public static RequiredInputParcel createSecurityTokenSignOperation(
|
||||||
long masterKeyId, long subKeyId,
|
long masterKeyId, long subKeyId,
|
||||||
byte[] inputHash, int signAlgo, Date signatureTime) {
|
byte[] inputHash, int signAlgo, Date signatureTime) {
|
||||||
return new RequiredInputParcel(RequiredInputType.SECURITY_TOKEN_SIGN,
|
return new RequiredInputParcel(RequiredInputType.SECURITY_TOKEN_SIGN,
|
||||||
|
@ -97,13 +97,13 @@ public class RequiredInputParcel implements Parcelable {
|
||||||
signatureTime, masterKeyId, subKeyId);
|
signatureTime, masterKeyId, subKeyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RequiredInputParcel createNfcDecryptOperation(
|
public static RequiredInputParcel createSecurityTokenDecryptOperation(
|
||||||
long masterKeyId, long subKeyId, byte[] encryptedSessionKey) {
|
long masterKeyId, long subKeyId, byte[] encryptedSessionKey) {
|
||||||
return new RequiredInputParcel(RequiredInputType.SECURITY_TOKEN_DECRYPT,
|
return new RequiredInputParcel(RequiredInputType.SECURITY_TOKEN_DECRYPT,
|
||||||
new byte[][] { encryptedSessionKey }, null, null, masterKeyId, subKeyId);
|
new byte[][] { encryptedSessionKey }, null, null, masterKeyId, subKeyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RequiredInputParcel createNfcReset() {
|
public static RequiredInputParcel createSecurityTokenReset() {
|
||||||
return new RequiredInputParcel(RequiredInputType.SECURITY_TOKEN_RESET_CARD,
|
return new RequiredInputParcel(RequiredInputType.SECURITY_TOKEN_RESET_CARD,
|
||||||
null, null, null, null, null);
|
null, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
@ -188,14 +188,14 @@ public class RequiredInputParcel implements Parcelable {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static class NfcSignOperationsBuilder {
|
public static class SecurityTokenSignOperationsBuilder {
|
||||||
Date mSignatureTime;
|
Date mSignatureTime;
|
||||||
ArrayList<Integer> mSignAlgos = new ArrayList<>();
|
ArrayList<Integer> mSignAlgos = new ArrayList<>();
|
||||||
ArrayList<byte[]> mInputHashes = new ArrayList<>();
|
ArrayList<byte[]> mInputHashes = new ArrayList<>();
|
||||||
long mMasterKeyId;
|
long mMasterKeyId;
|
||||||
long mSubKeyId;
|
long mSubKeyId;
|
||||||
|
|
||||||
public NfcSignOperationsBuilder(Date signatureTime, long masterKeyId, long subKeyId) {
|
public SecurityTokenSignOperationsBuilder(Date signatureTime, long masterKeyId, long subKeyId) {
|
||||||
mSignatureTime = signatureTime;
|
mSignatureTime = signatureTime;
|
||||||
mMasterKeyId = masterKeyId;
|
mMasterKeyId = masterKeyId;
|
||||||
mSubKeyId = subKeyId;
|
mSubKeyId = subKeyId;
|
||||||
|
@ -238,13 +238,13 @@ public class RequiredInputParcel implements Parcelable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class NfcKeyToCardOperationsBuilder {
|
public static class SecurityTokenKeyToCardOperationsBuilder {
|
||||||
ArrayList<byte[]> mSubkeysToExport = new ArrayList<>();
|
ArrayList<byte[]> mSubkeysToExport = new ArrayList<>();
|
||||||
Long mMasterKeyId;
|
Long mMasterKeyId;
|
||||||
byte[] mPin;
|
byte[] mPin;
|
||||||
byte[] mAdminPin;
|
byte[] mAdminPin;
|
||||||
|
|
||||||
public NfcKeyToCardOperationsBuilder(Long masterKeyId) {
|
public SecurityTokenKeyToCardOperationsBuilder(Long masterKeyId) {
|
||||||
mMasterKeyId = masterKeyId;
|
mMasterKeyId = masterKeyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ public class CreateSecurityTokenImportResetFragment
|
||||||
|
|
||||||
public void resetCard() {
|
public void resetCard() {
|
||||||
Intent intent = new Intent(getActivity(), SecurityTokenOperationActivity.class);
|
Intent intent = new Intent(getActivity(), SecurityTokenOperationActivity.class);
|
||||||
RequiredInputParcel resetP = RequiredInputParcel.createNfcReset();
|
RequiredInputParcel resetP = RequiredInputParcel.createSecurityTokenReset();
|
||||||
intent.putExtra(SecurityTokenOperationActivity.EXTRA_REQUIRED_INPUT, resetP);
|
intent.putExtra(SecurityTokenOperationActivity.EXTRA_REQUIRED_INPUT, resetP);
|
||||||
intent.putExtra(SecurityTokenOperationActivity.EXTRA_CRYPTO_INPUT, new CryptoInputParcel());
|
intent.putExtra(SecurityTokenOperationActivity.EXTRA_CRYPTO_INPUT, new CryptoInputParcel());
|
||||||
startActivityForResult(intent, REQUEST_CODE_RESET);
|
startActivityForResult(intent, REQUEST_CODE_RESET);
|
||||||
|
|
Loading…
Reference in a new issue