aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-02-15 02:44:03 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2014-02-15 02:44:03 +0100
commit3b0f76bf60028603140c3fd8a956241b315a6b18 (patch)
tree7de25308c5c9a664d8f48324afd8e92f86207986 /OpenPGP-Keychain
parente0111c2ec40b35db94f06d89c8ca50529fbbb401 (diff)
downloadopen-keychain-3b0f76bf60028603140c3fd8a956241b315a6b18.tar.gz
open-keychain-3b0f76bf60028603140c3fd8a956241b315a6b18.tar.bz2
open-keychain-3b0f76bf60028603140c3fd8a956241b315a6b18.zip
allow passphrase as parameter
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java
index 0f5aa9e3b..b1635ec10 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/remote/OpenPgpService.java
@@ -141,7 +141,12 @@ public class OpenPgpService extends RemoteService {
private Bundle signImpl(Bundle params, ParcelFileDescriptor input, ParcelFileDescriptor output, AppSettings appSettings) {
try {
// get passphrase from cache, if key has "no" passphrase, this returns an empty String
- String passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId());
+ String passphrase;
+ if (params.containsKey(OpenPgpConstants.PARAMS_PASSPHRASE)) {
+ passphrase = params.getString(OpenPgpConstants.PARAMS_PASSPHRASE);
+ } else {
+ passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId());
+ }
if (passphrase == null) {
// get PendingIntent for passphrase input, add it to given params and return to client
Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId());
@@ -212,8 +217,13 @@ public class OpenPgpService extends RemoteService {
PgpOperation operation = new PgpOperation(getContext(), null, inputData, os);
if (sign) {
- String passphrase = PassphraseCacheService.getCachedPassphrase(getContext(),
- appSettings.getKeyId());
+ String passphrase;
+ if (params.containsKey(OpenPgpConstants.PARAMS_PASSPHRASE)) {
+ passphrase = params.getString(OpenPgpConstants.PARAMS_PASSPHRASE);
+ } else {
+ passphrase = PassphraseCacheService.getCachedPassphrase(getContext(),
+ appSettings.getKeyId());
+ }
if (passphrase == null) {
// get PendingIntent for passphrase input, add it to given params and return to client
Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId());
@@ -335,7 +345,12 @@ public class OpenPgpService extends RemoteService {
// Log.d(Constants.TAG, "secretKeyId " + secretKeyId);
// NOTE: currently this only gets the passphrase for the saved key
- String passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId());
+ String passphrase;
+ if (params.containsKey(OpenPgpConstants.PARAMS_PASSPHRASE)) {
+ passphrase = params.getString(OpenPgpConstants.PARAMS_PASSPHRASE);
+ } else {
+ passphrase = PassphraseCacheService.getCachedPassphrase(getContext(), appSettings.getKeyId());
+ }
if (passphrase == null) {
// get PendingIntent for passphrase input, add it to given params and return to client
Bundle passphraseBundle = getPassphraseBundleIntent(params, appSettings.getKeyId());