aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain
diff options
context:
space:
mode:
authorDaniel Hammann <github@honnel.de>2014-03-22 15:31:18 +0100
committerDaniel Hammann <github@honnel.de>2014-03-22 15:42:50 +0100
commit9c180629510d6b07aa296088f61593234b52a14a (patch)
tree440c1850be222d857d35bb9e334ec0474f21392c /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain
parent1b57a10bb6a65a1900c79c68efe4c320177485da (diff)
downloadopen-keychain-9c180629510d6b07aa296088f61593234b52a14a.tar.gz
open-keychain-9c180629510d6b07aa296088f61593234b52a14a.tar.bz2
open-keychain-9c180629510d6b07aa296088f61593234b52a14a.zip
The current implementation of saving new generated key doesn't save the key due to the public key of master key id can not be resolved by ProviderHelper.getPGPPublicKeyByKeyId (via URI/Cursor). Workaround uses local keys-arraylist for resoving the pubkey of master key id.
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
index 0751fa33c..e26ee3c76 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java
@@ -543,7 +543,15 @@ public class KeychainIntentService extends IntentService
ProviderHelper.getPGPSecretKeyRingByKeyId(this, masterKeyId),
oldPassPhrase, newPassPhrase);
} else {
- PGPPublicKey pubkey = ProviderHelper.getPGPPublicKeyByKeyId(this, masterKeyId);
+ //TODO: Workaround due to ProviderHelper.getPGPPublicKeyByKeyId can not resolve public key of master-key id with uri/cursor
+ PGPPublicKey pubkey = null;
+ for(PGPSecretKey key : keys) {
+ PGPPublicKey tempKey = key.getPublicKey();
+ if (tempKey.getKeyID() == masterKeyId) {
+ pubkey = tempKey;
+ }
+ }
+ //PGPPublicKey pubkey = ProviderHelper.getPGPPublicKeyByKeyId(this, masterKeyId);
keyOperations.buildSecretKey(userIds, keys, keysUsages, keysExpiryDates,
pubkey, oldPassPhrase, newPassPhrase);
}