[geary/mjog/991-gcr-critical: 2/2] Application.CertificateManager: Warn when GCR not able to access stores




commit 0475d29f84ef13861fdc5ee2e747c00644c002fc
Author: Michael Gratton <mike vee net>
Date:   Fri Sep 25 08:27:36 2020 +1000

    Application.CertificateManager: Warn when GCR not able to access stores
    
    At least let people know somehow their GCR setup is lacking.

 .../application/application-certificate-manager.vala       | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/client/application/application-certificate-manager.vala 
b/src/client/application/application-certificate-manager.vala
index d9e40fcd0..3add22065 100644
--- a/src/client/application/application-certificate-manager.vala
+++ b/src/client/application/application-certificate-manager.vala
@@ -68,7 +68,13 @@ public class Application.CertificateManager : GLib.Object {
                 !Geary.String.is_empty(Gcr.pkcs11_get_trust_store_uri()) &&
                 Gcr.pkcs11_get_trust_lookup_uris().length > 0
             );
-            debug("GCR slot URIs found: %s", has_uris.to_string());
+            if (has_uris) {
+                debug("GCR slot URIs found: %s", has_uris.to_string());
+            } else {
+                warning(
+                    "No GCR slot URIs found, GCR certificate pinning unavailable"
+                );
+            }
         }
 
         bool has_rw_store = false;
@@ -77,6 +83,12 @@ public class Application.CertificateManager : GLib.Object {
             if (store != null) {
                 has_rw_store = !store.has_flags(CKF_WRITE_PROTECTED);
                 debug("GCR store is R/W: %s", has_rw_store.to_string());
+            } else {
+                warning("No GCR store found, GCR certificate pinning unavailable");
+            }
+
+            if (!has_rw_store) {
+                warning("GCR store is not RW, GCR certificate pinning unavailable");
             }
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]