863 lines
37 KiB
Java
863 lines
37 KiB
Java
package org.bouncycastle.x509.util;
|
|
|
|
import android.graphics.Color;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.text.TextUtils;
|
|
import android.view.KeyEvent;
|
|
import android.view.ViewConfiguration;
|
|
import android.widget.ExpandableListView;
|
|
import com.huawei.hms.framework.common.ContainerUtils;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.IOException;
|
|
import java.lang.reflect.Method;
|
|
import java.security.Principal;
|
|
import java.security.cert.CertificateParsingException;
|
|
import java.security.cert.X509CRL;
|
|
import java.security.cert.X509Certificate;
|
|
import java.sql.Date;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Properties;
|
|
import java.util.Set;
|
|
import javax.naming.NamingException;
|
|
import javax.naming.directory.DirContext;
|
|
import javax.naming.directory.InitialDirContext;
|
|
import javax.security.auth.x500.X500Principal;
|
|
import o.C4593bdB;
|
|
import o.xzZ;
|
|
import org.bouncycastle.asn1.ASN1InputStream;
|
|
import org.bouncycastle.asn1.x509.Certificate;
|
|
import org.bouncycastle.asn1.x509.CertificatePair;
|
|
import org.bouncycastle.jce.X509LDAPCertStoreParameters;
|
|
import org.bouncycastle.jce.provider.X509AttrCertParser;
|
|
import org.bouncycastle.jce.provider.X509CRLParser;
|
|
import org.bouncycastle.jce.provider.X509CertPairParser;
|
|
import org.bouncycastle.jce.provider.X509CertParser;
|
|
import org.bouncycastle.util.StoreException;
|
|
import org.bouncycastle.x509.X509AttributeCertStoreSelector;
|
|
import org.bouncycastle.x509.X509AttributeCertificate;
|
|
import org.bouncycastle.x509.X509CRLStoreSelector;
|
|
import org.bouncycastle.x509.X509CertPairStoreSelector;
|
|
import org.bouncycastle.x509.X509CertStoreSelector;
|
|
import org.bouncycastle.x509.X509CertificatePair;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class LDAPStoreHelper {
|
|
private static String LDAP_PROVIDER = "com.sun.jndi.ldap.LdapCtxFactory";
|
|
private static String REFERRALS_IGNORE = "ignore";
|
|
private static final String SEARCH_SECURITY_LEVEL = "none";
|
|
private static final String URL_CONTEXT_PREFIX = "com.sun.jndi.url";
|
|
private static long b = 0;
|
|
private static int cacheSize = 32;
|
|
private static int e = 0;
|
|
private static long lifeTime = 60000;
|
|
private Map cacheMap = new HashMap(cacheSize);
|
|
private X509LDAPCertStoreParameters params;
|
|
private static final byte[] $$a = {85, -61, 49, 80};
|
|
private static final int $$b = 254;
|
|
private static int $10 = 0;
|
|
private static int $11 = 1;
|
|
private static int d = 0;
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:10:0x0025 */
|
|
/* JADX WARN: Removed duplicated region for block: B:7:0x001d */
|
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0025 -> B:4:0x0027). Please report as a decompilation issue!!! */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private static void f(short r5, int r6, int r7, java.lang.Object[] r8) {
|
|
/*
|
|
byte[] r0 = org.bouncycastle.x509.util.LDAPStoreHelper.$$a
|
|
int r7 = r7 + 77
|
|
int r6 = r6 * 2
|
|
int r6 = r6 + 4
|
|
int r5 = r5 * 3
|
|
int r5 = r5 + 1
|
|
byte[] r1 = new byte[r5]
|
|
r2 = 0
|
|
if (r0 != 0) goto L15
|
|
r4 = r7
|
|
r3 = r2
|
|
r7 = r5
|
|
goto L27
|
|
L15:
|
|
r3 = r2
|
|
L16:
|
|
byte r4 = (byte) r7
|
|
r1[r3] = r4
|
|
int r3 = r3 + 1
|
|
if (r3 != r5) goto L25
|
|
java.lang.String r5 = new java.lang.String
|
|
r5.<init>(r1, r2)
|
|
r8[r2] = r5
|
|
return
|
|
L25:
|
|
r4 = r0[r6]
|
|
L27:
|
|
int r7 = r7 + r4
|
|
int r6 = r6 + 1
|
|
goto L16
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.x509.util.LDAPStoreHelper.f(short, int, int, java.lang.Object[]):void");
|
|
}
|
|
|
|
private static void c(char[] cArr, int i, Object[] objArr) {
|
|
int i2 = 2 % 2;
|
|
C4593bdB c4593bdB = new C4593bdB();
|
|
c4593bdB.a = i;
|
|
int length = cArr.length;
|
|
long[] jArr = new long[length];
|
|
c4593bdB.e = 0;
|
|
int i3 = $11 + 37;
|
|
$10 = i3 % 128;
|
|
int i4 = i3 % 2;
|
|
while (c4593bdB.e < cArr.length) {
|
|
int i5 = $11 + 5;
|
|
$10 = i5 % 128;
|
|
int i6 = i5 % 2;
|
|
int i7 = c4593bdB.e;
|
|
try {
|
|
Object[] objArr2 = {Integer.valueOf(cArr[c4593bdB.e]), c4593bdB, c4593bdB};
|
|
Object obj = xzZ.y.get(-1229953068);
|
|
if (obj == null) {
|
|
Class cls = (Class) xzZ.c(TextUtils.indexOf((CharSequence) "", '0') + 403, Color.blue(0) + 5, (char) ((ViewConfiguration.getGlobalActionKeyTimeout() > 0L ? 1 : (ViewConfiguration.getGlobalActionKeyTimeout() == 0L ? 0 : -1)) + 21607));
|
|
byte b2 = (byte) 0;
|
|
byte b3 = b2;
|
|
Object[] objArr3 = new Object[1];
|
|
f(b2, b3, b3, objArr3);
|
|
obj = cls.getMethod((String) objArr3[0], Integer.TYPE, Object.class, Object.class);
|
|
xzZ.y.put(-1229953068, obj);
|
|
}
|
|
jArr[i7] = ((Long) ((Method) obj).invoke(null, objArr2)).longValue() ^ (b ^ (-6958928035870403642L));
|
|
Object[] objArr4 = {c4593bdB, c4593bdB};
|
|
Object obj2 = xzZ.y.get(-1143917229);
|
|
if (obj2 == null) {
|
|
Class cls2 = (Class) xzZ.c((ViewConfiguration.getDoubleTapTimeout() >> 16) + 238, (ExpandableListView.getPackedPositionForChild(0, 0) > 0L ? 1 : (ExpandableListView.getPackedPositionForChild(0, 0) == 0L ? 0 : -1)) + 6, (char) (ViewConfiguration.getKeyRepeatTimeout() >> 16));
|
|
byte b4 = (byte) 0;
|
|
byte b5 = b4;
|
|
Object[] objArr5 = new Object[1];
|
|
f(b4, b5, (byte) (b5 + 1), objArr5);
|
|
obj2 = cls2.getMethod((String) objArr5[0], Object.class, Object.class);
|
|
xzZ.y.put(-1143917229, obj2);
|
|
}
|
|
((Method) obj2).invoke(null, objArr4);
|
|
} catch (Throwable th) {
|
|
Throwable cause = th.getCause();
|
|
if (cause == null) {
|
|
throw th;
|
|
}
|
|
throw cause;
|
|
}
|
|
}
|
|
char[] cArr2 = new char[length];
|
|
c4593bdB.e = 0;
|
|
while (c4593bdB.e < cArr.length) {
|
|
cArr2[c4593bdB.e] = (char) jArr[c4593bdB.e];
|
|
Object[] objArr6 = {c4593bdB, c4593bdB};
|
|
Object obj3 = xzZ.y.get(-1143917229);
|
|
if (obj3 == null) {
|
|
Class cls3 = (Class) xzZ.c(KeyEvent.keyCodeFromString("") + 238, (ViewConfiguration.getLongPressTimeout() >> 16) + 5, (char) TextUtils.getOffsetBefore("", 0));
|
|
byte b6 = (byte) 0;
|
|
byte b7 = b6;
|
|
Object[] objArr7 = new Object[1];
|
|
f(b6, b7, (byte) (b7 + 1), objArr7);
|
|
obj3 = cls3.getMethod((String) objArr7[0], Object.class, Object.class);
|
|
xzZ.y.put(-1143917229, obj3);
|
|
}
|
|
((Method) obj3).invoke(null, objArr6);
|
|
}
|
|
objArr[0] = new String(cArr2);
|
|
}
|
|
|
|
static void b() {
|
|
b = 3287633769219369284L;
|
|
}
|
|
|
|
public Collection getUserCertificates(X509CertStoreSelector x509CertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = d + 35;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getUserCertificateAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapUserCertificateAttributeName());
|
|
String[] splitString3 = splitString(this.params.getUserCertificateSubjectAttributeName());
|
|
Set createCerts = createCerts(certSubjectSerialSearch(x509CertStoreSelector, splitString, splitString2, splitString3), x509CertStoreSelector);
|
|
if (createCerts.size() == 0) {
|
|
createCerts.addAll(createCerts(certSubjectSerialSearch(new X509CertStoreSelector(), splitString, splitString2, splitString3), x509CertStoreSelector));
|
|
}
|
|
int i4 = d + 103;
|
|
e = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return createCerts;
|
|
}
|
|
|
|
public Collection getDeltaCertificateRevocationLists(X509CRLStoreSelector x509CRLStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = d + 9;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getDeltaRevocationListAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapDeltaRevocationListAttributeName());
|
|
String[] splitString3 = splitString(this.params.getDeltaRevocationListIssuerAttributeName());
|
|
Set createCRLs = createCRLs(cRLIssuerSearch(x509CRLStoreSelector, splitString, splitString2, splitString3), x509CRLStoreSelector);
|
|
if (createCRLs.size() == 0) {
|
|
createCRLs.addAll(createCRLs(cRLIssuerSearch(new X509CRLStoreSelector(), splitString, splitString2, splitString3), x509CRLStoreSelector));
|
|
int i4 = d + 45;
|
|
e = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
return createCRLs;
|
|
}
|
|
|
|
public Collection getCrossCertificatePairs(X509CertPairStoreSelector x509CertPairStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = d + 95;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getCrossCertificateAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapCrossCertificateAttributeName());
|
|
String[] splitString3 = splitString(this.params.getCrossCertificateSubjectAttributeName());
|
|
Set createCrossCertificatePairs = createCrossCertificatePairs(crossCertificatePairSubjectSearch(x509CertPairStoreSelector, splitString, splitString2, splitString3), x509CertPairStoreSelector);
|
|
if (createCrossCertificatePairs.size() == 0) {
|
|
X509CertStoreSelector x509CertStoreSelector = new X509CertStoreSelector();
|
|
X509CertPairStoreSelector x509CertPairStoreSelector2 = new X509CertPairStoreSelector();
|
|
x509CertPairStoreSelector2.setForwardSelector(x509CertStoreSelector);
|
|
x509CertPairStoreSelector2.setReverseSelector(x509CertStoreSelector);
|
|
createCrossCertificatePairs.addAll(createCrossCertificatePairs(crossCertificatePairSubjectSearch(x509CertPairStoreSelector2, splitString, splitString2, splitString3), x509CertPairStoreSelector));
|
|
int i4 = e + 35;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
return createCrossCertificatePairs;
|
|
}
|
|
|
|
public Collection getCertificateRevocationLists(X509CRLStoreSelector x509CRLStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = d + 61;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getCertificateRevocationListAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapCertificateRevocationListAttributeName());
|
|
String[] splitString3 = splitString(this.params.getCertificateRevocationListIssuerAttributeName());
|
|
Set createCRLs = createCRLs(cRLIssuerSearch(x509CRLStoreSelector, splitString, splitString2, splitString3), x509CRLStoreSelector);
|
|
if (createCRLs.size() == 0) {
|
|
createCRLs.addAll(createCRLs(cRLIssuerSearch(new X509CRLStoreSelector(), splitString, splitString2, splitString3), x509CRLStoreSelector));
|
|
}
|
|
int i4 = e + 83;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return createCRLs;
|
|
}
|
|
|
|
public Collection getCACertificates(X509CertStoreSelector x509CertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = e + 95;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getCACertificateAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapCACertificateAttributeName());
|
|
String[] splitString3 = splitString(this.params.getCACertificateSubjectAttributeName());
|
|
Set createCerts = createCerts(certSubjectSerialSearch(x509CertStoreSelector, splitString, splitString2, splitString3), x509CertStoreSelector);
|
|
if (createCerts.size() == 0) {
|
|
createCerts.addAll(createCerts(certSubjectSerialSearch(new X509CertStoreSelector(), splitString, splitString2, splitString3), x509CertStoreSelector));
|
|
}
|
|
int i4 = d + 89;
|
|
e = i4 % 128;
|
|
if (i4 % 2 == 0) {
|
|
int i5 = 19 / 0;
|
|
}
|
|
return createCerts;
|
|
}
|
|
|
|
public Collection getAuthorityRevocationLists(X509CRLStoreSelector x509CRLStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = e + 115;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getAuthorityRevocationListAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapAuthorityRevocationListAttributeName());
|
|
String[] splitString3 = splitString(this.params.getAuthorityRevocationListIssuerAttributeName());
|
|
Set createCRLs = createCRLs(cRLIssuerSearch(x509CRLStoreSelector, splitString, splitString2, splitString3), x509CRLStoreSelector);
|
|
if (createCRLs.size() == 0) {
|
|
createCRLs.addAll(createCRLs(cRLIssuerSearch(new X509CRLStoreSelector(), splitString, splitString2, splitString3), x509CRLStoreSelector));
|
|
int i4 = d + 59;
|
|
e = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
int i6 = e + 57;
|
|
d = i6 % 128;
|
|
if (i6 % 2 == 0) {
|
|
return createCRLs;
|
|
}
|
|
throw null;
|
|
}
|
|
|
|
public Collection getAttributeDescriptorCertificates(X509AttributeCertStoreSelector x509AttributeCertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = d + 51;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getAttributeDescriptorCertificateAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapAttributeDescriptorCertificateAttributeName());
|
|
String[] splitString3 = splitString(this.params.getAttributeDescriptorCertificateSubjectAttributeName());
|
|
Set createAttributeCertificates = createAttributeCertificates(attrCertSubjectSerialSearch(x509AttributeCertStoreSelector, splitString, splitString2, splitString3), x509AttributeCertStoreSelector);
|
|
if (createAttributeCertificates.size() == 0) {
|
|
createAttributeCertificates.addAll(createAttributeCertificates(attrCertSubjectSerialSearch(new X509AttributeCertStoreSelector(), splitString, splitString2, splitString3), x509AttributeCertStoreSelector));
|
|
int i4 = d + 65;
|
|
e = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
return createAttributeCertificates;
|
|
}
|
|
|
|
public Collection getAttributeCertificateRevocationLists(X509CRLStoreSelector x509CRLStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = e + 93;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getAttributeCertificateRevocationListAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapAttributeCertificateRevocationListAttributeName());
|
|
String[] splitString3 = splitString(this.params.getAttributeCertificateRevocationListIssuerAttributeName());
|
|
Set createCRLs = createCRLs(cRLIssuerSearch(x509CRLStoreSelector, splitString, splitString2, splitString3), x509CRLStoreSelector);
|
|
if (createCRLs.size() == 0) {
|
|
createCRLs.addAll(createCRLs(cRLIssuerSearch(new X509CRLStoreSelector(), splitString, splitString2, splitString3), x509CRLStoreSelector));
|
|
int i4 = e + 105;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
return createCRLs;
|
|
}
|
|
|
|
public Collection getAttributeCertificateAttributes(X509AttributeCertStoreSelector x509AttributeCertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = d + 51;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getAttributeCertificateAttributeAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapAttributeCertificateAttributeAttributeName());
|
|
String[] splitString3 = splitString(this.params.getAttributeCertificateAttributeSubjectAttributeName());
|
|
Set createAttributeCertificates = createAttributeCertificates(attrCertSubjectSerialSearch(x509AttributeCertStoreSelector, splitString, splitString2, splitString3), x509AttributeCertStoreSelector);
|
|
if (createAttributeCertificates.size() == 0) {
|
|
createAttributeCertificates.addAll(createAttributeCertificates(attrCertSubjectSerialSearch(new X509AttributeCertStoreSelector(), splitString, splitString2, splitString3), x509AttributeCertStoreSelector));
|
|
int i4 = e + 101;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
return createAttributeCertificates;
|
|
}
|
|
|
|
public Collection getAttributeAuthorityRevocationLists(X509CRLStoreSelector x509CRLStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = e + 13;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getAttributeAuthorityRevocationListAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapAttributeAuthorityRevocationListAttributeName());
|
|
String[] splitString3 = splitString(this.params.getAttributeAuthorityRevocationListIssuerAttributeName());
|
|
Set createCRLs = createCRLs(cRLIssuerSearch(x509CRLStoreSelector, splitString, splitString2, splitString3), x509CRLStoreSelector);
|
|
if (createCRLs.size() == 0) {
|
|
createCRLs.addAll(createCRLs(cRLIssuerSearch(new X509CRLStoreSelector(), splitString, splitString2, splitString3), x509CRLStoreSelector));
|
|
int i4 = e + 11;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
return createCRLs;
|
|
}
|
|
|
|
public Collection getAACertificates(X509AttributeCertStoreSelector x509AttributeCertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
int i2 = e + 83;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] splitString = splitString(this.params.getAACertificateAttribute());
|
|
String[] splitString2 = splitString(this.params.getLdapAACertificateAttributeName());
|
|
String[] splitString3 = splitString(this.params.getAACertificateSubjectAttributeName());
|
|
Set createAttributeCertificates = createAttributeCertificates(attrCertSubjectSerialSearch(x509AttributeCertStoreSelector, splitString, splitString2, splitString3), x509AttributeCertStoreSelector);
|
|
if (createAttributeCertificates.size() == 0) {
|
|
createAttributeCertificates.addAll(createAttributeCertificates(attrCertSubjectSerialSearch(new X509AttributeCertStoreSelector(), splitString, splitString2, splitString3), x509AttributeCertStoreSelector));
|
|
}
|
|
int i4 = e + 101;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return createAttributeCertificates;
|
|
}
|
|
|
|
private String[] splitString(String str) {
|
|
int i = 2 % 2;
|
|
int i2 = d + 119;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
String[] split = str.split("\\s+");
|
|
int i4 = e + 15;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return split;
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:39:0x0120, code lost:
|
|
|
|
if (r2 == null) goto L45;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private java.util.List search(java.lang.String[] r11, java.lang.String r12, java.lang.String[] r13) throws org.bouncycastle.util.StoreException {
|
|
/*
|
|
Method dump skipped, instructions count: 299
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.x509.util.LDAPStoreHelper.search(java.lang.String[], java.lang.String, java.lang.String[]):java.util.List");
|
|
}
|
|
|
|
private String parseDN(String str, String str2) {
|
|
int length;
|
|
int i = 2 % 2;
|
|
String lowerCase = str.toLowerCase();
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(str2.toLowerCase());
|
|
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
|
|
int indexOf = lowerCase.indexOf(sb.toString());
|
|
if (indexOf == -1) {
|
|
int i2 = d + 25;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
return "";
|
|
}
|
|
String substring = str.substring(indexOf + str2.length());
|
|
if (substring.indexOf(44) != -1) {
|
|
length = substring.length();
|
|
while (substring.charAt(length - 1) == '\\') {
|
|
int i4 = e + 73;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
length = substring.indexOf(44, length + 1);
|
|
if (length == -1) {
|
|
}
|
|
}
|
|
String substring2 = substring.substring(0, length);
|
|
String substring3 = substring2.substring(substring2.indexOf(61) + 1);
|
|
if (substring3.charAt(0) == ' ') {
|
|
int i6 = d + 33;
|
|
e = i6 % 128;
|
|
int i7 = i6 % 2;
|
|
substring3 = substring3.substring(1);
|
|
}
|
|
if (substring3.startsWith("\"")) {
|
|
substring3 = substring3.substring(1);
|
|
}
|
|
if (!substring3.endsWith("\"")) {
|
|
return substring3;
|
|
}
|
|
int i8 = e + 57;
|
|
d = i8 % 128;
|
|
int i9 = i8 % 2;
|
|
return substring3.substring(0, substring3.length() - 1);
|
|
}
|
|
length = substring.length();
|
|
}
|
|
|
|
private String getSubjectAsString(X509CertStoreSelector x509CertStoreSelector) {
|
|
int i = 2 % 2;
|
|
int i2 = e + 115;
|
|
d = i2 % 128;
|
|
Object obj = null;
|
|
try {
|
|
if (i2 % 2 != 0) {
|
|
x509CertStoreSelector.getSubjectAsBytes();
|
|
throw null;
|
|
}
|
|
byte[] subjectAsBytes = x509CertStoreSelector.getSubjectAsBytes();
|
|
if (subjectAsBytes == null) {
|
|
return null;
|
|
}
|
|
String name = new X500Principal(subjectAsBytes).getName("RFC1779");
|
|
int i3 = d + 125;
|
|
e = i3 % 128;
|
|
if (i3 % 2 != 0) {
|
|
return name;
|
|
}
|
|
obj.hashCode();
|
|
throw null;
|
|
} catch (IOException e2) {
|
|
StringBuilder sb = new StringBuilder("exception processing name: ");
|
|
sb.append(e2.getMessage());
|
|
throw new StoreException(sb.toString(), e2);
|
|
}
|
|
}
|
|
|
|
private List getFromCache(String str) {
|
|
int i = 2 % 2;
|
|
int i2 = d + 73;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
List list = (List) this.cacheMap.get(str);
|
|
long currentTimeMillis = System.currentTimeMillis();
|
|
if (list == null) {
|
|
int i4 = d + 31;
|
|
e = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
return null;
|
|
}
|
|
if (((Date) list.get(0)).getTime() >= currentTimeMillis - lifeTime) {
|
|
return (List) list.get(1);
|
|
}
|
|
int i6 = e + 19;
|
|
d = i6 % 128;
|
|
if (i6 % 2 != 0) {
|
|
int i7 = 92 / 0;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private X500Principal getCertificateIssuer(X509Certificate x509Certificate) {
|
|
int i = 2 % 2;
|
|
int i2 = d + 79;
|
|
e = i2 % 128;
|
|
if (i2 % 2 != 0) {
|
|
return x509Certificate.getIssuerX500Principal();
|
|
}
|
|
x509Certificate.getIssuerX500Principal();
|
|
throw null;
|
|
}
|
|
|
|
private List crossCertificatePairSubjectSearch(X509CertPairStoreSelector x509CertPairStoreSelector, String[] strArr, String[] strArr2, String[] strArr3) throws StoreException {
|
|
String str;
|
|
int i = 2 % 2;
|
|
ArrayList arrayList = new ArrayList();
|
|
if (x509CertPairStoreSelector.getForwardSelector() != null) {
|
|
int i2 = e + 109;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
str = getSubjectAsString(x509CertPairStoreSelector.getForwardSelector());
|
|
} else {
|
|
int i4 = e + 19;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
str = null;
|
|
}
|
|
if (x509CertPairStoreSelector.getCertPair() != null) {
|
|
int i6 = d + 9;
|
|
e = i6 % 128;
|
|
int i7 = i6 % 2;
|
|
if (x509CertPairStoreSelector.getCertPair().getForward() != null) {
|
|
str = x509CertPairStoreSelector.getCertPair().getForward().getSubjectX500Principal().getName("RFC1779");
|
|
}
|
|
}
|
|
if (str != null) {
|
|
int i8 = 0;
|
|
while (i8 < strArr3.length) {
|
|
String parseDN = parseDN(str, strArr3[i8]);
|
|
StringBuilder sb = new StringBuilder("*");
|
|
sb.append(parseDN);
|
|
sb.append("*");
|
|
arrayList.addAll(search(strArr2, sb.toString(), strArr));
|
|
i8++;
|
|
int i9 = d + 93;
|
|
e = i9 % 128;
|
|
int i10 = i9 % 2;
|
|
}
|
|
}
|
|
if (str == null) {
|
|
int i11 = d + 31;
|
|
e = i11 % 128;
|
|
int i12 = i11 % 2;
|
|
arrayList.addAll(search(strArr2, "*", strArr));
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
private Set createCrossCertificatePairs(List list, X509CertPairStoreSelector x509CertPairStoreSelector) throws StoreException {
|
|
X509CertificatePair x509CertificatePair;
|
|
int i = 2 % 2;
|
|
HashSet hashSet = new HashSet();
|
|
int i2 = e + 87;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
int i4 = 0;
|
|
while (i4 < list.size()) {
|
|
try {
|
|
try {
|
|
X509CertPairParser x509CertPairParser = new X509CertPairParser();
|
|
x509CertPairParser.engineInit(new ByteArrayInputStream((byte[]) list.get(i4)));
|
|
x509CertificatePair = (X509CertificatePair) x509CertPairParser.engineRead();
|
|
} catch (IOException | CertificateParsingException unused) {
|
|
}
|
|
} catch (StreamParsingException unused2) {
|
|
int i5 = i4 + 1;
|
|
x509CertificatePair = new X509CertificatePair(new CertificatePair(Certificate.getInstance(new ASN1InputStream((byte[]) list.get(i4)).readObject()), Certificate.getInstance(new ASN1InputStream((byte[]) list.get(i5)).readObject())));
|
|
i4 = i5;
|
|
}
|
|
if (!(!x509CertPairStoreSelector.match(x509CertificatePair))) {
|
|
int i6 = d + 121;
|
|
e = i6 % 128;
|
|
int i7 = i6 % 2;
|
|
hashSet.add(x509CertificatePair);
|
|
}
|
|
i4++;
|
|
}
|
|
return hashSet;
|
|
}
|
|
|
|
private Set createCerts(List list, X509CertStoreSelector x509CertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
HashSet hashSet = new HashSet();
|
|
Iterator it = list.iterator();
|
|
X509CertParser x509CertParser = new X509CertParser();
|
|
while (it.hasNext()) {
|
|
try {
|
|
x509CertParser.engineInit(new ByteArrayInputStream((byte[]) it.next()));
|
|
X509Certificate x509Certificate = (X509Certificate) x509CertParser.engineRead();
|
|
if (x509CertStoreSelector.match((Object) x509Certificate)) {
|
|
int i2 = e + 17;
|
|
d = i2 % 128;
|
|
if (i2 % 2 != 0) {
|
|
hashSet.add(x509Certificate);
|
|
throw null;
|
|
break;
|
|
}
|
|
hashSet.add(x509Certificate);
|
|
int i3 = d + 11;
|
|
e = i3 % 128;
|
|
int i4 = i3 % 2;
|
|
} else {
|
|
continue;
|
|
}
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
int i5 = e + 37;
|
|
d = i5 % 128;
|
|
int i6 = i5 % 2;
|
|
return hashSet;
|
|
}
|
|
|
|
private Set createCRLs(List list, X509CRLStoreSelector x509CRLStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
HashSet hashSet = new HashSet();
|
|
X509CRLParser x509CRLParser = new X509CRLParser();
|
|
Iterator it = list.iterator();
|
|
while (it.hasNext()) {
|
|
try {
|
|
x509CRLParser.engineInit(new ByteArrayInputStream((byte[]) it.next()));
|
|
X509CRL x509crl = (X509CRL) x509CRLParser.engineRead();
|
|
if (x509CRLStoreSelector.match((Object) x509crl)) {
|
|
int i2 = d + 13;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
hashSet.add(x509crl);
|
|
int i4 = d + 61;
|
|
e = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
} catch (StreamParsingException unused) {
|
|
}
|
|
}
|
|
return hashSet;
|
|
}
|
|
|
|
private Set createAttributeCertificates(List list, X509AttributeCertStoreSelector x509AttributeCertStoreSelector) throws StoreException {
|
|
int i = 2 % 2;
|
|
HashSet hashSet = new HashSet();
|
|
Iterator it = list.iterator();
|
|
X509AttrCertParser x509AttrCertParser = new X509AttrCertParser();
|
|
int i2 = d + 103;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
while (it.hasNext()) {
|
|
try {
|
|
x509AttrCertParser.engineInit(new ByteArrayInputStream((byte[]) it.next()));
|
|
X509AttributeCertificate x509AttributeCertificate = (X509AttributeCertificate) x509AttrCertParser.engineRead();
|
|
if (x509AttributeCertStoreSelector.match(x509AttributeCertificate)) {
|
|
int i4 = e + 47;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
hashSet.add(x509AttributeCertificate);
|
|
}
|
|
} catch (StreamParsingException unused) {
|
|
}
|
|
}
|
|
return hashSet;
|
|
}
|
|
|
|
private DirContext connectLDAP() throws NamingException {
|
|
int i = 2 % 2;
|
|
Properties properties = new Properties();
|
|
properties.setProperty("java.naming.factory.initial", LDAP_PROVIDER);
|
|
Object[] objArr = new Object[1];
|
|
c(new char[]{15026}, 35617 - Drawable.resolveOpacity(0, 0), objArr);
|
|
properties.setProperty("java.naming.batchsize", ((String) objArr[0]).intern());
|
|
properties.setProperty("java.naming.provider.url", this.params.getLdapURL());
|
|
properties.setProperty("java.naming.factory.url.pkgs", URL_CONTEXT_PREFIX);
|
|
properties.setProperty("java.naming.referral", REFERRALS_IGNORE);
|
|
properties.setProperty("java.naming.security.authentication", SEARCH_SECURITY_LEVEL);
|
|
InitialDirContext initialDirContext = new InitialDirContext(properties);
|
|
int i2 = e + 37;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
return initialDirContext;
|
|
}
|
|
|
|
private List certSubjectSerialSearch(X509CertStoreSelector x509CertStoreSelector, String[] strArr, String[] strArr2, String[] strArr3) throws StoreException {
|
|
int i = 2 % 2;
|
|
ArrayList arrayList = new ArrayList();
|
|
String subjectAsString = getSubjectAsString(x509CertStoreSelector);
|
|
Object obj = null;
|
|
String obj2 = x509CertStoreSelector.getSerialNumber() != null ? x509CertStoreSelector.getSerialNumber().toString() : null;
|
|
if (x509CertStoreSelector.getCertificate() != null) {
|
|
int i2 = e + 17;
|
|
d = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
subjectAsString = x509CertStoreSelector.getCertificate().getSubjectX500Principal().getName("RFC1779");
|
|
obj2 = x509CertStoreSelector.getCertificate().getSerialNumber().toString();
|
|
}
|
|
if (subjectAsString != null) {
|
|
int i4 = e + 61;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
for (String str : strArr3) {
|
|
String parseDN = parseDN(subjectAsString, str);
|
|
StringBuilder sb = new StringBuilder("*");
|
|
sb.append(parseDN);
|
|
sb.append("*");
|
|
arrayList.addAll(search(strArr2, sb.toString(), strArr));
|
|
}
|
|
}
|
|
if (obj2 != null) {
|
|
int i6 = d + 57;
|
|
e = i6 % 128;
|
|
if (i6 % 2 == 0) {
|
|
this.params.getSearchForSerialNumberIn();
|
|
obj.hashCode();
|
|
throw null;
|
|
}
|
|
if (this.params.getSearchForSerialNumberIn() != null) {
|
|
int i7 = d + 59;
|
|
e = i7 % 128;
|
|
if (i7 % 2 == 0) {
|
|
arrayList.addAll(search(splitString(this.params.getSearchForSerialNumberIn()), obj2, strArr));
|
|
throw null;
|
|
}
|
|
arrayList.addAll(search(splitString(this.params.getSearchForSerialNumberIn()), obj2, strArr));
|
|
}
|
|
}
|
|
if (obj2 == null && subjectAsString == null) {
|
|
arrayList.addAll(search(strArr2, "*", strArr));
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
private List cRLIssuerSearch(X509CRLStoreSelector x509CRLStoreSelector, String[] strArr, String[] strArr2, String[] strArr3) throws StoreException {
|
|
int i = 2 % 2;
|
|
ArrayList arrayList = new ArrayList();
|
|
HashSet hashSet = new HashSet();
|
|
if (x509CRLStoreSelector.getIssuers() != null) {
|
|
hashSet.addAll(x509CRLStoreSelector.getIssuers());
|
|
}
|
|
if (x509CRLStoreSelector.getCertificateChecking() != null) {
|
|
int i2 = d + 11;
|
|
e = i2 % 128;
|
|
int i3 = i2 % 2;
|
|
hashSet.add(getCertificateIssuer(x509CRLStoreSelector.getCertificateChecking()));
|
|
int i4 = e + 1;
|
|
d = i4 % 128;
|
|
int i5 = i4 % 2;
|
|
}
|
|
if (x509CRLStoreSelector.getAttrCertificateChecking() != null) {
|
|
Principal[] principals = x509CRLStoreSelector.getAttrCertificateChecking().getIssuer().getPrincipals();
|
|
int i6 = 0;
|
|
while (i6 < principals.length) {
|
|
Principal principal = principals[i6];
|
|
if (principal instanceof X500Principal) {
|
|
hashSet.add(principal);
|
|
}
|
|
i6++;
|
|
int i7 = d + 115;
|
|
e = i7 % 128;
|
|
if (i7 % 2 == 0) {
|
|
int i8 = 5 / 3;
|
|
}
|
|
}
|
|
}
|
|
Iterator it = hashSet.iterator();
|
|
String str = null;
|
|
while (it.hasNext()) {
|
|
str = ((X500Principal) it.next()).getName("RFC1779");
|
|
for (String str2 : strArr3) {
|
|
String parseDN = parseDN(str, str2);
|
|
StringBuilder sb = new StringBuilder("*");
|
|
sb.append(parseDN);
|
|
sb.append("*");
|
|
arrayList.addAll(search(strArr2, sb.toString(), strArr));
|
|
}
|
|
}
|
|
if (str == null) {
|
|
int i9 = e + 23;
|
|
d = i9 % 128;
|
|
int i10 = i9 % 2;
|
|
arrayList.addAll(search(strArr2, "*", strArr));
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:11:0x0050 */
|
|
/* JADX WARN: Removed duplicated region for block: B:17:0x0085 */
|
|
/* JADX WARN: Removed duplicated region for block: B:23:0x009e */
|
|
/* JADX WARN: Removed duplicated region for block: B:26:0x00ad A[LOOP:0: B:26:0x00ad->B:28:0x00b0, LOOP_START, PHI: r5
|
|
0x00ad: PHI (r5v2 int) = (r5v1 int), (r5v3 int) binds: [B:25:0x00ab, B:28:0x00b0] A[DONT_GENERATE, DONT_INLINE]] */
|
|
/* JADX WARN: Removed duplicated region for block: B:37:0x00f2 A[LOOP:1: B:35:0x00ea->B:37:0x00f2, LOOP_END] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private java.util.List attrCertSubjectSerialSearch(org.bouncycastle.x509.X509AttributeCertStoreSelector r8, java.lang.String[] r9, java.lang.String[] r10, java.lang.String[] r11) throws org.bouncycastle.util.StoreException {
|
|
/*
|
|
Method dump skipped, instructions count: 282
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.x509.util.LDAPStoreHelper.attrCertSubjectSerialSearch(org.bouncycastle.x509.X509AttributeCertStoreSelector, java.lang.String[], java.lang.String[], java.lang.String[]):java.util.List");
|
|
}
|
|
|
|
private void addToCache(String str, List list) {
|
|
synchronized (this) {
|
|
Date date = new Date(System.currentTimeMillis());
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add(date);
|
|
arrayList.add(list);
|
|
if (!this.cacheMap.containsKey(str) && this.cacheMap.size() >= cacheSize) {
|
|
long time = date.getTime();
|
|
Object obj = null;
|
|
for (Map.Entry entry : this.cacheMap.entrySet()) {
|
|
long time2 = ((Date) ((List) entry.getValue()).get(0)).getTime();
|
|
if (time2 < time) {
|
|
obj = entry.getKey();
|
|
time = time2;
|
|
}
|
|
}
|
|
this.cacheMap.remove(obj);
|
|
}
|
|
this.cacheMap.put(str, arrayList);
|
|
}
|
|
}
|
|
|
|
public LDAPStoreHelper(X509LDAPCertStoreParameters x509LDAPCertStoreParameters) {
|
|
this.params = x509LDAPCertStoreParameters;
|
|
}
|
|
|
|
static {
|
|
e = 1;
|
|
b();
|
|
int i = d + 59;
|
|
e = i % 128;
|
|
if (i % 2 == 0) {
|
|
int i2 = 35 / 0;
|
|
}
|
|
}
|
|
}
|