aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp
diff options
context:
space:
mode:
authorAshley Hughes <spirit.returned@gmail.com>2014-04-01 23:37:13 +0100
committerAshley Hughes <spirit.returned@gmail.com>2014-04-01 23:37:13 +0100
commit2ad616ed3f8a801c34da8b10f38103afc0cfe436 (patch)
tree7d01044f07c2e3d43aed84e2dda25f96d1ddae5b /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp
parentabfe416503517ca6eaa1569818154fb498ec1741 (diff)
downloadopen-keychain-2ad616ed3f8a801c34da8b10f38103afc0cfe436.tar.gz
open-keychain-2ad616ed3f8a801c34da8b10f38103afc0cfe436.tar.bz2
open-keychain-2ad616ed3f8a801c34da8b10f38103afc0cfe436.zip
pass through info that keys are new without relying on new keys orginally being empty
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
index 0aa8b7410..66f1f3f01 100644
--- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
+++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
@@ -478,7 +478,9 @@ public class PgpKeyOperation {
PGPSignature certification = sGen.generateCertification(userId, masterPublicKey);
sigList.add(new Pair<String, PGPSignature>(userId, certification));
}
- masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID);
+ if (!saveParcel.newIDs[userIDIndex]) {
+ masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID);
+ }
userIDIndex++;
}
for (Pair<String, PGPSignature> toAdd : sigList) {
@@ -500,7 +502,9 @@ public class PgpKeyOperation {
sGen.setUnhashedSubpackets(unhashedPacketsGen.generate());
}
PGPSignature certification = sGen.generateCertification(userId, masterPublicKey);
- masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID);
+ if (!saveParcel.newIDs[userIDIndex]) {
+ masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID);
+ }
masterPublicKey = PGPPublicKey.addCertification(masterPublicKey, userId, certification);
}
userIDIndex++;