diff --git a/app/build.gradle b/app/build.gradle index 2d1e9780e..8420081de 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -169,14 +169,13 @@ dependencies { implementation 'com.google.code.gson:gson:2.8.6' // encryption libraries - implementation "com.madgag.spongycastle:core:$spongyCastleVersion" - implementation ("com.madgag.spongycastle:prov:$spongyCastleVersion") { + implementation ("org.bouncycastle:bcprov-jdk15on:$bouncyCastleVersion") { exclude group: 'junit' } - implementation ("com.madgag.spongycastle:bcpkix-jdk15on:$spongyCastleVersion") { + implementation ("org.bouncycastle:bcpkix-jdk15on:$bouncyCastleVersion") { exclude group: 'junit' } - implementation ("com.madgag.spongycastle:bcpg-jdk15on:$spongyCastleVersion") { + implementation ("org.bouncycastle:bcpg-jdk15on:$bouncyCastleVersion") { exclude group: 'junit' } diff --git a/app/proguard.cfg b/app/proguard.cfg index 24af97852..c97cb2470 100644 --- a/app/proguard.cfg +++ b/app/proguard.cfg @@ -16,38 +16,38 @@ # keep all of Kontalk -keep class org.kontalk.** { *; } -# keep Spongy Castle --keep class org.spongycastle.crypto.* { *; } --keep class org.spongycastle.crypto.agreement.** { *; } --keep class org.spongycastle.crypto.digests.* { *; } --keep class org.spongycastle.crypto.ec.* { *; } --keep class org.spongycastle.crypto.encodings.* { *; } --keep class org.spongycastle.crypto.engines.* { *; } --keep class org.spongycastle.crypto.macs.* { *; } --keep class org.spongycastle.crypto.modes.* { *; } --keep class org.spongycastle.crypto.paddings.* { *; } --keep class org.spongycastle.crypto.params.* { *; } --keep class org.spongycastle.crypto.prng.* { *; } --keep class org.spongycastle.crypto.signers.* { *; } - --keep class org.spongycastle.jcajce.provider.asymmetric.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.dh.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.dsa.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.ec.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.elgamal.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.rsa.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.util.* { *; } --keep class org.spongycastle.jcajce.provider.asymmetric.x509.* { *; } - --keep class org.spongycastle.jcajce.provider.digest.** { *; } --keep class org.spongycastle.jcajce.provider.keystore.** { *; } --keep class org.spongycastle.jcajce.provider.symmetric.** { *; } --keep class org.spongycastle.jcajce.spec.* { *; } --keep class org.spongycastle.jce.** { *; } - --keep class org.spongycastle.x509.** { *; } --keep class org.spongycastle.bcpg.** { *; } --keep class org.spongycastle.openpgp.** { *; } +# keep Bouncy Castle +-keep class org.bouncycastle.crypto.* { *; } +-keep class org.bouncycastle.crypto.agreement.** { *; } +-keep class org.bouncycastle.crypto.digests.* { *; } +-keep class org.bouncycastle.crypto.ec.* { *; } +-keep class org.bouncycastle.crypto.encodings.* { *; } +-keep class org.bouncycastle.crypto.engines.* { *; } +-keep class org.bouncycastle.crypto.macs.* { *; } +-keep class org.bouncycastle.crypto.modes.* { *; } +-keep class org.bouncycastle.crypto.paddings.* { *; } +-keep class org.bouncycastle.crypto.params.* { *; } +-keep class org.bouncycastle.crypto.prng.* { *; } +-keep class org.bouncycastle.crypto.signers.* { *; } + +-keep class org.bouncycastle.jcajce.provider.asymmetric.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.dh.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.dsa.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.ec.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.elgamal.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.rsa.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.util.* { *; } +-keep class org.bouncycastle.jcajce.provider.asymmetric.x509.* { *; } + +-keep class org.bouncycastle.jcajce.provider.digest.** { *; } +-keep class org.bouncycastle.jcajce.provider.keystore.** { *; } +-keep class org.bouncycastle.jcajce.provider.symmetric.** { *; } +-keep class org.bouncycastle.jcajce.spec.* { *; } +-keep class org.bouncycastle.jce.** { *; } + +-keep class org.bouncycastle.x509.** { *; } +-keep class org.bouncycastle.bcpg.** { *; } +-keep class org.bouncycastle.openpgp.** { *; } # Smack Core classes should be figured out by Proguard -keep class org.jivesoftware.smack.initializer.** { *; } diff --git a/app/src/androidTest/java/org/kontalk/provider/UsersProviderTest.java b/app/src/androidTest/java/org/kontalk/provider/UsersProviderTest.java index 8ccf6dc2e..26d09fcbc 100644 --- a/app/src/androidTest/java/org/kontalk/provider/UsersProviderTest.java +++ b/app/src/androidTest/java/org/kontalk/provider/UsersProviderTest.java @@ -27,8 +27,8 @@ import org.junit.runner.RunWith; import org.jxmpp.util.XmppStringUtils; import org.kontalk.util.XMPPUtils; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.annotation.TargetApi; import android.database.Cursor; diff --git a/app/src/main/java/org/kontalk/Kontalk.java b/app/src/main/java/org/kontalk/Kontalk.java index fe6bf1d3c..eb111c2a7 100644 --- a/app/src/main/java/org/kontalk/Kontalk.java +++ b/app/src/main/java/org/kontalk/Kontalk.java @@ -27,7 +27,7 @@ import com.vanniktech.emoji.EmojiManager; import com.vanniktech.emoji.ios.IosEmojiProvider; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import android.accounts.Account; import android.accounts.AccountManager; diff --git a/app/src/main/java/org/kontalk/authenticator/Authenticator.java b/app/src/main/java/org/kontalk/authenticator/Authenticator.java index 8f8df0a4e..6f2f1cf9c 100644 --- a/app/src/main/java/org/kontalk/authenticator/Authenticator.java +++ b/app/src/main/java/org/kontalk/authenticator/Authenticator.java @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; import org.jxmpp.jid.BareJid; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import android.accounts.AbstractAccountAuthenticator; import android.accounts.Account; diff --git a/app/src/main/java/org/kontalk/crypto/PGP.java b/app/src/main/java/org/kontalk/crypto/PGP.java index c84649443..436cc83a8 100644 --- a/app/src/main/java/org/kontalk/crypto/PGP.java +++ b/app/src/main/java/org/kontalk/crypto/PGP.java @@ -37,43 +37,43 @@ import org.jivesoftware.smack.util.StringUtils; import org.jxmpp.util.XmppStringUtils; -import org.spongycastle.bcpg.ArmoredInputStream; -import org.spongycastle.bcpg.BCPGInputStream; -import org.spongycastle.bcpg.BCPGKey; -import org.spongycastle.bcpg.DSASecretBCPGKey; -import org.spongycastle.bcpg.ECSecretBCPGKey; -import org.spongycastle.bcpg.ElGamalSecretBCPGKey; -import org.spongycastle.bcpg.HashAlgorithmTags; -import org.spongycastle.bcpg.PublicKeyPacket; -import org.spongycastle.bcpg.RSASecretBCPGKey; -import org.spongycastle.jce.provider.BouncyCastleProvider; -import org.spongycastle.openpgp.PGPEncryptedData; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPKeyPair; -import org.spongycastle.openpgp.PGPKeyRingGenerator; -import org.spongycastle.openpgp.PGPObjectFactory; -import org.spongycastle.openpgp.PGPPrivateKey; -import org.spongycastle.openpgp.PGPPublicKey; -import org.spongycastle.openpgp.PGPPublicKeyRing; -import org.spongycastle.openpgp.PGPSecretKey; -import org.spongycastle.openpgp.PGPSecretKeyRing; -import org.spongycastle.openpgp.PGPSignature; -import org.spongycastle.openpgp.PGPSignatureGenerator; -import org.spongycastle.openpgp.PGPSignatureSubpacketGenerator; -import org.spongycastle.openpgp.PGPSignatureSubpacketVector; -import org.spongycastle.openpgp.PGPUtil; -import org.spongycastle.openpgp.operator.KeyFingerPrintCalculator; -import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor; -import org.spongycastle.openpgp.operator.PBESecretKeyEncryptor; -import org.spongycastle.openpgp.operator.PGPDigestCalculator; -import org.spongycastle.openpgp.operator.PGPDigestCalculatorProvider; -import org.spongycastle.openpgp.operator.bc.BcKeyFingerprintCalculator; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPKeyConverter; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPKeyPair; -import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; -import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder; +import org.bouncycastle.bcpg.ArmoredInputStream; +import org.bouncycastle.bcpg.BCPGInputStream; +import org.bouncycastle.bcpg.BCPGKey; +import org.bouncycastle.bcpg.DSASecretBCPGKey; +import org.bouncycastle.bcpg.ECSecretBCPGKey; +import org.bouncycastle.bcpg.ElGamalSecretBCPGKey; +import org.bouncycastle.bcpg.HashAlgorithmTags; +import org.bouncycastle.bcpg.PublicKeyPacket; +import org.bouncycastle.bcpg.RSASecretBCPGKey; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.openpgp.PGPEncryptedData; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPKeyPair; +import org.bouncycastle.openpgp.PGPKeyRingGenerator; +import org.bouncycastle.openpgp.PGPObjectFactory; +import org.bouncycastle.openpgp.PGPPrivateKey; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPSecretKey; +import org.bouncycastle.openpgp.PGPSecretKeyRing; +import org.bouncycastle.openpgp.PGPSignature; +import org.bouncycastle.openpgp.PGPSignatureGenerator; +import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator; +import org.bouncycastle.openpgp.PGPSignatureSubpacketVector; +import org.bouncycastle.openpgp.PGPUtil; +import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; +import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor; +import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor; +import org.bouncycastle.openpgp.operator.PGPDigestCalculator; +import org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider; +import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyConverter; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair; +import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; +import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder; import android.os.Parcel; @@ -81,7 +81,7 @@ /** Some PGP utility method, mainly for use by {@link PersonalKey}. */ public class PGP { - /** Security provider: Spongy Castle. */ + /** Security provider: Bouncy Castle. */ public static Provider PROVIDER; /** Default EC curve used. */ @@ -157,7 +157,7 @@ public static PGPKeyPairRing loadArmored(InputStream privateKeyData, InputStream } public static void registerProvider() { - // create spongy castle provider + // create Bouncy Castle provider // do not register it as can cause issues on some devices PROVIDER = new BouncyCastleProvider(); try { diff --git a/app/src/main/java/org/kontalk/crypto/PGPCoder.java b/app/src/main/java/org/kontalk/crypto/PGPCoder.java index 5361bafc9..47981f2da 100644 --- a/app/src/main/java/org/kontalk/crypto/PGPCoder.java +++ b/app/src/main/java/org/kontalk/crypto/PGPCoder.java @@ -32,31 +32,31 @@ import java.util.Iterator; import java.util.List; -import org.spongycastle.bcpg.HashAlgorithmTags; -import org.spongycastle.openpgp.PGPCompressedData; -import org.spongycastle.openpgp.PGPCompressedDataGenerator; -import org.spongycastle.openpgp.PGPEncryptedData; -import org.spongycastle.openpgp.PGPEncryptedDataGenerator; -import org.spongycastle.openpgp.PGPEncryptedDataList; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPLiteralData; -import org.spongycastle.openpgp.PGPLiteralDataGenerator; -import org.spongycastle.openpgp.PGPObjectFactory; -import org.spongycastle.openpgp.PGPOnePassSignature; -import org.spongycastle.openpgp.PGPOnePassSignatureList; -import org.spongycastle.openpgp.PGPPrivateKey; -import org.spongycastle.openpgp.PGPPublicKeyEncryptedData; -import org.spongycastle.openpgp.PGPPublicKeyRing; -import org.spongycastle.openpgp.PGPSignature; -import org.spongycastle.openpgp.PGPSignatureGenerator; -import org.spongycastle.openpgp.PGPSignatureList; -import org.spongycastle.openpgp.PGPSignatureSubpacketGenerator; -import org.spongycastle.openpgp.operator.KeyFingerPrintCalculator; -import org.spongycastle.openpgp.operator.bc.BcPGPContentSignerBuilder; -import org.spongycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider; -import org.spongycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder; -import org.spongycastle.openpgp.operator.bc.BcPublicKeyDataDecryptorFactory; -import org.spongycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator; +import org.bouncycastle.bcpg.HashAlgorithmTags; +import org.bouncycastle.openpgp.PGPCompressedData; +import org.bouncycastle.openpgp.PGPCompressedDataGenerator; +import org.bouncycastle.openpgp.PGPEncryptedData; +import org.bouncycastle.openpgp.PGPEncryptedDataGenerator; +import org.bouncycastle.openpgp.PGPEncryptedDataList; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPLiteralData; +import org.bouncycastle.openpgp.PGPLiteralDataGenerator; +import org.bouncycastle.openpgp.PGPObjectFactory; +import org.bouncycastle.openpgp.PGPOnePassSignature; +import org.bouncycastle.openpgp.PGPOnePassSignatureList; +import org.bouncycastle.openpgp.PGPPrivateKey; +import org.bouncycastle.openpgp.PGPPublicKeyEncryptedData; +import org.bouncycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPSignature; +import org.bouncycastle.openpgp.PGPSignatureGenerator; +import org.bouncycastle.openpgp.PGPSignatureList; +import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator; +import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; +import org.bouncycastle.openpgp.operator.bc.BcPGPContentSignerBuilder; +import org.bouncycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider; +import org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder; +import org.bouncycastle.openpgp.operator.bc.BcPublicKeyDataDecryptorFactory; +import org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator; import org.kontalk.client.EndpointServer; import org.kontalk.message.TextComponent; diff --git a/app/src/main/java/org/kontalk/crypto/PGPKeyFlags.java b/app/src/main/java/org/kontalk/crypto/PGPKeyFlags.java index 673dd2ae1..0877d9395 100644 --- a/app/src/main/java/org/kontalk/crypto/PGPKeyFlags.java +++ b/app/src/main/java/org/kontalk/crypto/PGPKeyFlags.java @@ -23,7 +23,7 @@ * PGP key flags not supported by Bouncy Castle. * @author Daniele */ -public class PGPKeyFlags implements org.spongycastle.openpgp.PGPKeyFlags { +public class PGPKeyFlags implements org.bouncycastle.openpgp.PGPKeyFlags { public static final int CAN_AUTHENTICATE = 0x20; // This key may be used for authentication. diff --git a/app/src/main/java/org/kontalk/crypto/PGPLazyPublicKeyRingLoader.java b/app/src/main/java/org/kontalk/crypto/PGPLazyPublicKeyRingLoader.java index 5e7885941..dc1cd01a7 100644 --- a/app/src/main/java/org/kontalk/crypto/PGPLazyPublicKeyRingLoader.java +++ b/app/src/main/java/org/kontalk/crypto/PGPLazyPublicKeyRingLoader.java @@ -20,9 +20,9 @@ import java.io.IOException; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPPublicKey; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; /** diff --git a/app/src/main/java/org/kontalk/crypto/PGPUidMismatchException.java b/app/src/main/java/org/kontalk/crypto/PGPUidMismatchException.java index 5791a62dc..cab263f12 100644 --- a/app/src/main/java/org/kontalk/crypto/PGPUidMismatchException.java +++ b/app/src/main/java/org/kontalk/crypto/PGPUidMismatchException.java @@ -18,7 +18,7 @@ package org.kontalk.crypto; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; /** diff --git a/app/src/main/java/org/kontalk/crypto/PersonalKey.java b/app/src/main/java/org/kontalk/crypto/PersonalKey.java index d381da040..7001ef580 100644 --- a/app/src/main/java/org/kontalk/crypto/PersonalKey.java +++ b/app/src/main/java/org/kontalk/crypto/PersonalKey.java @@ -31,18 +31,18 @@ import java.util.Date; import java.util.Iterator; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPKeyPair; -import org.spongycastle.openpgp.PGPPrivateKey; -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.KeyFingerPrintCalculator; -import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor; -import org.spongycastle.openpgp.operator.PGPDigestCalculatorProvider; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; -import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPKeyPair; +import org.bouncycastle.openpgp.PGPPrivateKey; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPSecretKey; +import org.bouncycastle.openpgp.PGPSecretKeyRing; +import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; +import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor; +import org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; +import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; import android.os.Parcel; import android.os.Parcelable; diff --git a/app/src/main/java/org/kontalk/crypto/PersonalKeyExporter.java b/app/src/main/java/org/kontalk/crypto/PersonalKeyExporter.java index 342db0840..34705f34f 100644 --- a/app/src/main/java/org/kontalk/crypto/PersonalKeyExporter.java +++ b/app/src/main/java/org/kontalk/crypto/PersonalKeyExporter.java @@ -33,10 +33,10 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import org.spongycastle.bcpg.ArmoredOutputStream; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.util.io.pem.PemObject; -import org.spongycastle.util.io.pem.PemWriter; +import org.bouncycastle.bcpg.ArmoredOutputStream; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.util.io.pem.PemObject; +import org.bouncycastle.util.io.pem.PemWriter; import org.kontalk.provider.Keyring; diff --git a/app/src/main/java/org/kontalk/crypto/PersonalKeyImporter.java b/app/src/main/java/org/kontalk/crypto/PersonalKeyImporter.java index 7cfaad51b..aeb272223 100644 --- a/app/src/main/java/org/kontalk/crypto/PersonalKeyImporter.java +++ b/app/src/main/java/org/kontalk/crypto/PersonalKeyImporter.java @@ -33,9 +33,9 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import org.spongycastle.bcpg.ArmoredInputStream; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.operator.OperatorCreationException; +import org.bouncycastle.bcpg.ArmoredInputStream; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.operator.OperatorCreationException; import org.kontalk.crypto.PGP.PGPKeyPairRing; import org.kontalk.provider.Keyring; diff --git a/app/src/main/java/org/kontalk/crypto/SubjectPGPPublicKeyInfo.java b/app/src/main/java/org/kontalk/crypto/SubjectPGPPublicKeyInfo.java index 088223a75..dcb7afa04 100644 --- a/app/src/main/java/org/kontalk/crypto/SubjectPGPPublicKeyInfo.java +++ b/app/src/main/java/org/kontalk/crypto/SubjectPGPPublicKeyInfo.java @@ -20,11 +20,11 @@ import java.io.IOException; -import org.spongycastle.asn1.ASN1Encodable; -import org.spongycastle.asn1.ASN1Object; -import org.spongycastle.asn1.ASN1ObjectIdentifier; -import org.spongycastle.asn1.ASN1Primitive; -import org.spongycastle.asn1.DERBitString; +import org.bouncycastle.asn1.ASN1Encodable; +import org.bouncycastle.asn1.ASN1Object; +import org.bouncycastle.asn1.ASN1ObjectIdentifier; +import org.bouncycastle.asn1.ASN1Primitive; +import org.bouncycastle.asn1.DERBitString; /** diff --git a/app/src/main/java/org/kontalk/crypto/X509Bridge.java b/app/src/main/java/org/kontalk/crypto/X509Bridge.java index 2f274234c..32b781b19 100644 --- a/app/src/main/java/org/kontalk/crypto/X509Bridge.java +++ b/app/src/main/java/org/kontalk/crypto/X509Bridge.java @@ -40,44 +40,44 @@ import java.util.List; import java.util.Locale; -import org.spongycastle.asn1.misc.MiscObjectIdentifiers; -import org.spongycastle.asn1.misc.NetscapeCertType; -import org.spongycastle.asn1.x500.X500Name; -import org.spongycastle.asn1.x500.X500NameBuilder; -import org.spongycastle.asn1.x500.style.BCStyle; -import org.spongycastle.asn1.x509.AlgorithmIdentifier; -import org.spongycastle.asn1.x509.AuthorityKeyIdentifier; -import org.spongycastle.asn1.x509.BasicConstraints; -import org.spongycastle.asn1.x509.Extension; -import org.spongycastle.asn1.x509.GeneralName; -import org.spongycastle.asn1.x509.GeneralNames; -import org.spongycastle.asn1.x509.KeyUsage; -import org.spongycastle.asn1.x509.SubjectKeyIdentifier; -import org.spongycastle.asn1.x509.SubjectPublicKeyInfo; -import org.spongycastle.cert.X509CertificateHolder; -import org.spongycastle.cert.X509v3CertificateBuilder; -import org.spongycastle.cert.jcajce.JcaX509CertificateConverter; -import org.spongycastle.cert.jcajce.JcaX509ExtensionUtils; -import org.spongycastle.crypto.params.AsymmetricKeyParameter; -import org.spongycastle.crypto.util.PrivateKeyFactory; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPPrivateKey; -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.KeyFingerPrintCalculator; -import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor; -import org.spongycastle.openpgp.operator.PGPDigestCalculatorProvider; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; -import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; -import org.spongycastle.operator.ContentSigner; -import org.spongycastle.operator.DefaultDigestAlgorithmIdentifierFinder; -import org.spongycastle.operator.DefaultSignatureAlgorithmIdentifierFinder; -import org.spongycastle.operator.OperatorCreationException; -import org.spongycastle.operator.bc.BcContentSignerBuilder; -import org.spongycastle.operator.bc.BcDSAContentSignerBuilder; -import org.spongycastle.operator.bc.BcRSAContentSignerBuilder; +import org.bouncycastle.asn1.misc.MiscObjectIdentifiers; +import org.bouncycastle.asn1.misc.NetscapeCertType; +import org.bouncycastle.asn1.x500.X500Name; +import org.bouncycastle.asn1.x500.X500NameBuilder; +import org.bouncycastle.asn1.x500.style.BCStyle; +import org.bouncycastle.asn1.x509.AlgorithmIdentifier; +import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier; +import org.bouncycastle.asn1.x509.BasicConstraints; +import org.bouncycastle.asn1.x509.Extension; +import org.bouncycastle.asn1.x509.GeneralName; +import org.bouncycastle.asn1.x509.GeneralNames; +import org.bouncycastle.asn1.x509.KeyUsage; +import org.bouncycastle.asn1.x509.SubjectKeyIdentifier; +import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; +import org.bouncycastle.cert.X509CertificateHolder; +import org.bouncycastle.cert.X509v3CertificateBuilder; +import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; +import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils; +import org.bouncycastle.crypto.params.AsymmetricKeyParameter; +import org.bouncycastle.crypto.util.PrivateKeyFactory; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPPrivateKey; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPSecretKey; +import org.bouncycastle.openpgp.PGPSecretKeyRing; +import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; +import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor; +import org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; +import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; +import org.bouncycastle.operator.ContentSigner; +import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder; +import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder; +import org.bouncycastle.operator.OperatorCreationException; +import org.bouncycastle.operator.bc.BcContentSignerBuilder; +import org.bouncycastle.operator.bc.BcDSAContentSignerBuilder; +import org.bouncycastle.operator.bc.BcRSAContentSignerBuilder; import android.os.Build; import android.os.Parcel; diff --git a/app/src/main/java/org/kontalk/crypto/XmppAddrIdentifier.java b/app/src/main/java/org/kontalk/crypto/XmppAddrIdentifier.java index ae06bf6de..2873de9cf 100644 --- a/app/src/main/java/org/kontalk/crypto/XmppAddrIdentifier.java +++ b/app/src/main/java/org/kontalk/crypto/XmppAddrIdentifier.java @@ -18,10 +18,10 @@ package org.kontalk.crypto; -import org.spongycastle.asn1.ASN1Encodable; -import org.spongycastle.asn1.ASN1ObjectIdentifier; -import org.spongycastle.asn1.DERUTF8String; -import org.spongycastle.asn1.DLSequence; +import org.bouncycastle.asn1.ASN1Encodable; +import org.bouncycastle.asn1.ASN1ObjectIdentifier; +import org.bouncycastle.asn1.DERUTF8String; +import org.bouncycastle.asn1.DLSequence; /** diff --git a/app/src/main/java/org/kontalk/data/Contact.java b/app/src/main/java/org/kontalk/data/Contact.java index 871299fc6..fbe1c29d6 100644 --- a/app/src/main/java/org/kontalk/data/Contact.java +++ b/app/src/main/java/org/kontalk/data/Contact.java @@ -32,7 +32,7 @@ import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.stringprep.XmppStringprepException; import org.jxmpp.util.XmppStringUtils; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.content.ContentResolver; import android.content.ContentUris; diff --git a/app/src/main/java/org/kontalk/provider/Keyring.java b/app/src/main/java/org/kontalk/provider/Keyring.java index 9b8f6307f..43bad43c6 100644 --- a/app/src/main/java/org/kontalk/provider/Keyring.java +++ b/app/src/main/java/org/kontalk/provider/Keyring.java @@ -24,9 +24,9 @@ import java.util.Iterator; import java.util.Map; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPPublicKey; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.content.ContentValues; import android.content.Context; diff --git a/app/src/main/java/org/kontalk/service/XMPPConnectionHelper.java b/app/src/main/java/org/kontalk/service/XMPPConnectionHelper.java index bcf4f1bdf..ef97f48a3 100644 --- a/app/src/main/java/org/kontalk/service/XMPPConnectionHelper.java +++ b/app/src/main/java/org/kontalk/service/XMPPConnectionHelper.java @@ -35,7 +35,7 @@ import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.sasl.SASLError; import org.jivesoftware.smack.sasl.SASLErrorException; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import android.annotation.SuppressLint; import android.content.Context; diff --git a/app/src/main/java/org/kontalk/service/msgcenter/ImportKeyPairListener.java b/app/src/main/java/org/kontalk/service/msgcenter/ImportKeyPairListener.java index 0af859c68..12244cd5b 100644 --- a/app/src/main/java/org/kontalk/service/msgcenter/ImportKeyPairListener.java +++ b/app/src/main/java/org/kontalk/service/msgcenter/ImportKeyPairListener.java @@ -25,7 +25,7 @@ import org.kontalk.crypto.PersonalKeyImporter; import org.jivesoftware.smack.packet.Stanza; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import java.io.IOException; import java.security.NoSuchProviderException; diff --git a/app/src/main/java/org/kontalk/service/msgcenter/MessageCenterService.java b/app/src/main/java/org/kontalk/service/msgcenter/MessageCenterService.java index 8b6bf6f18..dbb15f56b 100644 --- a/app/src/main/java/org/kontalk/service/msgcenter/MessageCenterService.java +++ b/app/src/main/java/org/kontalk/service/msgcenter/MessageCenterService.java @@ -83,7 +83,7 @@ import org.jxmpp.jid.parts.Domainpart; import org.jxmpp.jid.parts.Localpart; import org.jxmpp.stringprep.XmppStringprepException; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import android.accounts.Account; import android.app.AlarmManager; diff --git a/app/src/main/java/org/kontalk/service/msgcenter/PresenceListener.java b/app/src/main/java/org/kontalk/service/msgcenter/PresenceListener.java index 779e21e52..dd6bbba4c 100644 --- a/app/src/main/java/org/kontalk/service/msgcenter/PresenceListener.java +++ b/app/src/main/java/org/kontalk/service/msgcenter/PresenceListener.java @@ -28,8 +28,8 @@ import org.jivesoftware.smack.roster.packet.RosterPacket; import org.jivesoftware.smackx.delay.packet.DelayInformation; import org.jxmpp.jid.Jid; -import org.spongycastle.openpgp.PGPPublicKey; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.content.ContentResolver; import android.content.ContentValues; diff --git a/app/src/main/java/org/kontalk/service/msgcenter/RegenerateKeyPairListener.java b/app/src/main/java/org/kontalk/service/msgcenter/RegenerateKeyPairListener.java index cd95aa5ed..5fcafa9a0 100644 --- a/app/src/main/java/org/kontalk/service/msgcenter/RegenerateKeyPairListener.java +++ b/app/src/main/java/org/kontalk/service/msgcenter/RegenerateKeyPairListener.java @@ -26,7 +26,7 @@ import org.jivesoftware.smack.packet.Stanza; import org.kontalk.Kontalk; import org.kontalk.util.XMPPUtils; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import android.accounts.Account; import android.accounts.AccountManager; diff --git a/app/src/main/java/org/kontalk/service/msgcenter/RegisterKeyPairListener.java b/app/src/main/java/org/kontalk/service/msgcenter/RegisterKeyPairListener.java index 88d4e08ba..865d79f7c 100644 --- a/app/src/main/java/org/kontalk/service/msgcenter/RegisterKeyPairListener.java +++ b/app/src/main/java/org/kontalk/service/msgcenter/RegisterKeyPairListener.java @@ -35,8 +35,8 @@ import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.packet.DataForm; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPPublicKey; import android.text.TextUtils; import android.util.Base64; diff --git a/app/src/main/java/org/kontalk/service/registration/RegistrationService.java b/app/src/main/java/org/kontalk/service/registration/RegistrationService.java index de38d3358..f8711e808 100644 --- a/app/src/main/java/org/kontalk/service/registration/RegistrationService.java +++ b/app/src/main/java/org/kontalk/service/registration/RegistrationService.java @@ -61,8 +61,8 @@ import org.jivesoftware.smackx.xdata.FormField; import org.jivesoftware.smackx.xdata.packet.DataForm; import org.jxmpp.util.XmppStringUtils; -import org.spongycastle.openpgp.PGPException; -import org.spongycastle.operator.OperatorCreationException; +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.operator.OperatorCreationException; import android.Manifest; import android.accounts.AccountManager; diff --git a/app/src/main/java/org/kontalk/sync/Syncer.java b/app/src/main/java/org/kontalk/sync/Syncer.java index 584853af9..34975454a 100644 --- a/app/src/main/java/org/kontalk/sync/Syncer.java +++ b/app/src/main/java/org/kontalk/sync/Syncer.java @@ -25,7 +25,7 @@ import org.greenrobot.eventbus.EventBus; import org.jxmpp.util.XmppStringUtils; -import org.spongycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKey; import android.accounts.Account; import android.accounts.OperationCanceledException; diff --git a/app/src/main/java/org/kontalk/ui/ComposeMessageFragment.java b/app/src/main/java/org/kontalk/ui/ComposeMessageFragment.java index d48873e96..666600c2c 100644 --- a/app/src/main/java/org/kontalk/ui/ComposeMessageFragment.java +++ b/app/src/main/java/org/kontalk/ui/ComposeMessageFragment.java @@ -34,8 +34,8 @@ import org.jxmpp.jid.Jid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.util.XmppStringUtils; -import org.spongycastle.openpgp.PGPPublicKey; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.Manifest; import android.app.Activity; diff --git a/app/src/main/java/org/kontalk/ui/GroupInfoFragment.java b/app/src/main/java/org/kontalk/ui/GroupInfoFragment.java index df9d0951f..3dfb48ed3 100644 --- a/app/src/main/java/org/kontalk/ui/GroupInfoFragment.java +++ b/app/src/main/java/org/kontalk/ui/GroupInfoFragment.java @@ -31,8 +31,8 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import org.jxmpp.util.XmppStringUtils; -import org.spongycastle.openpgp.PGPPublicKey; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.app.Activity; import android.content.Context; diff --git a/app/src/main/java/org/kontalk/ui/GroupMessageFragment.java b/app/src/main/java/org/kontalk/ui/GroupMessageFragment.java index 0503285af..a45f3e71a 100644 --- a/app/src/main/java/org/kontalk/ui/GroupMessageFragment.java +++ b/app/src/main/java/org/kontalk/ui/GroupMessageFragment.java @@ -34,7 +34,7 @@ import org.jivesoftware.smackx.chatstates.ChatState; import org.jxmpp.jid.Jid; import org.jxmpp.jid.impl.JidCreate; -import org.spongycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPPublicKeyRing; import android.app.Activity; import android.content.Context; diff --git a/app/src/main/java/org/kontalk/util/MessageUtils.java b/app/src/main/java/org/kontalk/util/MessageUtils.java index adabb16c6..34963d705 100644 --- a/app/src/main/java/org/kontalk/util/MessageUtils.java +++ b/app/src/main/java/org/kontalk/util/MessageUtils.java @@ -34,7 +34,7 @@ import com.google.i18n.phonenumbers.Phonenumber; import org.jivesoftware.smack.util.StringUtils; -import org.spongycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPException; import android.content.ContentValues; import android.content.Context; diff --git a/app/src/test/java/org/kontalk/crypto/PGPTest.java b/app/src/test/java/org/kontalk/crypto/PGPTest.java index 90437ca28..aa6fb10f8 100644 --- a/app/src/test/java/org/kontalk/crypto/PGPTest.java +++ b/app/src/test/java/org/kontalk/crypto/PGPTest.java @@ -26,11 +26,11 @@ import java.util.Date; import org.junit.Test; -import org.spongycastle.openpgp.PGPSecretKeyRing; -import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor; -import org.spongycastle.openpgp.operator.PGPDigestCalculatorProvider; -import org.spongycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; -import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; +import org.bouncycastle.openpgp.PGPSecretKeyRing; +import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor; +import org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider; +import org.bouncycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder; +import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder; import org.kontalk.util.ByteArrayInOutStream; import org.kontalk.util.MessageUtils; diff --git a/build.gradle b/build.gradle index 25d567bd2..5119cd7ae 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ allprojects { targetSdkVersion = 27 compileSdkVersion = 29 smackVersion = project(':client-common-java').smackVersion - spongyCastleVersion = '1.58.0.0' + bouncyCastleVersion = '1.64' anyMapsVersion = '962c4b5cf8' travisBuild = System.getenv("TRAVIS") == "true"