2021-06-27 20:44:35 +00:00
|
|
|
package f0;
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.g;
|
|
|
|
import d0.t.n;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import f0.e0.c;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.io.IOException;
|
2021-11-08 18:25:28 +00:00
|
|
|
import java.security.cert.Certificate;
|
|
|
|
import java.security.cert.X509Certificate;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import javax.net.ssl.SSLPeerUnverifiedException;
|
|
|
|
import javax.net.ssl.SSLSession;
|
|
|
|
import kotlin.Lazy;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
/* compiled from: Handshake.kt */
|
|
|
|
public final class v {
|
|
|
|
public final Lazy a;
|
|
|
|
public final d0 b;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-11-30 23:47:08 +00:00
|
|
|
public final j f2873c;
|
2021-11-08 18:25:28 +00:00
|
|
|
public final List<Certificate> d;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
/* compiled from: Handshake.kt */
|
|
|
|
public static final class a extends o implements Function0<List<? extends Certificate>> {
|
|
|
|
public final /* synthetic */ List $peerCertificatesCopy;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public a(List list) {
|
|
|
|
super(0);
|
|
|
|
this.$peerCertificatesCopy = list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
|
|
/* renamed from: invoke */
|
|
|
|
public List<? extends Certificate> mo1invoke() {
|
|
|
|
return this.$peerCertificatesCopy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: Handshake.kt */
|
|
|
|
public static final class b extends o implements Function0<List<? extends Certificate>> {
|
|
|
|
public final /* synthetic */ Function0 $peerCertificatesFn;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public b(Function0 function0) {
|
|
|
|
super(0);
|
|
|
|
this.$peerCertificatesFn = function0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
|
|
/* renamed from: invoke */
|
|
|
|
public List<? extends Certificate> mo1invoke() {
|
|
|
|
try {
|
|
|
|
return (List) this.$peerCertificatesFn.mo1invoke();
|
|
|
|
} catch (SSLPeerUnverifiedException unused) {
|
|
|
|
return n.emptyList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r4v0, resolved type: java.util.List<? extends java.security.cert.Certificate> */
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
public v(d0 d0Var, j jVar, List<? extends Certificate> list, Function0<? extends List<? extends Certificate>> function0) {
|
|
|
|
m.checkParameterIsNotNull(d0Var, "tlsVersion");
|
|
|
|
m.checkParameterIsNotNull(jVar, "cipherSuite");
|
|
|
|
m.checkParameterIsNotNull(list, "localCertificates");
|
|
|
|
m.checkParameterIsNotNull(function0, "peerCertificatesFn");
|
|
|
|
this.b = d0Var;
|
2021-11-30 23:47:08 +00:00
|
|
|
this.f2873c = jVar;
|
2021-11-08 18:25:28 +00:00
|
|
|
this.d = list;
|
|
|
|
this.a = g.lazy(new b(function0));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final v a(SSLSession sSLSession) throws IOException {
|
|
|
|
List<Certificate> list;
|
|
|
|
m.checkParameterIsNotNull(sSLSession, "$this$handshake");
|
|
|
|
String cipherSuite = sSLSession.getCipherSuite();
|
|
|
|
if (cipherSuite != null) {
|
|
|
|
int hashCode = cipherSuite.hashCode();
|
|
|
|
if (hashCode == 1019404634 ? cipherSuite.equals("TLS_NULL_WITH_NULL_NULL") : hashCode == 1208658923 && cipherSuite.equals("SSL_NULL_WITH_NULL_NULL")) {
|
|
|
|
throw new IOException(c.d.b.a.a.v("cipherSuite == ", cipherSuite));
|
|
|
|
}
|
2021-11-30 23:47:08 +00:00
|
|
|
j b2 = j.f2866s.b(cipherSuite);
|
2021-11-08 18:25:28 +00:00
|
|
|
String protocol = sSLSession.getProtocol();
|
|
|
|
if (protocol == null) {
|
|
|
|
throw new IllegalStateException("tlsVersion == null".toString());
|
|
|
|
} else if (!m.areEqual("NONE", protocol)) {
|
|
|
|
d0 a2 = d0.o.a(protocol);
|
|
|
|
try {
|
|
|
|
list = d(sSLSession.getPeerCertificates());
|
|
|
|
} catch (SSLPeerUnverifiedException unused) {
|
|
|
|
list = n.emptyList();
|
|
|
|
}
|
|
|
|
return new v(a2, b2, d(sSLSession.getLocalCertificates()), new a(list));
|
|
|
|
} else {
|
|
|
|
throw new IOException("tlsVersion == NONE");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("cipherSuite == null".toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final List<Certificate> d(Certificate[] certificateArr) {
|
|
|
|
return certificateArr != null ? c.m((Certificate[]) Arrays.copyOf(certificateArr, certificateArr.length)) : n.emptyList();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String b(Certificate certificate) {
|
|
|
|
if (certificate instanceof X509Certificate) {
|
|
|
|
return ((X509Certificate) certificate).getSubjectDN().toString();
|
|
|
|
}
|
|
|
|
String type = certificate.getType();
|
|
|
|
m.checkExpressionValueIsNotNull(type, "type");
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final List<Certificate> c() {
|
|
|
|
return (List) this.a.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (obj instanceof v) {
|
|
|
|
v vVar = (v) obj;
|
2021-11-30 23:47:08 +00:00
|
|
|
if (vVar.b == this.b && m.areEqual(vVar.f2873c, this.f2873c) && m.areEqual(vVar.c(), c()) && m.areEqual(vVar.d, this.d)) {
|
2021-11-08 18:25:28 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
2021-11-30 23:47:08 +00:00
|
|
|
int hashCode = this.f2873c.hashCode();
|
2021-11-08 18:25:28 +00:00
|
|
|
int hashCode2 = c().hashCode();
|
|
|
|
return this.d.hashCode() + ((hashCode2 + ((hashCode + ((this.b.hashCode() + 527) * 31)) * 31)) * 31);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
List<Certificate> c2 = c();
|
|
|
|
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(c2, 10));
|
|
|
|
for (Certificate certificate : c2) {
|
|
|
|
arrayList.add(b(certificate));
|
|
|
|
}
|
|
|
|
String obj = arrayList.toString();
|
|
|
|
StringBuilder V = c.d.b.a.a.V("Handshake{", "tlsVersion=");
|
|
|
|
V.append(this.b);
|
|
|
|
V.append(' ');
|
|
|
|
V.append("cipherSuite=");
|
2021-11-30 23:47:08 +00:00
|
|
|
V.append(this.f2873c);
|
2021-11-08 18:25:28 +00:00
|
|
|
V.append(' ');
|
|
|
|
V.append("peerCertificates=");
|
|
|
|
V.append(obj);
|
|
|
|
V.append(' ');
|
|
|
|
V.append("localCertificates=");
|
|
|
|
List<Certificate> list = this.d;
|
|
|
|
ArrayList arrayList2 = new ArrayList(d0.t.o.collectionSizeOrDefault(list, 10));
|
|
|
|
for (Certificate certificate2 : list) {
|
|
|
|
arrayList2.add(b(certificate2));
|
|
|
|
}
|
|
|
|
V.append(arrayList2);
|
|
|
|
V.append('}');
|
|
|
|
return V.toString();
|
|
|
|
}
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|