From e5751f365fc6b210fbc5c16f1e3dccacf8612b0e Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 24 May 2020 12:44:59 +0200 Subject: [PATCH] Simplified cert debugging --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index ceaf2e9604..990ac4144b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -5613,8 +5613,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. cpv.validate(path.getCertPath(), params); List pcerts = new ArrayList<>(); - pcerts.add(cert); - for (Certificate c : pcerts) + for (Certificate c : path.getCertPath().getCertificates()) if (c instanceof X509Certificate) pcerts.add((X509Certificate) c); if (path instanceof PKIXCertPathValidatorResult) { @@ -5956,9 +5955,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. boolean selfSigned = cert.getIssuerX500Principal().equals(cert.getSubjectX500Principal()); EntityCertificate record = EntityCertificate.from(cert, null); trace.add(record.subject + - " (" + cert.getIssuerX500Principal() + ")" + + " (" + (selfSigned ? "selfSigned" : cert.getIssuerX500Principal()) + ")" + (keyCertSign ? " (keyCertSign)" : "") + - (selfSigned ? " (selfSigned)" : "") + (ks != null && ks.getCertificateAlias(cert) != null ? " (Android)" : "")); } catch (Throwable ex) { Log.e(ex);