mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 11:55:20 +01:00
Scan+score
This commit is contained in:
@@ -41,7 +41,6 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.net.InetAddress;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateEncodingException;
|
||||
import java.security.cert.CertificateException;
|
||||
@@ -217,31 +216,6 @@ public class EntityCertificate {
|
||||
return result;
|
||||
}
|
||||
|
||||
static String getSimilarDnsName(X509Certificate certificate, @NonNull String host) {
|
||||
if (certificate == null)
|
||||
return null;
|
||||
|
||||
try {
|
||||
InetAddress haddr = InetAddress.getByName(host);
|
||||
List<String> names = getDnsNames(certificate);
|
||||
for (String _name : names)
|
||||
try {
|
||||
String name = (_name.startsWith("*.") ? _name.substring(2) : _name);
|
||||
InetAddress naddr = InetAddress.getByName(name);
|
||||
Log.i("host=" + host + " name=" + _name + "" +
|
||||
" haddr=" + haddr + " naddr=" + naddr);
|
||||
if (haddr.equals(naddr))
|
||||
return name;
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static boolean matches(String server, List<String> names) {
|
||||
for (String name : names)
|
||||
if (matches(server, name)) {
|
||||
|
||||
Reference in New Issue
Block a user