/**
 * Requires
 *
 */
var prefs = require("sdk/preferences/service");
var ui = require("sdk/ui");
var self = require("sdk/self");

/**
 * Current status
 *
 */
var strictModeDisabled = true;

/**
 * Whitelisted preferences, as a POC I'm using:
 * 1) no 128 bit (except for ECDHE)
 * 2) no RC4
 * 3) no ECDSA
 *
 * This list has been updated for FF 35.0
 *
 */
var whitelist = [
  "security.ssl.require_safe_negotiation",
  "security.ssl.treat_unsafe_negotiation_as_broken",
//  "security.ssl3.ecdhe_ecdsa_aes_128_sha",
  "security.ssl3.rsa_aes_256_sha",
//  "security.ssl3.dhe_rsa_aes_128_sha",
  "security.ssl3.ecdhe_rsa_aes_256_sha",
//  "security.ssl3.rsa_aes_128_sha",
//  "security.ssl3.ecdhe_rsa_rc4_128_sha",
//  "security.ssl3.ecdhe_ecdsa_aes_256_sha",
  "security.ssl3.rsa_des_ede3_sha",
//  "security.ssl3.rsa_rc4_128_sha",
  "security.ssl3.dhe_rsa_aes_256_sha",
//  "security.ssl3.dhe_dss_aes_128_sha",
//  "security.ssl3.ecdhe_rsa_aes_128_sha",
//  "security.ssl3.rsa_rc4_128_md5",
//  "security.ssl3.ecdhe_ecdsa_rc4_128_sha",
  "security.ssl3.ecdhe_rsa_aes_128_gcm_sha256",
//  "security.ssl3.ecdhe_ecdsa_aes_128_gcm_sha256",
];

/**
 * These preferences have been defaulted to "false" by Mozilla.
 * Do not modify them. Left here for reference, mostly.
 *
 * This list has been updated for FF 35.0
 *
 */
//var ignorelist = [
//  "security.ssl3.dhe_dss_aes_256_sha",
//  "security.ssl3.dhe_rsa_camellia_128_sha",
//  "security.ssl3.dhe_rsa_camellia_256_sha",
//  "security.ssl3.dhe_rsa_des_ede3_sha",
//  "security.ssl3.ecdhe_rsa_des_ede3_sha",
//  "security.ssl3.rsa_camellia_128_sha",
//  "security.ssl3.rsa_camellia_256_sha",
//];

/**
 * Toggle all current security.ssl3 preferences.
 *
 */
function toggleAllPreferences() {
  // Get security.ssl3 keys
  var keys = prefs.keys("security.ssl3.");
  // Also concatenate secure renegotiation preferences
  keys = keys.concat(prefs.keys("security.ssl.require_safe_negotiation"));
  keys = keys.concat(prefs.keys("security.ssl.treat_unsafe_negotiation_as_broken"));

  // Flip current status
  strictModeDisabled = !strictModeDisabled;

  // Flip not whitelisted entries
  keys.forEach(flipSinglePreference);
}

/**
 * Toggle a single preference.
 *
 * In default mode, it will reset the preference to its default value.
 * In strict mode, it will flip whitelisted entries to true and everything else
 * to false.
 *
 * @param prefName {String|Object}
 *        the preference to flip
 */
function flipSinglePreference(prefName) {
  // Preference can be modified
  if(strictModeDisabled) {
    // Default mode
    prefs.reset(prefName);
  } else {
    // Strict mode
    prefs.set(prefName, !(whitelist.indexOf(prefName) === -1));
  }
}

/**
 * Return a path to the current button icon.
 *
 */
function getIcon() {
  if(strictModeDisabled) {
    return self.data.url("default-16.png");
  } else {
    return self.data.url("strict-16.png");
  }
}

/**
 * Start in strict mode.
 *
 */
toggleAllPreferences();

/**
 * Display button.
 *
 */
var button = ui.ActionButton({
  id: "strict-ssl3-config",
  label: "Toggle strict security.ssl3 configuration",
  icon: getIcon(),
  onClick: function() {
    toggleAllPreferences();
    this.icon = getIcon();
  }
});

@@ -335,35 +335,37 @@
 updated for FF 3
-5
+8
 .0
+a1
 %0A *%0A */%0Avar whit
@@ -474,1179 +474,207 @@
 n%22,%0A
-//  %22security.ssl3.ecdhe_ecdsa_aes_128_sha%22,%0A  %22security.ssl3.rsa_aes_256_sha%22,%0A//  %22security.ssl3.dhe_rsa_aes_128_sha%22,%0A  %22security.ssl3.ecdhe_rsa_aes_256_sha%22,%0A//  %22security.ssl3.rsa_aes_128_sha%22,%0A//  %22security.ssl3.ecdhe_rsa_rc4_128_sha%22,%0A//  %22security.ssl3.ecdhe_ecdsa_aes_256_sha%22,%0A  %22security.ssl3.rsa_des_ede3_sha%22,%0A//  %22security.ssl3.rsa_rc4_128_sha%22,%0A  %22security.ssl3.dhe_rsa_aes_256_sha%22,%0A//  %22security.ssl3.dhe_dss_aes_128_sha%22,%0A//  %22security.ssl3.ecdhe_rsa_aes_128_sha%22,%0A//  %22security.ssl3.rsa_rc4_128_md5%22,%0A//  %22security.ssl3.ecdhe_ecdsa_rc4_128_sha%22,%0A  %22security.ssl3.ecdhe_rsa_aes_128_gcm_sha256%22,%0A//  %22security.ssl3.ecdhe_ecdsa_aes_128_gcm_sha256%22,%0A%5D;%0A%0A/**%0A * These preferences have been defaulted to %22false%22 by Mozilla.%0A * Do not modify them. Left here for reference, mostly.%0A *%0A * This list has been updated for FF 35.0%0A *%0A */%0A//var ignorelist = %5B%0A//  %22security.ssl3.dhe_dss_aes_256_sha%22,%0A//  %22security.ssl3.dhe_rsa_camellia_128_sha%22,%0A//  %22security.ssl3.dhe_rsa_camellia_256_sha%22,%0A//  %22security.ssl3.dhe_rsa_des_ede3_sha%22,%0A//  %22security.ssl3.ecdhe_rsa_des_ede3_sha%22,%0A//  %22security.ssl3.rsa_camellia_128_sha%22,%0A//  %22security.ssl3.rsa_camellia_256_sha%22,%0A//
+  %22security.ssl3.rsa_aes_256_sha%22,%0A  %22security.ssl3.ecdhe_rsa_aes_256_sha%22,%0A  %22security.ssl3.rsa_des_ede3_sha%22,%0A  %22security.ssl3.dhe_rsa_aes_256_sha%22,%0A  %22security.ssl3.ecdhe_rsa_aes_128_gcm_sha256%22,%0A
 %5D;%0A%0A

Remove commented out ignore list and unused whitelist entries