Skip to content

Instantly share code, notes, and snippets.

@Gratsh
Created December 3, 2018 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gratsh/68ee369f9d0dfa56d196d1ab2fe36dc0 to your computer and use it in GitHub Desktop.
Save Gratsh/68ee369f9d0dfa56d196d1ab2fe36dc0 to your computer and use it in GitHub Desktop.
1234
public void m22766a(String str, List<Certificate> list) {
List a = m22764a(str);
if (!a.isEmpty()) {
int i;
if (this.f20058c != null) {
list = this.f20058c.mo7147a(list, str);
}
int size = list.size();
for (int i2 = 0; i2 < size; i2++) {
X509Certificate x509Certificate = (X509Certificate) list.get(i2);
int size2 = a.size();
int i3 = 0;
Object obj = null;
Object obj2 = null;
while (i3 < size2) {
C6564b c6564b = (C6564b) a.get(i3);
if (c6564b.f20054c.equals("sha256/")) {
if (obj == null) {
obj = C6565k.m22763b(x509Certificate);
}
if (c6564b.f20055d.equals(obj)) {
return;
}
} else if (c6564b.f20054c.equals("sha1/")) {
if (obj2 == null) {
obj2 = C6565k.m22762a(x509Certificate);
}
if (c6564b.f20055d.equals(obj2)) {
return;
}
} else {
throw new AssertionError();
}
Object obj3 = obj;
i3++;
obj2 = obj2;
obj = obj3;
}
}
StringBuilder append = new StringBuilder().append("Certificate pinning failure!").append("\n Peer certificate chain:");
int size3 = list.size();
for (i = 0; i < size3; i++) {
Certificate certificate = (X509Certificate) list.get(i);
append.append("\n ").append(C6565k.m22761a(certificate)).append(": ").append(certificate.getSubjectDN().getName());
}
append.append("\n Pinned certificates for ").append(str).append(":");
size3 = a.size();
for (i = 0; i < size3; i++) {
append.append("\n ").append((C6564b) a.get(i));
}
throw new SSLPeerUnverifiedException(append.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment