[Pkg-privacy-commits] [xul-ext-monkeysphere] 287/296: xul-ext-monkeysphere: update validation method for firefox 20
Ximin Luo
infinity0 at moszumanska.debian.org
Mon Aug 24 07:39:49 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 387b8ce3ce0337a6fb35dd9dd0022acfa2c84d4a
Author: James Bottomley <James.Bottomley at HansenPartnership.com>
Date: Wed May 22 13:09:34 2013 +0400
xul-ext-monkeysphere: update validation method for firefox 20
Firefox 20 changed the way you retrieve invalid certificates:
https://developer.mozilla.org/en-US/docs/Updating_addons_broken_by_private_browsing_changes
So update the getInvalidCertSSLStatus() method to detect whether we're running
in FireFox20 and use the new method
Signed-off-by: James Bottomley <JBottomley at Parallels.com>
---
modules/monkeysphere.jsm | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/modules/monkeysphere.jsm b/modules/monkeysphere.jsm
index cd03ff9..8a7c3cd 100644
--- a/modules/monkeysphere.jsm
+++ b/modules/monkeysphere.jsm
@@ -257,8 +257,27 @@ var getInvalidCert = function(uri) {
// gets current ssl status info
// http://www.oxymoronical.com/experiments/apidocs/interface/nsIRecentBadCertsService
var getInvalidCertSSLStatus = function(uri) {
- var recentCertsService =
+ var recentCertsService
+ if (typeof Components.classes["@mozilla.org/security/recentbadcerts;1"]
+ !== "undefined") {
+ recentCertsService =
Components.classes["@mozilla.org/security/recentbadcerts;1"].getService(Components.interfaces.nsIRecentBadCertsService);
+ } else if (typeof Components.classes["@mozilla.org/security/x509certdb;1"]
+ !== "undefined") {
+ // new method for firefox 20
+ var certDB = Components.classes["@mozilla.org/security/x509certdb;1"]
+ .getService(Components.interfaces.nsIX509CertDB);
+ if (!certDB)
+ return null;
+
+ var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
+ .getService(Components.interfaces.nsIPrivateBrowsingService);
+ recentCertsService = certDB.getRecentBadCerts(pbs.privateBrowsingEnabled);
+ } else {
+ // they updated firefox method to get certs again
+ log("error: No way to get invalid cert status!");
+ recentCertsService = null;
+ }
if (!recentCertsService)
return null;
--
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