1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Remove Bouncycastle as direct dependency

By not directly depending on Bouncycastle (BC), we avoid conflicts between
different bouncycastle versions. It is also part of the developers job
to take care that all required security primitives are available. If
they are provide by BC or some other security provider should not be
up to Smack to decide.

We now only add BC as test dependency to satisfy this requirement when
the unit tests are executed.
This commit is contained in:
Florian Schmaus 2020-03-13 16:58:45 +01:00
parent 4beaae7d6a
commit 4dd3800d82
9 changed files with 15 additions and 25 deletions

View file

@ -7,7 +7,5 @@ dependencies {
compile project(":smack-extensions")
compile project(":smack-experimental")
compile "org.bouncycastle:bcprov-jdk15on:$bouncyCastleVersion"
testCompile project(path: ":smack-core", configuration: "testRuntime")
}

View file

@ -17,9 +17,6 @@
package org.jivesoftware.smackx.omemo;
import org.jivesoftware.smack.initializer.UrlInitializer;
import org.jivesoftware.smack.util.SecurityUtil;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
/**
* Initializer class that registers omemo providers.
@ -29,12 +26,6 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
@SuppressWarnings("unused")
public class OmemoInitializer extends UrlInitializer {
static {
// Remove any BC providers and add a fresh one.
// This is done, since older Android versions ship with a crippled BC provider.
SecurityUtil.ensureProviderAtFirstPosition(BouncyCastleProvider.class);
}
@Override
protected String getProvidersUri() {
return "classpath:org.jivesoftware.smackx.omemo/omemo.providers";

View file

@ -27,7 +27,6 @@ import static org.junit.Assert.assertNotNull;
import java.security.NoSuchAlgorithmException;
import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smackx.omemo.element.OmemoElement;
import org.jivesoftware.smackx.omemo.exceptions.CryptoFailedException;
import org.jivesoftware.smackx.omemo.internal.CipherAndAuthTag;