Bug 521263 Use a different way of logging the Master Password out r=IanN a=KaiRo COMM_1_9_1_BASE
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 22 Oct 2009 11:35:40 +0100
changeset 4216 ad433d192a3d3a542fccab61ed8dbbe997f3430e
parent 4215 a6535d21f9ef356a099e600652ebd1edbe010473
child 4217 ba87fbcd914268cf6add45ab56e043c4f2f012dd
push idunknown
push userunknown
push dateunknown
reviewersIanN, KaiRo
bugs521263
Bug 521263 Use a different way of logging the Master Password out r=IanN a=KaiRo
suite/common/tasksOverlay.js
suite/modules/Sanitizer.jsm
--- a/suite/common/tasksOverlay.js
+++ b/suite/common/tasksOverlay.js
@@ -57,19 +57,20 @@ function toPasswordManager()
 function ExpirePassword()
 {
   // Queries the HTTP Auth Manager and clears all sessions
   Components.classes['@mozilla.org/network/http-auth-manager;1']
             .getService(Components.interfaces.nsIHttpAuthManager)
             .clearAll();
 
   // Expires the master password
-  Components.classes["@mozilla.org/security/sdr;1"]
-            .getService(Components.interfaces.nsISecretDecoderRing)
-            .logoutAndTeardown();
+  Components.classes["@mozilla.org/security/pk11tokendb;1"]
+            .createInstance(Components.interfaces.nsIPK11TokenDB)
+            .getInternalKeyToken()
+            .checkPassword("");
 }
 
 function toDownloadManager()
 {
   //Ported extensions may only implement the Basic toolkit Interface
   //and not our progress dialogs.
   var dlUI = Components.classes["@mozilla.org/download-manager-ui;1"]
                        .getService(Components.interfaces.nsIDownloadManagerUI);
--- a/suite/modules/Sanitizer.jsm
+++ b/suite/modules/Sanitizer.jsm
@@ -259,19 +259,20 @@ var Sanitizer = {
         var count = pwmgr.countLogins("", "", ""); // count all logins
         return (count > 0);
       }
     },
 
     sessions: {
       clear: function() {
         // clear all auth tokens
-        var sdr = Components.classes["@mozilla.org/security/sdr;1"]
-                            .getService(Components.interfaces.nsISecretDecoderRing);
-        sdr.logoutAndTeardown();
+        Components.classes["@mozilla.org/security/pk11tokendb;1"]
+                  .createInstance(Components.interfaces.nsIPK11TokenDB)
+                  .getInternalKeyToken()
+                  .checkPassword("");
 
         // clear plain HTTP auth sessions
         var authMgr = Components.classes["@mozilla.org/network/http-auth-manager;1"]
                                 .getService(Components.interfaces.nsIHttpAuthManager);
         authMgr.clearAll();
       },
 
       canClear: true