From 7074b443472b620dbfd452d1682b30407b1851b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Fri, 10 Apr 2015 15:58:37 +0200 Subject: Cache CryptoInputParcel in OpenPgpService --- .../sufficientlysecure/keychain/ui/NfcOperationActivity.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java index d70b0aad1..02fc81825 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NfcOperationActivity.java @@ -16,6 +16,7 @@ import android.view.WindowManager; import org.openintents.openpgp.util.OpenPgpApi; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.remote.OpenPgpService; import org.sufficientlysecure.keychain.service.PassphraseCacheService; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecure.keychain.service.input.RequiredInputParcel; @@ -69,7 +70,7 @@ public class NfcOperationActivity extends BaseNfcActivity { @Override protected void onNfcPerform() throws IOException { - CryptoInputParcel resultData = new CryptoInputParcel(mRequiredInput.mSignatureTime); + CryptoInputParcel inputParcel = new CryptoInputParcel(mRequiredInput.mSignatureTime); switch (mRequiredInput.mType) { @@ -77,7 +78,7 @@ public class NfcOperationActivity extends BaseNfcActivity { for (int i = 0; i < mRequiredInput.mInputHashes.length; i++) { byte[] hash = mRequiredInput.mInputHashes[i]; byte[] decryptedSessionKey = nfcDecryptSessionKey(hash); - resultData.addCryptoData(hash, decryptedSessionKey); + inputParcel.addCryptoData(hash, decryptedSessionKey); } break; @@ -86,17 +87,17 @@ public class NfcOperationActivity extends BaseNfcActivity { byte[] hash = mRequiredInput.mInputHashes[i]; int algo = mRequiredInput.mSignAlgos[i]; byte[] signedHash = nfcCalculateSignature(hash, algo); - resultData.addCryptoData(hash, signedHash); + inputParcel.addCryptoData(hash, signedHash); } break; } if (mServiceIntent != null) { - mServiceIntent.putExtra(OpenPgpApi.EXTRA_CRYPTO_INPUT, resultData); + OpenPgpService.cacheCryptoInputParcel(mServiceIntent, inputParcel); setResult(RESULT_OK, mServiceIntent); } else { Intent result = new Intent(); - result.putExtra(NfcOperationActivity.RESULT_DATA, resultData); + result.putExtra(NfcOperationActivity.RESULT_DATA, inputParcel); setResult(RESULT_OK, result); } -- cgit v1.2.3