1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

OpenPGP: Bump Pgpainless to 0.0.1-alpha7

Also unify how new Security Providers are installed.

Thanks to Paul Schaub for helping with this.
This commit is contained in:
Florian Schmaus 2019-07-25 09:56:46 +02:00
parent b86d088926
commit 8da954f7a4
9 changed files with 78 additions and 27 deletions

View file

@ -35,7 +35,6 @@ import static org.jivesoftware.smackx.hashes.HashManager.ALGORITHM.SHA_512;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@ -43,7 +42,7 @@ import java.util.WeakHashMap;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.util.SecurityUtil;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.hashes.element.HashElement;
@ -58,7 +57,9 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
public final class HashManager extends Manager {
static {
Security.addProvider(new BouncyCastleProvider());
// 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);
}
public static final String PREFIX_NS_ALGO = "urn:xmpp:hash-function-text-names:";