From 2ad616ed3f8a801c34da8b10f38103afc0cfe436 Mon Sep 17 00:00:00 2001 From: Ashley Hughes Date: Tue, 1 Apr 2014 23:37:13 +0100 Subject: pass through info that keys are new without relying on new keys orginally being empty --- .../java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp') 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(userId, certification)); } - masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID); + if (!saveParcel.newIDs[userIDIndex]) { + masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID); + } userIDIndex++; } for (Pair 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++; -- cgit v1.2.3