[tor-commits] [torbutton/master] Bug #2777: Clear OCSP cache on toggle.

mikeperry at torproject.org mikeperry at torproject.org
Fri Apr 1 23:43:03 UTC 2011


commit 77193828ed6d4ab7749bb61b10df4bf628155ecd
Author: Mike Perry <mikeperry-git at fscked.org>
Date:   Fri Apr 1 16:38:51 2011 -0700

    Bug #2777: Clear OCSP cache on toggle.
    
    We do this by toggling the pref.
---
 src/chrome/content/torbutton.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 5170be1..5d0a564 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1579,6 +1579,16 @@ function torbutton_update_status(mode, force_update) {
           !m_tb_prefs.getBoolPref("security.enable_ssl2"));
     }
 
+    // This clears the OCSP cache.
+    //
+    // nsNSSComponent::Observe() watches security.OCSP.enabled, which calls
+    // setOCSPOptions(), which if set to 0, calls CERT_DisableOCSPChecking(),
+    // which calls CERT_ClearOCSPCache().
+    // See: http://mxr.mozilla.org/security/source/security/manager/ssl/src/nsNSSComponent.cpp
+    var ocsp = m_tb_prefs.getIntPref("security.OCSP.enabled");
+    m_tb_prefs.setIntPref("security.OCSP.enabled", 0);
+    m_tb_prefs.setIntPref("security.OCSP.enabled", ocsp);
+
     // This clears the undo tab history.
     var tabs = m_tb_prefs.getIntPref("browser.sessionstore.max_tabs_undo");
     m_tb_prefs.setIntPref("browser.sessionstore.max_tabs_undo", 0);



More information about the tor-commits mailing list