Ticket #10078: 0003-Bug-10078-clearing-crypto-auth-tokens-removing-own-h.patch

File 0003-Bug-10078-clearing-crypto-auth-tokens-removing-own-h.patch, 2.0 KB (added by gk, 6 years ago)
  • src/chrome/content/torbutton.js

    From ce061efe79ca4993bd1c00d803166a80047e7219 Mon Sep 17 00:00:00 2001
    From: Georg Koppen <g.koppen@jondos.de>
    Date: Thu, 28 Nov 2013 13:15:41 +0100
    Subject: [PATCH] Bug 10078: clearing crypto auth tokens; removing own handling
     of SSL session identifier cache as we get that for free when calling
     logoutAndTeardown()
    
    ---
     src/chrome/content/torbutton.js | 22 ++++++----------------
     1 file changed, 6 insertions(+), 16 deletions(-)
    
    diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
    index fcdc0d8..b47d394 100644
    a b function torbutton_do_new_identity() { 
    14651465
    14661466  torbutton_log(3, "New Identity: Clearing Crypto Tokens");
    14671467
    1468   try {
    1469     // This clears the SSL identifier cache.
    1470     // See https://bugzilla.mozilla.org/show_bug.cgi?id=448747. But bug 683262
    1471     // removes nsIDOMCrypto.logout(). We need to resort to our previous fallback
    1472     // method: switching a proper preference that triggers clearing the SSL
    1473     // identifier cache.
    1474     // See: https://mxr.mozilla.org/comm-esr24/source/mozilla/security/manager/ssl/src/nsNSSComponent.cpp#1625 for the ones being available.
    1475     // secruity.enable_md5_signatures seems to be a good choice as it is still
    1476     // available on trunk.
    1477     m_tb_prefs.setBoolPref("security.enable_md5_signatures", !m_tb_prefs.
    1478                            getBoolPref("security.enable_md5_signatures"));
    1479     m_tb_prefs.setBoolPref("security.enable_md5_signatures", !m_tb_prefs.
    1480                            getBoolPref("security.enable_md5_signatures"));
    1481   } catch(e) {
    1482     torbutton_log(4, "Failed to clear SSL session ids: "+e);
    1483   }
     1468  // Clear all crypto auth tokens. This includes calls to PK11_LogoutAll(),
     1469  // nsNSSComponent::LogoutAuthenticatedPK11() and clearing the SSL session
     1470  // cache.
     1471  let sdr = Components.classes["@mozilla.org/security/sdr;1"].
     1472                       getService(Components.interfaces.nsISecretDecoderRing);
     1473  sdr.logoutAndTeardown();
    14841474
    14851475  // This clears the OCSP cache.
    14861476  //