diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-05-04 16:59:20 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-05-04 16:59:20 +0200 |
commit | cd8af25ba71d95ebb2ab2a3ab4b19dc28cad63fc (patch) | |
tree | 4e1622be349f83d948c1ef823d44913e2559345f /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java | |
parent | 8cf0638f54fc4679c33a0243e17c514271931c48 (diff) | |
download | open-keychain-cd8af25ba71d95ebb2ab2a3ab4b19dc28cad63fc.tar.gz open-keychain-cd8af25ba71d95ebb2ab2a3ab4b19dc28cad63fc.tar.bz2 open-keychain-cd8af25ba71d95ebb2ab2a3ab4b19dc28cad63fc.zip |
wrapped-key-ring: more work on passphrase caching and certification
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java index 256d9d4b7..9b5581cc7 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PassphraseDialogFragment.java @@ -101,8 +101,12 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor long secretKeyId) throws PgpGeneralException { // check if secret key has a passphrase if (!(secretKeyId == Constants.key.symmetric || secretKeyId == Constants.key.none)) { - if (!PassphraseCacheService.hasPassphrase(context, secretKeyId)) { - throw new PgpGeneralException("No passphrase! No passphrase dialog needed!"); + try { + if (new ProviderHelper(context).getCachedSecretKeyRing(secretKeyId).hasPassphrase()) { + throw new PgpGeneralException("No passphrase! No passphrase dialog needed!"); + } + } catch(ProviderHelper.NotFoundException e) { + throw new PgpGeneralException("Error: Key not found!", e); } } |