summaryrefslogtreecommitdiffstats
path: root/webbrowser
diff options
context:
space:
mode:
authorThomas Groman <tgroman@nuegia.net>2020-04-20 22:50:43 -0700
committerThomas Groman <tgroman@nuegia.net>2020-04-20 22:50:43 -0700
commit6b09b252c8ea277a3f006a319c5d836a18f096ea (patch)
tree129f0e3ed60cd2f384752e4938e7a2e74901a7bd /webbrowser
parent0a8c059e8d8d9ff21dce43a73fab252100d58666 (diff)
downloadwebbrowser-6b09b252c8ea277a3f006a319c5d836a18f096ea.tar
webbrowser-6b09b252c8ea277a3f006a319c5d836a18f096ea.tar.gz
webbrowser-6b09b252c8ea277a3f006a319c5d836a18f096ea.tar.lz
webbrowser-6b09b252c8ea277a3f006a319c5d836a18f096ea.tar.xz
webbrowser-6b09b252c8ea277a3f006a319c5d836a18f096ea.zip
Remove cert9.db and key4.db from profile if they exist.
resolves #1711 (https://github.com/MoonchildProductions/Pale-Moon/issues/1711)
Diffstat (limited to 'webbrowser')
-rw-r--r--webbrowser/components/nsBrowserGlue.js33
1 files changed, 28 insertions, 5 deletions
diff --git a/webbrowser/components/nsBrowserGlue.js b/webbrowser/components/nsBrowserGlue.js
index e8eefa4..b4f7cf1 100644
--- a/webbrowser/components/nsBrowserGlue.js
+++ b/webbrowser/components/nsBrowserGlue.js
@@ -1198,7 +1198,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
- const UI_VERSION = 20;
+ const UI_VERSION = 21;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let currentUIVersion = 0;
try {
@@ -1240,10 +1240,33 @@ BrowserGlue.prototype = {
}
#endif
- if (currentUIVersion < 20) {
- // HPKP change of UI preference; reset enforcement level
- Services.prefs.clearUserPref("security.cert_pinning.eforcement_level");
- }
+if (currentUIVersion < 20) {
+ // HPKP change of UI preference; reset enforcement level
+ Services.prefs.clearUserPref("security.cert_pinning.eforcement_level");
+}
+
+if (currentUIVersion < 21) {
+ //remove key4.db and cert9.db if those files exist
+ // XXX: Remove this code block once we actually start using them.
+ let dsCertFile = Cc["@mozilla.org/file/directory_service;1"]
+ .getService(Ci.nsIProperties)
+ .get("ProfD", Ci.nsIFile);
+ dsKeyFile = dsCertFile.clone();
+ dsCertFile.append("cert9.db");
+ if (dsCertFile.exists()) {
+ try { dsCertFile.remove(false); } catch(e) {}
+ }
+ if ((dsKeyFile.exists()) {
+ try { dsKeyFile.remove(false); } catch(e) {}
+ }
+}
+
+// Clear out dirty storage
+if (this._dirty)
+ this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
+
+delete this._rdf;
+delete this._dataSource;
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);