summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/src/main/java/org/conscrypt/NativeCrypto.java10
-rw-r--r--crypto/src/main/java/org/conscrypt/OpenSSLSocketImpl.java11
2 files changed, 10 insertions, 11 deletions
diff --git a/crypto/src/main/java/org/conscrypt/NativeCrypto.java b/crypto/src/main/java/org/conscrypt/NativeCrypto.java
index 18bab4c..1416d1b 100644
--- a/crypto/src/main/java/org/conscrypt/NativeCrypto.java
+++ b/crypto/src/main/java/org/conscrypt/NativeCrypto.java
@@ -29,7 +29,6 @@ import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateParsingException;
-import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
@@ -810,15 +809,6 @@ public final class NativeCrypto {
public static native void SSL_check_private_key(long ssl) throws SSLException;
- public static byte[][] encodeIssuerX509Principals(X509Certificate[] certificates)
- throws CertificateEncodingException {
- byte[][] principalBytes = new byte[certificates.length][];
- for (int i = 0; i < certificates.length; i++) {
- principalBytes[i] = certificates[i].getIssuerX500Principal().getEncoded();
- }
- return principalBytes;
- }
-
public static native void SSL_set_client_CA_list(long ssl, byte[][] asn1DerEncodedX500Principals);
public static native long SSL_get_mode(long ssl);
diff --git a/crypto/src/main/java/org/conscrypt/OpenSSLSocketImpl.java b/crypto/src/main/java/org/conscrypt/OpenSSLSocketImpl.java
index 70ac554..3301387 100644
--- a/crypto/src/main/java/org/conscrypt/OpenSSLSocketImpl.java
+++ b/crypto/src/main/java/org/conscrypt/OpenSSLSocketImpl.java
@@ -362,7 +362,7 @@ public class OpenSSLSocketImpl
if (issuers != null && issuers.length != 0) {
byte[][] issuersBytes;
try {
- issuersBytes = NativeCrypto.encodeIssuerX509Principals(issuers);
+ issuersBytes = encodeIssuerX509Principals(issuers);
} catch (CertificateEncodingException e) {
throw new IOException("Problem encoding principals", e);
}
@@ -445,6 +445,15 @@ public class OpenSSLSocketImpl
}
}
+ private static byte[][] encodeIssuerX509Principals(X509Certificate[] certificates)
+ throws CertificateEncodingException {
+ byte[][] principalBytes = new byte[certificates.length][];
+ for (int i = 0; i < certificates.length; i++) {
+ principalBytes[i] = certificates[i].getIssuerX500Principal().getEncoded();
+ }
+ return principalBytes;
+ }
+
String getPeerHostName() {
if (wrappedHost != null) {
return wrappedHost;