From 3b798fd7e6b45303ff5b7de8bb763bd7d35aff3a Mon Sep 17 00:00:00 2001 From: Ash Hughes Date: Mon, 13 May 2013 15:07:18 +0100 Subject: 1/2 use forked spongycastle to speed up secret key imports --- OpenPGP-Keychain/libs/sc-bzip2-1.47.0.2.jar | Bin 26285 -> 0 bytes OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.2.jar | Bin 1482715 -> 0 bytes OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.2.jar | Bin 278984 -> 0 bytes OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.2.jar | Bin 987827 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 OpenPGP-Keychain/libs/sc-bzip2-1.47.0.2.jar delete mode 100644 OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.2.jar delete mode 100644 OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.2.jar delete mode 100644 OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.2.jar diff --git a/OpenPGP-Keychain/libs/sc-bzip2-1.47.0.2.jar b/OpenPGP-Keychain/libs/sc-bzip2-1.47.0.2.jar deleted file mode 100644 index 3bc42f30e..000000000 Binary files a/OpenPGP-Keychain/libs/sc-bzip2-1.47.0.2.jar and /dev/null differ diff --git a/OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.2.jar b/OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.2.jar deleted file mode 100644 index 7cdbf856e..000000000 Binary files a/OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.2.jar and /dev/null differ diff --git a/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.2.jar b/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.2.jar deleted file mode 100644 index f290334d8..000000000 Binary files a/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.2.jar and /dev/null differ diff --git a/OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.2.jar b/OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.2.jar deleted file mode 100644 index 221a36b29..000000000 Binary files a/OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.2.jar and /dev/null differ -- cgit v1.2.3 From 5db08b9bdc3fe93347c1ecc35147dbcb8f98e2be Mon Sep 17 00:00:00 2001 From: Ash Hughes Date: Mon, 13 May 2013 15:10:52 +0100 Subject: 2/2 use forked spongycastle to speed up secret key imports --- OpenPGP-Keychain/libs/sc-bzip2-1.47.0.3-SNAPSHOT.jar | Bin 0 -> 26304 bytes .../libs/sc-light-jdk15on-1.47.0.3-SNAPSHOT.jar | Bin 0 -> 1482732 bytes .../libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar | Bin 0 -> 279065 bytes .../libs/scprov-jdk15on-1.47.0.3-SNAPSHOT.jar | Bin 0 -> 987884 bytes .../sufficientlysecure/keychain/helper/PgpHelper.java | 13 +------------ README.md | 16 ++++++++++------ 6 files changed, 11 insertions(+), 18 deletions(-) create mode 100644 OpenPGP-Keychain/libs/sc-bzip2-1.47.0.3-SNAPSHOT.jar create mode 100644 OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.3-SNAPSHOT.jar create mode 100644 OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar create mode 100644 OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.3-SNAPSHOT.jar diff --git a/OpenPGP-Keychain/libs/sc-bzip2-1.47.0.3-SNAPSHOT.jar b/OpenPGP-Keychain/libs/sc-bzip2-1.47.0.3-SNAPSHOT.jar new file mode 100644 index 000000000..7eca57732 Binary files /dev/null and b/OpenPGP-Keychain/libs/sc-bzip2-1.47.0.3-SNAPSHOT.jar differ diff --git a/OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.3-SNAPSHOT.jar b/OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.3-SNAPSHOT.jar new file mode 100644 index 000000000..cd745e171 Binary files /dev/null and b/OpenPGP-Keychain/libs/sc-light-jdk15on-1.47.0.3-SNAPSHOT.jar differ diff --git a/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar b/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar new file mode 100644 index 000000000..b96389952 Binary files /dev/null and b/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar differ diff --git a/OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.3-SNAPSHOT.jar b/OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.3-SNAPSHOT.jar new file mode 100644 index 000000000..6f3433dca Binary files /dev/null and b/OpenPGP-Keychain/libs/scprov-jdk15on-1.47.0.3-SNAPSHOT.jar differ diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java index 810f3a6f2..60450ffb8 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/helper/PgpHelper.java @@ -480,18 +480,7 @@ public class PgpHelper { } public static boolean isSecretKeyPrivateEmpty(PGPSecretKey secretKey) { - try { - PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder() - .setProvider(PgpMain.BOUNCY_CASTLE_PROVIDER_NAME).build(new char[] {}); - PGPPrivateKey testKey = secretKey.extractPrivateKey( - keyDecryptor); - if (testKey != null) { - return false; - } - } catch (PGPException e) { //exception if wrong key => not empty - return false; //all good if this fails, we likely didn't use the right password - } - return true; + return secretKey.isPrivateKeyEmpty(); } public static boolean isSecretKeyPrivateEmpty(Context context, long keyId) { diff --git a/README.md b/README.md index 5bdf080df..f4922a635 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Fork OpenPGP Keychain and do a merge request. I will merge your changes back int ## Build with Eclipse -1. File -> Import -> Android -> Existing Android Code Into Workspace, choose "OpenPGP-Kechain/android-libs/ActionBarSherlock" -2. File -> Import -> Android -> Existing Android Code Into Workspace, choose "OpenPGP-Kechain" +1. File -> Import -> Android -> Existing Android Code Into Workspace, choose "OpenPGP-Keychain/android-libs/ActionBarSherlock" +2. File -> Import -> Android -> Existing Android Code Into Workspace, choose "OpenPGP-Keychain" 3. OpenPGP-Kechain can now be build # Libraries @@ -26,7 +26,7 @@ Fork OpenPGP Keychain and do a merge request. I will merge your changes back int All JAR-Libraries are provided in this repository under "libs", all Android Library projects are under "android-libs". * ActionBarSherlock to provide an ActionBar for Android < 3.0 -* Spongy Castle Crypto Lib (Android version of Bouncy Castle) +* forked Spongy Castle Crypto Lib (Android version of Bouncy Castle) * android-support-v4.jar: Compatibility Lib * barcodescanner-android-integration-supportv4.jar: Barcode Scanner Integration @@ -42,9 +42,12 @@ On error see: http://code.google.com/p/zxing/issues/detail?id=1207 ## Build Spongy Castle -Spongy Castle is the stock Bouncy Castle libraries with a couple of small changes to make it work on Android. +Spongy Castle is the stock Bouncy Castle libraries with a couple of small changes to make it work on Android. OpenPGP-Keychain uses a forked version with some small changes to improve key import speed. These changes will be sent to Bouncy Castle, and Spongy Castle will be used again when they have filtered down. + +see +* http://rtyley.github.com/spongycastle/ +* https://github.com/ashh87/spongycastle -see http://rtyley.github.com/spongycastle/ # Notes @@ -162,4 +165,5 @@ OpenPGP Kechain is licensed under Apache License v2. * dashboard_scan_qrcode.svg New creation for OpenPGP Kechain - Apache License v2 \ No newline at end of file + Apache License v2 + -- cgit v1.2.3 From 723a89079ca96f4af537f2a5f2a8b73c2bbb5704 Mon Sep 17 00:00:00 2001 From: Ash Hughes Date: Mon, 13 May 2013 16:10:11 +0100 Subject: enable passphrase changing for subkey only keychains --- .../libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar | Bin 279065 -> 279076 bytes .../keychain/service/KeychainIntentService.java | 6 +++--- .../keychain/ui/EditKeyActivity.java | 7 ------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar b/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar index b96389952..55c28d5b7 100644 Binary files a/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar and b/OpenPGP-Keychain/libs/scpg-jdk15on-1.47.0.3-SNAPSHOT.jar differ diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 48afdff5c..1d48278eb 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -540,9 +540,9 @@ public class KeychainIntentService extends IntentService implements ProgressDial long masterKeyId = data.getLong(SAVE_KEYRING_MASTER_KEY_ID); /* Operation */ - if (!canSign) { //library fails, fix later - //PgpMain.changeSecretKeyPassphrase(this, ProviderHelper.getPGPSecretKeyRingByKeyId(this, masterKeyId), - //oldPassPhrase, newPassPhrase, this); + if (!canSign) { + PgpMain.changeSecretKeyPassphrase(this, ProviderHelper.getPGPSecretKeyRingByKeyId(this, masterKeyId), + oldPassPhrase, newPassPhrase, this); } else { PgpMain.buildSecretKey(this, userIds, keys, keysUsages, masterKeyId, oldPassPhrase, newPassPhrase, this); diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index 3d819a824..bc4467967 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -194,13 +194,6 @@ public class EditKeyActivity extends SherlockFragmentActivity { } }); - //disable key passhphrase changing with empty private keys for no - //library fails, fix later - if (!masterCanSign) { - mChangePassPhrase.setEnabled(false); - mNoPassphrase.setEnabled(false); - } - if (mBuildLayout) { buildLayout(); } -- cgit v1.2.3