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 */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-11-08 18:25:28 +00:00
|
|
|
public final class v {
|
|
|
|
public final Lazy a;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-12-21 23:37:30 +00:00
|
|
|
/* renamed from: b reason: collision with root package name */
|
2022-03-22 15:40:06 +00:00
|
|
|
public final d0 f3658b;
|
2021-12-21 23:37:30 +00:00
|
|
|
public final j c;
|
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 */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-11-08 18:25:28 +00:00
|
|
|
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
|
|
|
|
2022-03-02 20:59:20 +00:00
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
2021-11-08 18:25:28 +00:00
|
|
|
public a(List list) {
|
|
|
|
super(0);
|
|
|
|
this.$peerCertificatesCopy = list;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
2022-03-02 20:59:20 +00:00
|
|
|
public List<? extends Certificate> invoke() {
|
2021-11-08 18:25:28 +00:00
|
|
|
return this.$peerCertificatesCopy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: Handshake.kt */
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-11-08 18:25:28 +00:00
|
|
|
public static final class b extends o implements Function0<List<? extends Certificate>> {
|
|
|
|
public final /* synthetic */ Function0 $peerCertificatesFn;
|
|
|
|
|
2022-03-02 20:59:20 +00:00
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
2021-11-08 18:25:28 +00:00
|
|
|
public b(Function0 function0) {
|
|
|
|
super(0);
|
|
|
|
this.$peerCertificatesFn = function0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
2022-03-02 20:59:20 +00:00
|
|
|
public List<? extends Certificate> invoke() {
|
2021-11-08 18:25:28 +00:00
|
|
|
try {
|
2022-03-02 20:59:20 +00:00
|
|
|
return (List) this.$peerCertificatesFn.invoke();
|
2021-11-08 18:25:28 +00:00
|
|
|
} catch (SSLPeerUnverifiedException unused) {
|
|
|
|
return n.emptyList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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");
|
2022-03-22 15:40:06 +00:00
|
|
|
this.f3658b = d0Var;
|
2021-12-21 23:37:30 +00:00
|
|
|
this.c = 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")) {
|
2021-12-21 23:37:30 +00:00
|
|
|
throw new IOException(b.d.b.a.a.v("cipherSuite == ", cipherSuite));
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
2022-03-22 15:40:06 +00:00
|
|
|
j b2 = j.f3651s.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)) {
|
2021-12-17 22:03:14 +00:00
|
|
|
d0 a2 = d0.p.a(protocol);
|
2021-11-08 18:25:28 +00:00
|
|
|
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;
|
2022-03-22 15:40:06 +00:00
|
|
|
if (vVar.f3658b == this.f3658b && m.areEqual(vVar.c, this.c) && 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-12-21 23:37:30 +00:00
|
|
|
int hashCode = this.c.hashCode();
|
2021-11-08 18:25:28 +00:00
|
|
|
int hashCode2 = c().hashCode();
|
2022-03-22 15:40:06 +00:00
|
|
|
return this.d.hashCode() + ((hashCode2 + ((hashCode + ((this.f3658b.hashCode() + 527) * 31)) * 31)) * 31);
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-12-21 23:37:30 +00:00
|
|
|
List<Certificate> c = c();
|
|
|
|
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(c, 10));
|
|
|
|
for (Certificate certificate : c) {
|
2021-11-08 18:25:28 +00:00
|
|
|
arrayList.add(b(certificate));
|
|
|
|
}
|
|
|
|
String obj = arrayList.toString();
|
2022-03-22 15:40:06 +00:00
|
|
|
StringBuilder W = b.d.b.a.a.W("Handshake{", "tlsVersion=");
|
|
|
|
W.append(this.f3658b);
|
|
|
|
W.append(' ');
|
|
|
|
W.append("cipherSuite=");
|
|
|
|
W.append(this.c);
|
|
|
|
W.append(' ');
|
|
|
|
W.append("peerCertificates=");
|
|
|
|
W.append(obj);
|
|
|
|
W.append(' ');
|
|
|
|
W.append("localCertificates=");
|
2021-11-08 18:25:28 +00:00
|
|
|
List<Certificate> list = this.d;
|
|
|
|
ArrayList arrayList2 = new ArrayList(d0.t.o.collectionSizeOrDefault(list, 10));
|
|
|
|
for (Certificate certificate2 : list) {
|
|
|
|
arrayList2.add(b(certificate2));
|
|
|
|
}
|
2022-03-22 15:40:06 +00:00
|
|
|
W.append(arrayList2);
|
|
|
|
W.append('}');
|
|
|
|
return W.toString();
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|