[Pkg-privacy-commits] [xul-ext-monkeysphere] 291/296: Fix monkeysphere xul-ext for firefox 23 and 24

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository xul-ext-monkeysphere.

commit d52046febf88ba2e4d1d4c5a8125db41ac3193e9
Author: Kristian Fiskerstrand <kf at kfwebs.net>
Date:   Fri Sep 20 01:08:11 2013 -0400

    Fix monkeysphere xul-ext for firefox 23 and 24
    
    Kristian notes:
    
    private browsing mode is no longer global, so a per-window operation
    has to be used. I did not implement this due to missing window
    argument, but code is added in comment that should be able to do so
    with reference if the window argument is present.
    
    cert.verifyForUsage is not existant, so will have to be updated.
---
 modules/monkeysphere.jsm | 59 +++++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 31 deletions(-)

diff --git a/modules/monkeysphere.jsm b/modules/monkeysphere.jsm
index 8a7c3cd..a06a096 100644
--- a/modules/monkeysphere.jsm
+++ b/modules/monkeysphere.jsm
@@ -270,9 +270,25 @@ var getInvalidCertSSLStatus = function(uri) {
     if (!certDB)
        return null;
 
-    var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
+    var privateBrowsingEnabled = false;
+
+    if(typeof Components.classes["@mozilla.org/security/privatebrowsing;1"]
+             !== "undefined")
+    {
+        var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
              .getService(Components.interfaces.nsIPrivateBrowsingService);
-     recentCertsService = certDB.getRecentBadCerts(pbs.privateBrowsingEnabled);
+        privateBrowsingEnabled = pbs.privateBrowsingEnabled;
+    }
+    else
+    {
+        // Support the per-window based private mode
+        // https://developer.mozilla.org/EN/docs/Supporting_per-window_private_browsing
+        // This needs the window argument passed down, for now disabling private mode
+        //Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+        //privateBrowsingEnabled = PrivateBrowsingUtils.isWindowPrivate(window);
+        privateBrowsingEnabled = false;
+    }
+    recentCertsService = certDB.getRecentBadCerts(privateBrowsingEnabled);
   } else {
      // they updated firefox method to get certs again
      log("error: No way to get invalid cert status!");
@@ -300,35 +316,16 @@ var printCertInfo = function(cert) {
   const Ci = Components.interfaces;
 
   log("certificate:");
-  switch (cert.verifyForUsage(Ci.nsIX509Cert.CERT_USAGE_SSLServer)) {
-    case Ci.nsIX509Cert.VERIFIED_OK:
-      log("  SSL status: OK");
-      break;
-    case Ci.nsIX509Cert.NOT_VERIFIED_UNKNOWN:
-      log("  SSL status: not verfied/unknown");
-      break;
-    case Ci.nsIX509Cert.CERT_REVOKED:
-      log("  SSL status: revoked");
-      break;
-    case Ci.nsIX509Cert.CERT_EXPIRED:
-      log("  SSL status: expired");
-      break;
-    case Ci.nsIX509Cert.CERT_NOT_TRUSTED:
-      log("  SSL status: not trusted");
-      break;
-    case Ci.nsIX509Cert.ISSUER_NOT_TRUSTED:
-      log("  SSL status: issuer not trusted");
-      break;
-    case Ci.nsIX509Cert.ISSUER_UNKNOWN:
-      log("  SSL status: issuer unknown");
-      break;
-    case Ci.nsIX509Cert.INVALID_CA:
-      log("  SSL status: invalid CA");
-      break;
-    default:
-      log("  SSL status: unexpected failure");
-      break;
-  }
+
+  if(cert.isDomainMismatch)
+      log("SSL Status: Domain mismatch");
+
+  if(cert.isNotValidAtThisTime)
+      log("SSL Status: Not valid at this time");
+
+  if(cert.isUntrusted)
+      log("SSL Status: Untrusted");
+
   log("  Common Name: " + cert.commonName);
   log("  Organisation: " + cert.organization);
   log("  Issuer: " + cert.issuerOrganization);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/xul-ext-monkeysphere.git



More information about the Pkg-privacy-commits mailing list