diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-03-22 14:16:49 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2013-03-22 14:16:49 +0100 |
commit | 30fa184e7e6a3bbd1a26c39ef5c3037dcbe3ea32 (patch) | |
tree | c9d47233a0486e3e05e882e05d60202f5565b135 /OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java | |
parent | bee5075f56173b7bd05b210c778c846d154b2ee9 (diff) | |
parent | 0075c522a6773c14e34875cc7118055cde2e13be (diff) | |
download | open-keychain-30fa184e7e6a3bbd1a26c39ef5c3037dcbe3ea32.tar.gz open-keychain-30fa184e7e6a3bbd1a26c39ef5c3037dcbe3ea32.tar.bz2 open-keychain-30fa184e7e6a3bbd1a26c39ef5c3037dcbe3ea32.zip |
Merge with ashh87s pull request
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java')
-rw-r--r-- | OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java index e525fe96e..48afdff5c 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -123,6 +123,7 @@ public class KeychainIntentService extends IntentService implements ProgressDial public static final String SAVE_KEYRING_KEYS = "keys"; public static final String SAVE_KEYRING_KEYS_USAGES = "keysUsages"; public static final String SAVE_KEYRING_MASTER_KEY_ID = "masterKeyId"; + public static final String SAVE_KEYRING_CAN_SIGN = "can_sign"; // generate key public static final String GENERATE_KEY_ALGORITHM = "algorithm"; @@ -523,6 +524,12 @@ public class KeychainIntentService extends IntentService implements ProgressDial /* Input */ String oldPassPhrase = data.getString(SAVE_KEYRING_CURRENT_PASSPHRASE); String newPassPhrase = data.getString(SAVE_KEYRING_NEW_PASSPHRASE); + boolean canSign = true; + + if (data.containsKey(SAVE_KEYRING_CAN_SIGN)) { + canSign = data.getBoolean(SAVE_KEYRING_CAN_SIGN); + } + if (newPassPhrase == null) { newPassPhrase = oldPassPhrase; } @@ -533,8 +540,13 @@ public class KeychainIntentService extends IntentService implements ProgressDial long masterKeyId = data.getLong(SAVE_KEYRING_MASTER_KEY_ID); /* Operation */ - PgpMain.buildSecretKey(this, userIds, keys, keysUsages, masterKeyId, oldPassPhrase, + if (!canSign) { //library fails, fix later + //PgpMain.changeSecretKeyPassphrase(this, ProviderHelper.getPGPSecretKeyRingByKeyId(this, masterKeyId), + //oldPassPhrase, newPassPhrase, this); + } else { + PgpMain.buildSecretKey(this, userIds, keys, keysUsages, masterKeyId, oldPassPhrase, newPassPhrase, this); + } PassphraseCacheService.addCachedPassphrase(this, masterKeyId, newPassPhrase); /* Output */ |