From b84c9a8fb6b14b219bf6daf6240d3b89e7d4bfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Tue, 22 Dec 2015 13:31:55 +0100 Subject: Update spongycastle to 1.53 --- .../sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java | 3 ++- .../org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java | 2 +- .../java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java | 5 +++-- .../java/org/sufficientlysecure/keychain/support/KeyringBuilder.java | 4 ++-- extern/spongycastle | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java index be5f21f23..5c0472949 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/CanonicalizedPublicKeyRing.java @@ -23,6 +23,7 @@ import org.spongycastle.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPPublicKeyRing; import org.spongycastle.openpgp.PGPSecretKey; import org.spongycastle.openpgp.PGPSecretKeyRing; +import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator; import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException; import org.sufficientlysecure.keychain.util.IterableIterator; @@ -42,7 +43,7 @@ public class CanonicalizedPublicKeyRing extends CanonicalizedKeyRing { super(verified); if(mRing == null) { // get first object in block - PGPObjectFactory factory = new PGPObjectFactory(blob); + PGPObjectFactory factory = new PGPObjectFactory(blob, new JcaKeyFingerprintCalculator()); try { Object obj = factory.nextObject(); if (! (obj instanceof PGPPublicKeyRing)) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java index 40d6a710b..1290dcdcf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncryptOperation.java @@ -32,10 +32,10 @@ import org.spongycastle.openpgp.PGPException; import org.spongycastle.openpgp.PGPLiteralData; import org.spongycastle.openpgp.PGPLiteralDataGenerator; import org.spongycastle.openpgp.PGPSignatureGenerator; -import org.spongycastle.openpgp.PGPUtil; import org.spongycastle.openpgp.operator.jcajce.JcePBEKeyEncryptionMethodGenerator; import org.spongycastle.openpgp.operator.jcajce.JcePGPDataEncryptorBuilder; import org.spongycastle.openpgp.operator.jcajce.NfcSyncPGPContentSignerBuilder; +import org.spongycastle.openpgp.operator.jcajce.PGPUtil; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.BaseOperation; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java index c6fad1a73..65604f58f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/WrappedSignature.java @@ -30,6 +30,7 @@ import org.spongycastle.openpgp.PGPPublicKey; import org.spongycastle.openpgp.PGPSignature; import org.spongycastle.openpgp.PGPSignatureList; import org.spongycastle.openpgp.PGPUserAttributeSubpacketVector; +import org.spongycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator; import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException; @@ -131,7 +132,7 @@ public class WrappedSignature { SignatureSubpacketTags.REVOCATION_REASON); // For some reason, this is missing in SignatureSubpacketInputStream:146 if (!(p instanceof RevocationReason)) { - p = new RevocationReason(false, p.getData()); + p = new RevocationReason(false, false, p.getData()); } return ((RevocationReason) p).getRevocationDescription(); } @@ -222,7 +223,7 @@ public class WrappedSignature { } public static WrappedSignature fromBytes(byte[] data) { - PGPObjectFactory factory = new PGPObjectFactory(data); + PGPObjectFactory factory = new PGPObjectFactory(data, new JcaKeyFingerprintCalculator()); PGPSignatureList signatures = null; try { if ((signatures = (PGPSignatureList) factory.nextObject()) == null || signatures.isEmpty()) { diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/support/KeyringBuilder.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/support/KeyringBuilder.java index 94193bbcb..b9db518e1 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/support/KeyringBuilder.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/support/KeyringBuilder.java @@ -182,7 +182,7 @@ public class KeyringBuilder { createPreferencesSignatureSubpacket() }; SignatureSubpacket[] unhashedData = new SignatureSubpacket[]{ - new IssuerKeyID(false, KEY_ID.toByteArray()) + new IssuerKeyID(false, false, KEY_ID.toByteArray()) }; byte[] fingerPrint = new BigInteger("522c", 16).toByteArray(); @@ -223,7 +223,7 @@ public class KeyringBuilder { new KeyExpirationTime(false, TimeUnit.DAYS.toSeconds(2)), }; SignatureSubpacket[] unhashedData = new SignatureSubpacket[]{ - new IssuerKeyID(false, KEY_ID.toByteArray()) + new IssuerKeyID(false, false, KEY_ID.toByteArray()) }; byte[] fingerPrint = new BigInteger("234a", 16).toByteArray(); MPInteger[] signature = new MPInteger[]{ diff --git a/extern/spongycastle b/extern/spongycastle index b8387f22a..4d3469eaa 160000 --- a/extern/spongycastle +++ b/extern/spongycastle @@ -1 +1 @@ -Subproject commit b8387f22a9f20d1bd186a377e1ec9208c6eae3e5 +Subproject commit 4d3469eaaa581cebb32e6a4e2b5ac98e6ec185e0 -- cgit v1.2.3