Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab723675 authored by Sergio Giro's avatar Sergio Giro
Browse files

org.apache.conn.ssl: rename DistinguishedNameParser to AndroidDistinguishedNameParser

The name DistinguishedNameParser is used by other libraries having the
same package, and some apps incorrectly include packages that are
present in the boot classpath. This relatively newly introduced
DistinguishedNameParser ends up hiding the ones in the libraries.

Bug: 26647082
Change-Id: I735aef3c1e5dd04e5a8e2eda6da6d9c9179f1c70
parent dbf8c17b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -208,8 +208,8 @@ public abstract class AbstractVerifier implements X509HostnameVerifier {
    }

    public static String[] getCNs(X509Certificate cert) {
        DistinguishedNameParser dnParser =
                new DistinguishedNameParser(cert.getSubjectX500Principal());
        AndroidDistinguishedNameParser dnParser =
                new AndroidDistinguishedNameParser(cert.getSubjectX500Principal());
        List<String> cnList = dnParser.getAllMostSpecificFirst("cn");

        if(!cnList.isEmpty()) {
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import javax.security.auth.x500.X500Principal;
 * @hide
 */
@Deprecated
final class DistinguishedNameParser {
final class AndroidDistinguishedNameParser {
    private final String dn;
    private final int length;
    private int pos;
@@ -42,7 +42,7 @@ final class DistinguishedNameParser {
    /** distinguished name chars */
    private char[] chars;

    public DistinguishedNameParser(X500Principal principal) {
    public AndroidDistinguishedNameParser(X500Principal principal) {
        // RFC2253 is used to ensure we get attributes in the reverse
        // order of the underlying ASN.1 encoding, so that the most
        // significant values of repeated attributes occur first.