diff options
author | Andrew Comminos <andrewcomminos@gmail.com> | 2014-08-24 02:43:20 +0400 |
---|---|---|
committer | Andrew Comminos <andrewcomminos@gmail.com> | 2014-08-24 02:43:20 +0400 |
commit | 343a1598eb947208df197a2de09a629e00d7ad59 (patch) | |
tree | 55882a57b5c0b1c8b36d93ec9b3bef4d12af098e | |
parent | c75b7a5344092dc443a91d04c1aebe584668aaa6 (diff) |
Use custom SpongyCastle libs with better PKCS12 parse support. Fixes
reading unencrypted mumble certificates.
-rw-r--r-- | build.gradle | 9 | ||||
-rw-r--r-- | libs/sc-morlunk-pkix-1.51.0.0.jar | bin | 0 -> 695606 bytes | |||
-rw-r--r-- | libs/sc-morlunk-prov-1.51.0.0.jar | bin | 0 -> 1170784 bytes | |||
-rw-r--r-- | src/main/java/com/morlunk/jumble/net/JumbleConnection.java | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle index dd257aa..dbb3fef 100644 --- a/build.gradle +++ b/build.gradle @@ -32,9 +32,12 @@ repositories { dependencies { compile 'com.android.support:support-v4:19.1.+' compile 'com.google.protobuf:protobuf-java:2.5.0' - compile 'com.madgag.spongycastle:core:1.50.0.0' - compile 'com.madgag.spongycastle:prov:1.50.0.0' - compile 'com.madgag.spongycastle:pkix:1.50.0.0' + compile 'com.madgag.spongycastle:core:1.51.0.0' + + // Custom PKCS12 keybag parse modifications to support Mumble unencrypted certificates + // Source: https://github.com/Morlunk/spongycastle/tree/pkcs12-keybag-fixes + compile files('libs/sc-morlunk-prov-1.51.0.0.jar', 'libs/sc-morlunk-pkix-1.51.0.0.jar') + compile 'com.googlecode.javacpp:javacpp:0.7' compile 'com.intellij:annotations:+@jar' } diff --git a/libs/sc-morlunk-pkix-1.51.0.0.jar b/libs/sc-morlunk-pkix-1.51.0.0.jar Binary files differnew file mode 100644 index 0000000..fde1d60 --- /dev/null +++ b/libs/sc-morlunk-pkix-1.51.0.0.jar diff --git a/libs/sc-morlunk-prov-1.51.0.0.jar b/libs/sc-morlunk-prov-1.51.0.0.jar Binary files differnew file mode 100644 index 0000000..273fa88 --- /dev/null +++ b/libs/sc-morlunk-prov-1.51.0.0.jar diff --git a/src/main/java/com/morlunk/jumble/net/JumbleConnection.java b/src/main/java/com/morlunk/jumble/net/JumbleConnection.java index 50a44c5..95421fe 100644 --- a/src/main/java/com/morlunk/jumble/net/JumbleConnection.java +++ b/src/main/java/com/morlunk/jumble/net/JumbleConnection.java @@ -29,6 +29,8 @@ import com.morlunk.jumble.protobuf.Mumble; import com.morlunk.jumble.protocol.JumbleTCPMessageListener; import com.morlunk.jumble.protocol.JumbleUDPMessageListener; +import org.spongycastle.jce.provider.BouncyCastleProvider; + import java.io.ByteArrayInputStream; import java.io.IOException; import java.net.ConnectException; @@ -463,7 +465,7 @@ public class JumbleConnection implements JumbleTCP.TCPConnectionListener, Jumble try { KeyStore keyStore = null; if(mCertificate != null) { - keyStore = KeyStore.getInstance("PKCS12"); + keyStore = KeyStore.getInstance("PKCS12", new BouncyCastleProvider()); ByteArrayInputStream inputStream = new ByteArrayInputStream(mCertificate); keyStore.load(inputStream, mCertificatePassword != null ? mCertificatePassword.toCharArray() : new char[0]); |