aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain
diff options
context:
space:
mode:
authorAshley Hughes <spirit.returned@gmail.com>2014-03-24 17:41:45 +0000
committerAshley Hughes <spirit.returned@gmail.com>2014-03-24 17:41:45 +0000
commit02688f6ebfb07b70656cbe9fe6d723d36f3ffc35 (patch)
treee635afade2459ac2d20a1039ab2ea1ec2b0be044 /OpenPGP-Keychain
parent300b90bcac6fbf5b5e416943e538a2c2bc49342c (diff)
downloadopen-keychain-02688f6ebfb07b70656cbe9fe6d723d36f3ffc35.tar.gz
open-keychain-02688f6ebfb07b70656cbe9fe6d723d36f3ffc35.tar.bz2
open-keychain-02688f6ebfb07b70656cbe9fe6d723d36f3ffc35.zip
comments, slight change to progress bar
Diffstat (limited to 'OpenPGP-Keychain')
-rw-r--r--OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java16
1 files changed, 10 insertions, 6 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 5f97aa2e5..adccc5ba3 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
@@ -380,6 +380,10 @@ public class PgpKeyOperation {
remove deleted keys
if a key is modified, re-sign it
do we need to remove and add in?
+
+ Todo
+ identify more things which need to be preserved - e.g. trust levels?
+ user attributes
*/
for (PGPSecretKey dKey : saveParcel.deletedKeys) {
@@ -504,7 +508,7 @@ public class PgpKeyOperation {
unhashedPacketsGen.generate(), certificationSignerBuilder, keyEncryptor);
for (int i = 0; i < saveParcel.keys.size(); ++i) {
- updateProgress(40 + 50 * (i - 1) / (saveParcel.keys.size() - 1), 100);
+ updateProgress(40 + 50 * i/ saveParcel.keys.size(), 100);
if (saveParcel.moddedKeys[i]) {
PGPSecretKey subKey = saveParcel.keys.get(i);
PGPPublicKey subPublicKey = subKey.getPublicKey();
@@ -561,7 +565,11 @@ public class PgpKeyOperation {
}
keyGen.addSubKey(subKeyPair, hashedPacketsGen.generate(), unhashedPacketsGen.generate());
- //discard only certain certs
+ //certifications will be discarded if the key is changed, because I think, for a start,
+ //they will be invalid. Binding certs are regenerated anyway, and other certs which
+ //need to be kept are on IDs and attributes
+ //TODO: don't let revoked keys be edited, other than removed - changing one would result in the
+ //revocation being wrong?
}
}
@@ -575,10 +583,6 @@ public class PgpKeyOperation {
pKR = PGPPublicKeyRing.insertPublicKey(pKR, theNextKey.getPublicKey());
}
}
-
-
- updateProgress(R.string.progress_adding_sub_keys, 40, 100);
-
// Build key encryptor based on new passphrase
PBESecretKeyEncryptor keyEncryptorNew = new JcePBESecretKeyEncryptorBuilder(
PGPEncryptedData.CAST5, sha1Calc)