1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 10:47:28 +00:00

BIMI: check root domain certificate

This commit is contained in:
M66B 2022-06-07 07:39:41 +02:00
parent e9eadcc8ac
commit 8700031bbb

View file

@ -222,9 +222,11 @@ public class Bimi {
// Check subject
boolean found = false;
String root = UriHelper.getRootDomain(context, domain);
List<String> names = EntityCertificate.getDnsNames(cert);
for (String name : names)
if (domain.endsWith(name.toLowerCase(Locale.ROOT))) {
if (root != null &&
root.equalsIgnoreCase(UriHelper.getRootDomain(context, name))) {
found = true;
break;
}