aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-10-09 14:56:46 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-10-09 14:56:46 +0200
commiteff4ae5551f286f4c870c3f9db44ceb73c3c2fcf (patch)
tree8bebd954ccd88a8f153d7d713c2a50d253fcb76f /OpenKeychain/src/main/java/org/sufficientlysecure/keychain
parente67e8cd8c1677fe95d0fe15df0e0d1342d8cc44e (diff)
downloadopen-keychain-eff4ae5551f286f4c870c3f9db44ceb73c3c2fcf.tar.gz
open-keychain-eff4ae5551f286f4c870c3f9db44ceb73c3c2fcf.tar.bz2
open-keychain-eff4ae5551f286f4c870c3f9db44ceb73c3c2fcf.zip
Revert "viewkeyactivity: ask for passphrase for backup only if key has one"
This reverts commit 3316cb65e6b739deb7d0652fcd16a9d9bedf8c5b. Committed to wrong branch, derp :)
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java32
1 files changed, 3 insertions, 29 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
index 0fb7cdf92..de859724b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java
@@ -65,14 +65,12 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
import org.sufficientlysecure.keychain.operations.results.ImportKeyResult;
import org.sufficientlysecure.keychain.operations.results.OperationResult;
-import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey.SecretKeyType;
import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException;
import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
-import org.sufficientlysecure.keychain.provider.ProviderHelper.NotFoundException;
import org.sufficientlysecure.keychain.service.ImportKeyringParcel;
import org.sufficientlysecure.keychain.ui.ViewKeyFragment.PostponeType;
import org.sufficientlysecure.keychain.ui.base.BaseNfcActivity;
@@ -452,33 +450,9 @@ public class ViewKeyActivity extends BaseNfcActivity implements
}
private void startPassphraseActivity(int requestCode) {
-
- if (keyHasPassphrase()) {
- Intent intent = new Intent(this, PassphraseDialogActivity.class);
- intent.putExtra(PassphraseDialogActivity.EXTRA_SUBKEY_ID, mMasterKeyId);
- startActivityForResult(intent, requestCode);
- } else {
- startBackupActivity();
- }
- }
-
- private boolean keyHasPassphrase() {
- try {
- SecretKeyType secretKeyType =
- mProviderHelper.getCachedPublicKeyRing(mMasterKeyId).getSecretKeyType(mMasterKeyId);
- switch (secretKeyType) {
- // all of these make no sense to ask
- case PASSPHRASE_EMPTY:
- case GNU_DUMMY:
- case DIVERT_TO_CARD:
- case UNAVAILABLE:
- return false;
- default:
- return true;
- }
- } catch (NotFoundException e) {
- return false;
- }
+ Intent intent = new Intent(this, PassphraseDialogActivity.class);
+ intent.putExtra(PassphraseDialogActivity.EXTRA_SUBKEY_ID, mMasterKeyId);
+ startActivityForResult(intent, requestCode);
}
private void backupToFile() {