831 lines
35 KiB
Java
831 lines
35 KiB
Java
|
package org.bouncycastle.jce.provider;
|
||
|
|
||
|
import android.os.Process;
|
||
|
import android.os.SystemClock;
|
||
|
import android.text.TextUtils;
|
||
|
import android.util.TypedValue;
|
||
|
import android.view.KeyEvent;
|
||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
|
import com.huawei.hms.framework.common.ContainerUtils;
|
||
|
import java.io.ByteArrayInputStream;
|
||
|
import java.io.IOException;
|
||
|
import java.lang.reflect.Method;
|
||
|
import java.security.InvalidAlgorithmParameterException;
|
||
|
import java.security.cert.CertSelector;
|
||
|
import java.security.cert.CertStoreException;
|
||
|
import java.security.cert.CertStoreParameters;
|
||
|
import java.security.cert.CertStoreSpi;
|
||
|
import java.security.cert.Certificate;
|
||
|
import java.security.cert.CertificateFactory;
|
||
|
import java.security.cert.X509CertSelector;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Collection;
|
||
|
import java.util.HashSet;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.Properties;
|
||
|
import java.util.Set;
|
||
|
import javax.naming.NamingEnumeration;
|
||
|
import javax.naming.NamingException;
|
||
|
import javax.naming.directory.Attribute;
|
||
|
import javax.naming.directory.DirContext;
|
||
|
import javax.naming.directory.InitialDirContext;
|
||
|
import javax.naming.directory.SearchControls;
|
||
|
import javax.naming.directory.SearchResult;
|
||
|
import net.sf.scuba.smartcards.ISO7816;
|
||
|
import o.GuL;
|
||
|
import o.xzZ;
|
||
|
import org.bouncycastle.asn1.ASN1InputStream;
|
||
|
import org.bouncycastle.asn1.x509.CertificatePair;
|
||
|
import org.bouncycastle.jce.X509LDAPCertStoreParameters;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class X509LDAPCertStoreSpi extends CertStoreSpi {
|
||
|
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 c;
|
||
|
private static int d;
|
||
|
private X509LDAPCertStoreParameters params;
|
||
|
private static final byte[] $$a = {ISO7816.INS_DECREASE_STAMPED, 125, -39, -65};
|
||
|
private static final int $$b = 109;
|
||
|
private static int $10 = 0;
|
||
|
private static int $11 = 1;
|
||
|
private static int a = 1;
|
||
|
|
||
|
/* JADX WARN: Removed duplicated region for block: B:10:0x0027 */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:7:0x001f */
|
||
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0027 -> B:4:0x0029). 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 e(int r5, byte r6, int r7, java.lang.Object[] r8) {
|
||
|
/*
|
||
|
int r5 = r5 * 2
|
||
|
int r0 = r5 + 1
|
||
|
int r6 = r6 * 2
|
||
|
int r6 = 121 - r6
|
||
|
byte[] r1 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.$$a
|
||
|
int r7 = r7 * 3
|
||
|
int r7 = 4 - r7
|
||
|
byte[] r0 = new byte[r0]
|
||
|
r2 = 0
|
||
|
if (r1 != 0) goto L17
|
||
|
r3 = r6
|
||
|
r4 = r2
|
||
|
r6 = r5
|
||
|
goto L29
|
||
|
L17:
|
||
|
r3 = r2
|
||
|
L18:
|
||
|
byte r4 = (byte) r6
|
||
|
r0[r3] = r4
|
||
|
int r4 = r3 + 1
|
||
|
if (r3 != r5) goto L27
|
||
|
java.lang.String r5 = new java.lang.String
|
||
|
r5.<init>(r0, r2)
|
||
|
r8[r2] = r5
|
||
|
return
|
||
|
L27:
|
||
|
r3 = r1[r7]
|
||
|
L29:
|
||
|
int r6 = r6 + r3
|
||
|
int r7 = r7 + 1
|
||
|
r3 = r4
|
||
|
goto L18
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.e(int, byte, int, java.lang.Object[]):void");
|
||
|
}
|
||
|
|
||
|
private static void b(char[] cArr, int i, Object[] objArr) {
|
||
|
Object obj;
|
||
|
int i2 = 2 % 2;
|
||
|
GuL guL = new GuL();
|
||
|
char[] a2 = GuL.a(c ^ (-7538262848231253921L), cArr, i);
|
||
|
int i3 = 4;
|
||
|
guL.a = 4;
|
||
|
int i4 = $11 + 101;
|
||
|
$10 = i4 % 128;
|
||
|
int i5 = i4 % 2;
|
||
|
while (true) {
|
||
|
obj = null;
|
||
|
if (guL.a >= a2.length) {
|
||
|
break;
|
||
|
}
|
||
|
int i6 = $11 + 3;
|
||
|
$10 = i6 % 128;
|
||
|
int i7 = i6 % 2;
|
||
|
guL.c = guL.a - i3;
|
||
|
int i8 = guL.a;
|
||
|
try {
|
||
|
Object[] objArr2 = {Long.valueOf(a2[guL.a] ^ a2[guL.a % i3]), Long.valueOf(guL.c), Long.valueOf(c)};
|
||
|
Object obj2 = xzZ.y.get(428080616);
|
||
|
if (obj2 == null) {
|
||
|
Class cls = (Class) xzZ.c((Process.myPid() >> 22) + 208, 4 - ((byte) KeyEvent.getModifierMetaStateMask()), (char) (1706 - (TypedValue.complexToFloat(0) > BitmapDescriptorFactory.HUE_RED ? 1 : (TypedValue.complexToFloat(0) == BitmapDescriptorFactory.HUE_RED ? 0 : -1))));
|
||
|
byte b = (byte) 0;
|
||
|
byte b2 = (byte) (b + 1);
|
||
|
Object[] objArr3 = new Object[1];
|
||
|
e(b, b2, (byte) (b2 - 1), objArr3);
|
||
|
obj2 = cls.getMethod((String) objArr3[0], Long.TYPE, Long.TYPE, Long.TYPE);
|
||
|
xzZ.y.put(428080616, obj2);
|
||
|
}
|
||
|
a2[i8] = ((Character) ((Method) obj2).invoke(null, objArr2)).charValue();
|
||
|
Object[] objArr4 = {guL, guL};
|
||
|
Object obj3 = xzZ.y.get(-1875914398);
|
||
|
if (obj3 == null) {
|
||
|
Class cls2 = (Class) xzZ.c(391 - TextUtils.lastIndexOf("", '0', 0), 6 - (SystemClock.uptimeMillis() > 0L ? 1 : (SystemClock.uptimeMillis() == 0L ? 0 : -1)), (char) TextUtils.getTrimmedLength(""));
|
||
|
byte b3 = (byte) 0;
|
||
|
byte b4 = b3;
|
||
|
Object[] objArr5 = new Object[1];
|
||
|
e(b3, b4, b4, objArr5);
|
||
|
obj3 = cls2.getMethod((String) objArr5[0], Object.class, Object.class);
|
||
|
xzZ.y.put(-1875914398, obj3);
|
||
|
}
|
||
|
((Method) obj3).invoke(null, objArr4);
|
||
|
i3 = 4;
|
||
|
} catch (Throwable th) {
|
||
|
Throwable cause = th.getCause();
|
||
|
if (cause == null) {
|
||
|
throw th;
|
||
|
}
|
||
|
throw cause;
|
||
|
}
|
||
|
}
|
||
|
String str = new String(a2, 4, a2.length - 4);
|
||
|
int i9 = $11 + 55;
|
||
|
$10 = i9 % 128;
|
||
|
if (i9 % 2 == 0) {
|
||
|
objArr[0] = str;
|
||
|
} else {
|
||
|
obj.hashCode();
|
||
|
throw null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void d() {
|
||
|
c = 5089407730103817259L;
|
||
|
}
|
||
|
|
||
|
@Override // java.security.cert.CertStoreSpi
|
||
|
public Collection engineGetCertificates(CertSelector certSelector) throws CertStoreException {
|
||
|
int i = 2 % 2;
|
||
|
if (!(certSelector instanceof X509CertSelector)) {
|
||
|
throw new CertStoreException("selector is not a X509CertSelector");
|
||
|
}
|
||
|
X509CertSelector x509CertSelector = (X509CertSelector) certSelector;
|
||
|
HashSet hashSet = new HashSet();
|
||
|
Set<byte[]> endCertificates = getEndCertificates(x509CertSelector);
|
||
|
endCertificates.addAll(getCACertificates(x509CertSelector));
|
||
|
endCertificates.addAll(getCrossCertificates(x509CertSelector));
|
||
|
try {
|
||
|
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509", BouncyCastleProvider.PROVIDER_NAME);
|
||
|
for (byte[] bArr : endCertificates) {
|
||
|
if (bArr != null) {
|
||
|
if (bArr.length == 0) {
|
||
|
int i2 = a + 45;
|
||
|
d = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
} else {
|
||
|
ArrayList arrayList = new ArrayList();
|
||
|
arrayList.add(bArr);
|
||
|
try {
|
||
|
CertificatePair certificatePair = CertificatePair.getInstance(new ASN1InputStream(bArr).readObject());
|
||
|
arrayList.clear();
|
||
|
if (certificatePair.getForward() != null) {
|
||
|
arrayList.add(certificatePair.getForward().getEncoded());
|
||
|
}
|
||
|
if (certificatePair.getReverse() != null) {
|
||
|
int i4 = d + 95;
|
||
|
a = i4 % 128;
|
||
|
int i5 = i4 % 2;
|
||
|
arrayList.add(certificatePair.getReverse().getEncoded());
|
||
|
}
|
||
|
} catch (IOException | IllegalArgumentException unused) {
|
||
|
}
|
||
|
Iterator it = arrayList.iterator();
|
||
|
while (it.hasNext()) {
|
||
|
try {
|
||
|
Certificate generateCertificate = certificateFactory.generateCertificate(new ByteArrayInputStream((byte[]) it.next()));
|
||
|
if (x509CertSelector.match(generateCertificate)) {
|
||
|
int i6 = a + 111;
|
||
|
d = i6 % 128;
|
||
|
int i7 = i6 % 2;
|
||
|
hashSet.add(generateCertificate);
|
||
|
int i8 = a + 81;
|
||
|
d = i8 % 128;
|
||
|
int i9 = i8 % 2;
|
||
|
}
|
||
|
} catch (Exception unused2) {
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return hashSet;
|
||
|
} catch (Exception e) {
|
||
|
throw new CertStoreException("certificate cannot be constructed from LDAP result: ".concat(String.valueOf(e)));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:10:0x0045, code lost:
|
||
|
|
||
|
r5 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d + 31;
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r5 % 128;
|
||
|
r5 = r5 % 2;
|
||
|
r5 = r11.getIssuerNames().iterator();
|
||
|
r7 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d + 77;
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r7 % 128;
|
||
|
r7 = r7 % 2;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x0063, code lost:
|
||
|
|
||
|
if (r5.hasNext() == false) goto L39;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:13:0x0065, code lost:
|
||
|
|
||
|
r7 = r5.next();
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:14:0x006c, code lost:
|
||
|
|
||
|
if ((r7 instanceof java.lang.String) == true) goto L17;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:15:0x006e, code lost:
|
||
|
|
||
|
r8 = r10.params.getCertificateRevocationListIssuerAttributeName();
|
||
|
r7 = new javax.security.auth.x500.X500Principal((byte[]) r7).getName("RFC1779");
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:17:0x0093, code lost:
|
||
|
|
||
|
r7 = parseDN(r7, r8);
|
||
|
r8 = new java.lang.StringBuilder("*");
|
||
|
r8.append(r7);
|
||
|
r8.append("*");
|
||
|
r4.addAll(search(r3, r8.toString(), r1));
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:18:0x0082, code lost:
|
||
|
|
||
|
r8 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d + 87;
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r8 % 128;
|
||
|
r8 = r8 % 2;
|
||
|
r8 = r10.params.getCertificateRevocationListIssuerAttributeName();
|
||
|
r7 = (java.lang.String) r7;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:21:0x00c2, code lost:
|
||
|
|
||
|
r4.addAll(search(null, "*", r1));
|
||
|
r1 = r4.iterator();
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:23:0x00ce, code lost:
|
||
|
|
||
|
r3 = java.security.cert.CertificateFactory.getInstance("X.509", org.bouncycastle.jce.provider.BouncyCastleProvider.PROVIDER_NAME);
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:25:0x00da, code lost:
|
||
|
|
||
|
if (r1.hasNext() == false) goto L42;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:26:0x00dc, code lost:
|
||
|
|
||
|
r4 = r3.generateCRL(new java.io.ByteArrayInputStream((byte[]) r1.next()));
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:27:0x00ef, code lost:
|
||
|
|
||
|
if (r11.match(r4) == false) goto L45;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:29:0x00f1, code lost:
|
||
|
|
||
|
r5 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d + 37;
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r5 % 128;
|
||
|
r5 = r5 % 2;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:30:0x00fa, code lost:
|
||
|
|
||
|
r2.add(r4);
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:35:0x00fe, code lost:
|
||
|
|
||
|
return r2;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:37:0x00ff, code lost:
|
||
|
|
||
|
r11 = move-exception;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:39:0x010f, code lost:
|
||
|
|
||
|
throw new java.security.cert.CertStoreException("CRL cannot be constructed from LDAP result ".concat(java.lang.String.valueOf(r11)));
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:40:0x00ae, code lost:
|
||
|
|
||
|
r4.addAll(search(r3, "*", r1));
|
||
|
r3 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d + 45;
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r3 % 128;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:41:0x00be, code lost:
|
||
|
|
||
|
if ((r3 % 2) != 0) goto L22;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:42:0x00c0, code lost:
|
||
|
|
||
|
r3 = 5 / 2;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:44:0x0029, code lost:
|
||
|
|
||
|
if ((r11 instanceof java.security.cert.X509CRLSelector) != false) goto L9;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:4:0x001a, code lost:
|
||
|
|
||
|
if ((r11 instanceof java.security.cert.X509CRLSelector) != false) goto L9;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:6:0x0117, code lost:
|
||
|
|
||
|
throw new java.security.cert.CertStoreException("selector is not a X509CRLSelector");
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:8:0x002b, code lost:
|
||
|
|
||
|
r11 = (java.security.cert.X509CRLSelector) r11;
|
||
|
r2 = new java.util.HashSet();
|
||
|
r3 = r10.params.getLdapCertificateRevocationListAttributeName();
|
||
|
r4 = new java.util.HashSet();
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:9:0x0043, code lost:
|
||
|
|
||
|
if (r11.getIssuerNames() == null) goto L19;
|
||
|
*/
|
||
|
@Override // java.security.cert.CertStoreSpi
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public java.util.Collection engineGetCRLs(java.security.cert.CRLSelector r11) throws java.security.cert.CertStoreException {
|
||
|
/*
|
||
|
Method dump skipped, instructions count: 280
|
||
|
To view this dump add '--comments-level debug' option
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.engineGetCRLs(java.security.cert.CRLSelector):java.util.Collection");
|
||
|
}
|
||
|
|
||
|
private Set search(String str, String str2, String[] strArr) throws CertStoreException {
|
||
|
DirContext connectLDAP;
|
||
|
int i = 2 % 2;
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append(str);
|
||
|
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
|
||
|
sb.append(str2);
|
||
|
String obj = sb.toString();
|
||
|
DirContext dirContext = null;
|
||
|
if (str == null) {
|
||
|
int i2 = a + 97;
|
||
|
d = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
obj = null;
|
||
|
}
|
||
|
HashSet hashSet = new HashSet();
|
||
|
try {
|
||
|
try {
|
||
|
connectLDAP = connectLDAP();
|
||
|
} catch (Exception e) {
|
||
|
e = e;
|
||
|
}
|
||
|
} catch (Throwable th) {
|
||
|
th = th;
|
||
|
}
|
||
|
try {
|
||
|
SearchControls searchControls = new SearchControls();
|
||
|
searchControls.setSearchScope(2);
|
||
|
searchControls.setCountLimit(0L);
|
||
|
for (String str3 : strArr) {
|
||
|
String[] strArr2 = {str3};
|
||
|
searchControls.setReturningAttributes(strArr2);
|
||
|
StringBuilder sb2 = new StringBuilder();
|
||
|
sb2.append("(&(");
|
||
|
sb2.append(obj);
|
||
|
sb2.append(")(");
|
||
|
sb2.append(strArr2[0]);
|
||
|
sb2.append("=*))");
|
||
|
String obj2 = sb2.toString();
|
||
|
if (obj == null) {
|
||
|
StringBuilder sb3 = new StringBuilder();
|
||
|
sb3.append("(");
|
||
|
sb3.append(strArr2[0]);
|
||
|
sb3.append("=*)");
|
||
|
obj2 = sb3.toString();
|
||
|
}
|
||
|
NamingEnumeration search = connectLDAP.search(this.params.getBaseDN(), obj2, searchControls);
|
||
|
while (search.hasMoreElements()) {
|
||
|
NamingEnumeration all = ((Attribute) ((SearchResult) search.next()).getAttributes().getAll().next()).getAll();
|
||
|
while (all.hasMore()) {
|
||
|
hashSet.add(all.next());
|
||
|
int i4 = d + 1;
|
||
|
a = i4 % 128;
|
||
|
int i5 = i4 % 2;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (connectLDAP != null) {
|
||
|
try {
|
||
|
connectLDAP.close();
|
||
|
} catch (Exception unused) {
|
||
|
}
|
||
|
}
|
||
|
int i6 = d + 67;
|
||
|
a = i6 % 128;
|
||
|
if (i6 % 2 != 0) {
|
||
|
return hashSet;
|
||
|
}
|
||
|
throw null;
|
||
|
} catch (Exception e2) {
|
||
|
e = e2;
|
||
|
dirContext = connectLDAP;
|
||
|
StringBuilder sb4 = new StringBuilder();
|
||
|
sb4.append("Error getting results from LDAP directory ");
|
||
|
sb4.append(e);
|
||
|
throw new CertStoreException(sb4.toString());
|
||
|
} catch (Throwable th2) {
|
||
|
th = th2;
|
||
|
dirContext = connectLDAP;
|
||
|
if (dirContext != null) {
|
||
|
try {
|
||
|
dirContext.close();
|
||
|
} catch (Exception unused2) {
|
||
|
}
|
||
|
}
|
||
|
throw th;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Removed duplicated region for block: B:16:0x007c */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:19:0x0088 */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:22:0x009b */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:25:? A[RETURN, SYNTHETIC] */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:9:0x0056 */
|
||
|
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:20:0x005e -> B:5:0x004c). Please report as a decompilation issue!!! */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private java.lang.String parseDN(java.lang.String r6, java.lang.String r7) {
|
||
|
/*
|
||
|
r5 = this;
|
||
|
r0 = 2
|
||
|
int r1 = r0 % r0
|
||
|
int r1 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a
|
||
|
int r1 = r1 + 105
|
||
|
int r2 = r1 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d = r2
|
||
|
int r1 = r1 % r0
|
||
|
r2 = 44
|
||
|
r3 = -1
|
||
|
if (r1 == 0) goto L30
|
||
|
java.lang.String r1 = r6.toLowerCase()
|
||
|
java.lang.String r4 = r7.toLowerCase()
|
||
|
int r1 = r1.indexOf(r4)
|
||
|
int r7 = r7.length()
|
||
|
int r7 = r1 << r7
|
||
|
java.lang.String r6 = r6.substring(r7)
|
||
|
r7 = 103(0x67, float:1.44E-43)
|
||
|
int r7 = r6.indexOf(r7)
|
||
|
if (r7 != r3) goto L4c
|
||
|
goto L5e
|
||
|
L30:
|
||
|
java.lang.String r1 = r6.toLowerCase()
|
||
|
java.lang.String r4 = r7.toLowerCase()
|
||
|
int r1 = r1.indexOf(r4)
|
||
|
int r7 = r7.length()
|
||
|
int r1 = r1 + r7
|
||
|
java.lang.String r6 = r6.substring(r1)
|
||
|
int r7 = r6.indexOf(r2)
|
||
|
if (r7 != r3) goto L4c
|
||
|
goto L5e
|
||
|
L4c:
|
||
|
int r1 = r7 + (-1)
|
||
|
char r1 = r6.charAt(r1)
|
||
|
r4 = 92
|
||
|
if (r1 != r4) goto L63
|
||
|
int r7 = r7 + 1
|
||
|
int r7 = r6.indexOf(r2, r7)
|
||
|
if (r7 != r3) goto L4c
|
||
|
L5e:
|
||
|
int r7 = r6.length()
|
||
|
goto L4c
|
||
|
L63:
|
||
|
r1 = 0
|
||
|
java.lang.String r6 = r6.substring(r1, r7)
|
||
|
r7 = 61
|
||
|
int r7 = r6.indexOf(r7)
|
||
|
r2 = 1
|
||
|
int r7 = r7 + r2
|
||
|
java.lang.String r6 = r6.substring(r7)
|
||
|
char r7 = r6.charAt(r1)
|
||
|
r3 = 32
|
||
|
if (r7 != r3) goto L80
|
||
|
java.lang.String r6 = r6.substring(r2)
|
||
|
L80:
|
||
|
java.lang.String r7 = "\""
|
||
|
boolean r3 = r6.startsWith(r7)
|
||
|
if (r3 == 0) goto L95
|
||
|
java.lang.String r6 = r6.substring(r2)
|
||
|
int r3 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d
|
||
|
int r3 = r3 + 87
|
||
|
int r4 = r3 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r4
|
||
|
int r3 = r3 % r0
|
||
|
L95:
|
||
|
boolean r7 = r6.endsWith(r7)
|
||
|
if (r7 == 0) goto Lad
|
||
|
int r7 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a
|
||
|
int r7 = r7 + 67
|
||
|
int r3 = r7 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d = r3
|
||
|
int r7 = r7 % r0
|
||
|
int r7 = r6.length()
|
||
|
int r7 = r7 - r2
|
||
|
java.lang.String r6 = r6.substring(r1, r7)
|
||
|
Lad:
|
||
|
return r6
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.parseDN(java.lang.String, java.lang.String):java.lang.String");
|
||
|
}
|
||
|
|
||
|
private Set getEndCertificates(X509CertSelector x509CertSelector) throws CertStoreException {
|
||
|
Set certSubjectSerialSearch;
|
||
|
int i = 2 % 2;
|
||
|
int i2 = a + 7;
|
||
|
d = i2 % 128;
|
||
|
if (i2 % 2 != 0) {
|
||
|
String[] strArr = new String[1];
|
||
|
strArr[1] = this.params.getUserCertificateAttribute();
|
||
|
certSubjectSerialSearch = certSubjectSerialSearch(x509CertSelector, strArr, this.params.getLdapUserCertificateAttributeName(), this.params.getUserCertificateSubjectAttributeName());
|
||
|
} else {
|
||
|
certSubjectSerialSearch = certSubjectSerialSearch(x509CertSelector, new String[]{this.params.getUserCertificateAttribute()}, this.params.getLdapUserCertificateAttributeName(), this.params.getUserCertificateSubjectAttributeName());
|
||
|
}
|
||
|
int i3 = d + 77;
|
||
|
a = i3 % 128;
|
||
|
int i4 = i3 % 2;
|
||
|
return certSubjectSerialSearch;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:11:0x004e, code lost:
|
||
|
|
||
|
if (r6.isEmpty() != false) goto L9;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:4:0x002d, code lost:
|
||
|
|
||
|
if (r6.isEmpty() != false) goto L9;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:7:0x0050, code lost:
|
||
|
|
||
|
r1 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a + 11;
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d = r1 % 128;
|
||
|
r1 = r1 % 2;
|
||
|
r6.addAll(search(null, "*", r3));
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:8:0x0063, code lost:
|
||
|
|
||
|
if (r1 == 0) goto L12;
|
||
|
*/
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:9:0x0065, code lost:
|
||
|
|
||
|
r0 = 80 / 0;
|
||
|
*/
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private java.util.Set getCrossCertificates(java.security.cert.X509CertSelector r6) throws java.security.cert.CertStoreException {
|
||
|
/*
|
||
|
r5 = this;
|
||
|
r0 = 2
|
||
|
int r1 = r0 % r0
|
||
|
int r1 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d
|
||
|
int r1 = r1 + 89
|
||
|
int r2 = r1 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a = r2
|
||
|
int r1 = r1 % r0
|
||
|
r2 = 0
|
||
|
if (r1 != 0) goto L30
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r1 = r5.params
|
||
|
java.lang.String r1 = r1.getCrossCertificateAttribute()
|
||
|
java.lang.String[] r3 = new java.lang.String[r2]
|
||
|
r3[r2] = r1
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r1 = r5.params
|
||
|
java.lang.String r1 = r1.getLdapCrossCertificateAttributeName()
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r4 = r5.params
|
||
|
java.lang.String r4 = r4.getCrossCertificateSubjectAttributeName()
|
||
|
java.util.Set r6 = r5.certSubjectSerialSearch(r6, r3, r1, r4)
|
||
|
boolean r1 = r6.isEmpty()
|
||
|
if (r1 == 0) goto L68
|
||
|
goto L50
|
||
|
L30:
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r1 = r5.params
|
||
|
java.lang.String r1 = r1.getCrossCertificateAttribute()
|
||
|
java.lang.String[] r3 = new java.lang.String[]{r1}
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r1 = r5.params
|
||
|
java.lang.String r1 = r1.getLdapCrossCertificateAttributeName()
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r4 = r5.params
|
||
|
java.lang.String r4 = r4.getCrossCertificateSubjectAttributeName()
|
||
|
java.util.Set r6 = r5.certSubjectSerialSearch(r6, r3, r1, r4)
|
||
|
boolean r1 = r6.isEmpty()
|
||
|
if (r1 == 0) goto L68
|
||
|
L50:
|
||
|
int r1 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a
|
||
|
int r1 = r1 + 11
|
||
|
int r4 = r1 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d = r4
|
||
|
int r1 = r1 % r0
|
||
|
java.lang.String r0 = "*"
|
||
|
r4 = 0
|
||
|
java.util.Set r0 = r5.search(r4, r0, r3)
|
||
|
r6.addAll(r0)
|
||
|
if (r1 == 0) goto L68
|
||
|
r0 = 80
|
||
|
int r0 = r0 / r2
|
||
|
L68:
|
||
|
return r6
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.getCrossCertificates(java.security.cert.X509CertSelector):java.util.Set");
|
||
|
}
|
||
|
|
||
|
private Set getCACertificates(X509CertSelector x509CertSelector) throws CertStoreException {
|
||
|
int i = 2 % 2;
|
||
|
String[] strArr = {this.params.getCACertificateAttribute()};
|
||
|
Set certSubjectSerialSearch = certSubjectSerialSearch(x509CertSelector, strArr, this.params.getLdapCACertificateAttributeName(), this.params.getCACertificateSubjectAttributeName());
|
||
|
if (certSubjectSerialSearch.isEmpty()) {
|
||
|
int i2 = a + 123;
|
||
|
d = i2 % 128;
|
||
|
int i3 = i2 % 2;
|
||
|
certSubjectSerialSearch.addAll(search(null, "*", strArr));
|
||
|
}
|
||
|
int i4 = a + 43;
|
||
|
d = i4 % 128;
|
||
|
int i5 = i4 % 2;
|
||
|
return certSubjectSerialSearch;
|
||
|
}
|
||
|
|
||
|
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];
|
||
|
b(new char[]{22042, 55163, 22058, 49322, 24595}, KeyEvent.keyCodeFromString(""), 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 = d + 103;
|
||
|
a = i2 % 128;
|
||
|
if (i2 % 2 != 0) {
|
||
|
return initialDirContext;
|
||
|
}
|
||
|
Object obj = null;
|
||
|
obj.hashCode();
|
||
|
throw null;
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:14:0x0029, code lost:
|
||
|
|
||
|
if (r7.getCertificate() != null) goto L21;
|
||
|
*/
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
private java.util.Set certSubjectSerialSearch(java.security.cert.X509CertSelector r7, java.lang.String[] r8, java.lang.String r9, java.lang.String r10) throws java.security.cert.CertStoreException {
|
||
|
/*
|
||
|
r6 = this;
|
||
|
r0 = 2
|
||
|
int r1 = r0 % r0
|
||
|
java.util.HashSet r1 = new java.util.HashSet
|
||
|
r1.<init>()
|
||
|
byte[] r2 = r7.getSubjectAsBytes() // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r3 = "*"
|
||
|
if (r2 != 0) goto L3b
|
||
|
java.lang.String r2 = r7.getSubjectAsString() // Catch: java.io.IOException -> Lcc
|
||
|
if (r2 != 0) goto L3b
|
||
|
int r2 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a
|
||
|
int r2 = r2 + 81
|
||
|
int r4 = r2 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d = r4
|
||
|
int r2 = r2 % r0
|
||
|
if (r2 == 0) goto L2e
|
||
|
java.security.cert.X509Certificate r2 = r7.getCertificate() // Catch: java.io.IOException -> Lcc
|
||
|
r4 = 94
|
||
|
int r4 = r4 / 0
|
||
|
if (r2 == 0) goto L35
|
||
|
goto L3b
|
||
|
L2c:
|
||
|
r7 = move-exception
|
||
|
throw r7
|
||
|
L2e:
|
||
|
java.security.cert.X509Certificate r2 = r7.getCertificate() // Catch: java.io.IOException -> Lcc
|
||
|
if (r2 == 0) goto L35
|
||
|
goto L3b
|
||
|
L35:
|
||
|
java.util.Set r7 = r6.search(r9, r3, r8) // Catch: java.io.IOException -> Lcc
|
||
|
goto Lbf
|
||
|
L3b:
|
||
|
java.security.cert.X509Certificate r2 = r7.getCertificate() // Catch: java.io.IOException -> Lcc
|
||
|
r4 = 0
|
||
|
java.lang.String r5 = "RFC1779"
|
||
|
if (r2 == 0) goto L5d
|
||
|
java.security.cert.X509Certificate r2 = r7.getCertificate() // Catch: java.io.IOException -> Lcc
|
||
|
javax.security.auth.x500.X500Principal r2 = r2.getSubjectX500Principal() // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r2 = r2.getName(r5) // Catch: java.io.IOException -> Lcc
|
||
|
java.security.cert.X509Certificate r7 = r7.getCertificate() // Catch: java.io.IOException -> Lcc
|
||
|
java.math.BigInteger r7 = r7.getSerialNumber() // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r7 = r7.toString() // Catch: java.io.IOException -> Lcc
|
||
|
goto L77
|
||
|
L5d:
|
||
|
byte[] r2 = r7.getSubjectAsBytes() // Catch: java.io.IOException -> Lcc
|
||
|
if (r2 == 0) goto L71
|
||
|
javax.security.auth.x500.X500Principal r2 = new javax.security.auth.x500.X500Principal // Catch: java.io.IOException -> Lcc
|
||
|
byte[] r7 = r7.getSubjectAsBytes() // Catch: java.io.IOException -> Lcc
|
||
|
r2.<init>(r7) // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r7 = r2.getName(r5) // Catch: java.io.IOException -> Lcc
|
||
|
goto L75
|
||
|
L71:
|
||
|
java.lang.String r7 = r7.getSubjectAsString() // Catch: java.io.IOException -> Lcc
|
||
|
L75:
|
||
|
r2 = r7
|
||
|
r7 = r4
|
||
|
L77:
|
||
|
java.lang.String r10 = r6.parseDN(r2, r10) // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch: java.io.IOException -> Lcc
|
||
|
r2.<init>(r3) // Catch: java.io.IOException -> Lcc
|
||
|
r2.append(r10) // Catch: java.io.IOException -> Lcc
|
||
|
r2.append(r3) // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r10 = r2.toString() // Catch: java.io.IOException -> Lcc
|
||
|
java.util.Set r9 = r6.search(r9, r10, r8) // Catch: java.io.IOException -> Lcc
|
||
|
r1.addAll(r9) // Catch: java.io.IOException -> Lcc
|
||
|
if (r7 == 0) goto Lcb
|
||
|
int r9 = org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.a
|
||
|
int r9 = r9 + 17
|
||
|
int r10 = r9 % 128
|
||
|
org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.d = r10
|
||
|
int r9 = r9 % r0
|
||
|
if (r9 != 0) goto Lc3
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r9 = r6.params // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r9 = r9.getSearchForSerialNumberIn() // Catch: java.io.IOException -> Lcc
|
||
|
if (r9 == 0) goto Lcb
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r9 = r6.params // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r9 = r9.getSearchForSerialNumberIn() // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.StringBuilder r10 = new java.lang.StringBuilder // Catch: java.io.IOException -> Lcc
|
||
|
r10.<init>(r3) // Catch: java.io.IOException -> Lcc
|
||
|
r10.append(r7) // Catch: java.io.IOException -> Lcc
|
||
|
r10.append(r3) // Catch: java.io.IOException -> Lcc
|
||
|
java.lang.String r7 = r10.toString() // Catch: java.io.IOException -> Lcc
|
||
|
java.util.Set r7 = r6.search(r9, r7, r8) // Catch: java.io.IOException -> Lcc
|
||
|
Lbf:
|
||
|
r1.addAll(r7) // Catch: java.io.IOException -> Lcc
|
||
|
goto Lcb
|
||
|
Lc3:
|
||
|
org.bouncycastle.jce.X509LDAPCertStoreParameters r7 = r6.params // Catch: java.io.IOException -> Lcc
|
||
|
r7.getSearchForSerialNumberIn() // Catch: java.io.IOException -> Lcc
|
||
|
throw r4 // Catch: java.lang.Throwable -> Lc9 java.io.IOException -> Lcc
|
||
|
Lc9:
|
||
|
r7 = move-exception
|
||
|
throw r7
|
||
|
Lcb:
|
||
|
return r1
|
||
|
Lcc:
|
||
|
r7 = move-exception
|
||
|
java.security.cert.CertStoreException r8 = new java.security.cert.CertStoreException
|
||
|
java.lang.String r9 = "exception processing selector: "
|
||
|
java.lang.String r7 = java.lang.String.valueOf(r7)
|
||
|
java.lang.String r7 = r9.concat(r7)
|
||
|
r8.<init>(r7)
|
||
|
throw r8
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.certSubjectSerialSearch(java.security.cert.X509CertSelector, java.lang.String[], java.lang.String, java.lang.String):java.util.Set");
|
||
|
}
|
||
|
|
||
|
public X509LDAPCertStoreSpi(CertStoreParameters certStoreParameters) throws InvalidAlgorithmParameterException {
|
||
|
super(certStoreParameters);
|
||
|
if (certStoreParameters instanceof X509LDAPCertStoreParameters) {
|
||
|
this.params = (X509LDAPCertStoreParameters) certStoreParameters;
|
||
|
int i = a + 63;
|
||
|
d = i % 128;
|
||
|
int i2 = i % 2;
|
||
|
return;
|
||
|
}
|
||
|
StringBuilder sb = new StringBuilder();
|
||
|
sb.append(X509LDAPCertStoreSpi.class.getName());
|
||
|
sb.append(": parameter must be a ");
|
||
|
sb.append(X509LDAPCertStoreParameters.class.getName());
|
||
|
sb.append(" object\n");
|
||
|
sb.append(certStoreParameters.toString());
|
||
|
throw new InvalidAlgorithmParameterException(sb.toString());
|
||
|
}
|
||
|
|
||
|
static {
|
||
|
d = 0;
|
||
|
d();
|
||
|
int i = a + 9;
|
||
|
d = i % 128;
|
||
|
if (i % 2 != 0) {
|
||
|
throw null;
|
||
|
}
|
||
|
}
|
||
|
}
|