Ticket #28493: 0001-Don-t-manage-Enigmail-protected-headers-aka.-Memory-.patch

File 0001-Don-t-manage-Enigmail-protected-headers-aka.-Memory-.patch, 5.2 KB (added by intrigeri, 10 months ago)
  • chrome/content/preferences.js

    From 27ce7c9396d7498323e452474fde5e9c01712479 Mon Sep 17 00:00:00 2001
    From: intrigeri <intrigeri@boum.org>
    Date: Tue, 8 Jan 2019 11:40:35 +0000
    Subject: [PATCH] Don't manage Enigmail protected headers (aka. Memory Hole)
     prefs.
    
    Enigmail 2.x now prompts the user wrt. whether this pref should be enabled, so
    they get to choose. Enigmail 2.x also provides UI to toggle this feature on/off
    later on (which wasn't the case when such UI was added to Torbirdy). So there's
    no strong reason why Torbirdy should add yet another place where this Enigmail
    pref can be configured.
    
    Additionally, the corresponding pref was renamed and its type changed in
    Enigmail 2.x. It seems that Torbirdy was not updated accordingly.
    Unmaintained code is problematic in itself but worse, the resulting UX will be
    confusing if one tries to use the Torbirdy settings to toggle this option.
    
    Closes: https://trac.torproject.org/projects/tor/ticket/28493
    ---
     chrome/content/preferences.js  | 23 -----------------------
     chrome/content/preferences.xul |  1 -
     components/torbirdy.js         |  6 ------
     3 files changed, 30 deletions(-)
    
    diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js
    index a5d21d5..3e5c8fc 100644
    a b if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() { 
    367367      pub.prefs.setBoolPref(enigmailConfirmPref, false);
    368368      pub.prefs.setBoolPref(pub.prefBranch + 'enigmail.confirmemail', false);
    369369    }
    370 
    371     // Protected email headers - default: true
    372     var enigmailProtectedPref = "extensions.enigmail.protectHeaders";
    373     if (pub.enigmailProtected.checked) {
    374       pub.setPreferences(enigmailProtectedPref, false);
    375     } else {
    376       pub.setPreferences(enigmailProtectedPref, true);
    377     }
    378370  };
    379371
    380372  /*
    if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() { 
    399391    pub.enigmailKeyId = document.getElementById('torbirdy-enigmail-throwkeyid');
    400392    pub.enigmailKeyserver = document.getElementById('torbirdy-enigmail-keyserver');
    401393    pub.enigmailConfirmEmail = document.getElementById('torbirdy-confirm-email');
    402     pub.enigmailProtected = document.getElementById('torbirdy-enigmail-protected');
    403394
    404395    // Make sure the user really wants to change these settings.
    405396    var warnPrompt = pub.prefs.getBoolPref("extensions.torbirdy.warn");
    if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() { 
    503494      pub.enigmailConfirmEmail.checked = false;
    504495    }
    505496
    506     // Protected email headers - default: true
    507     var protectedPref = pub.customBranch + 'extensions.enigmail.protectHeaders';
    508     if (pub.prefs.prefHasUserValue(protectedPref)) {
    509       var protectedPrefValue = pub.prefs.getBoolPref(protectedPref);
    510     } else {
    511       var protectedPrefValue = pub.prefs.getBoolPref('extensions.enigmail.protectHeaders');
    512     }
    513     if (protectedPrefValue) {
    514       pub.enigmailProtected.checked = false;
    515     } else {
    516       pub.enigmailProtected.checked = true;
    517     }
    518 
    519497    // Keyserver.
    520498    var enigmailKeyserver = pub.customBranch + 'extensions.enigmail.keyserver';
    521499    if (pub.prefs.prefHasUserValue(enigmailKeyserver)) {
    if (!org.torbirdy.prefs) org.torbirdy.prefs = new function() { 
    575553    pub.anonService.selectedIndex = 0;
    576554    pub.enigmailKeyId.checked = false;
    577555    pub.enigmailConfirmEmail.checked = false;
    578     pub.enigmailProtected.checked = false;
    579556    pub.emailWizard.checked = false;
    580557    pub.imapIdle.checked = false;
    581558    pub.startupFolder.checked = false;
  • chrome/content/preferences.xul

    diff --git a/chrome/content/preferences.xul b/chrome/content/preferences.xul
    index 296f220..4eb8002 100644
    a b  
    136136          <vbox>
    137137            <checkbox accesskey="&torbirdy.prefs.confirmemail.key;" id="torbirdy-confirm-email" label="&torbirdy.prefs.confirmemail.label;"/>
    138138            <checkbox accesskey="&torbirdy.prefs.enigmail_throwkeyid.key;" id="torbirdy-enigmail-throwkeyid" label="&torbirdy.prefs.enigmail_throwkeyid.label;"/>
    139             <checkbox accesskey="&torbirdy.prefs.enigmail_protected.key;" id="torbirdy-enigmail-protected" label="&torbirdy.prefs.enigmail_protected.label;"/>
    140139            <separator class="thin" orient="horizontal"/>
    141140            <vbox>
    142141              <label accesskey="&torbirdy.prefs.enigmail.keyserver.key;" control="torbirdy-enigmail-keyserver" value="&torbirdy.prefs.enigmail.keyserver.label;"/>
  • components/torbirdy.js

    diff --git a/components/torbirdy.js b/components/torbirdy.js
    index 077b218..5e343c7 100644
    a b var TorBirdyPrefs = { 
    281281  "extensions.enigmail.keyserver": "hkp://jirk5u4osbsr34t5.onion",
    282282  // Force GnuPG to use SHA512.
    283283  "extensions.enigmail.mimeHashAlgorithm": 5,
    284   // Use encrypted email headers in Enigmail (Memory Hole standard)
    285   // See https://bugs.torproject.org/21880 for the discussion as to why we are
    286   // setting this in TorBirdy.  This preference is enabled by default but can
    287   // be turned off (disabled) in TorBirdy's preferences if desired.
    288   "extensions.enigmail.protectHeaders": true,
    289   "extensions.enigmail.protectedSubjectText": "Encrypted Message",
    290284
    291285  /*
    292286    Chat and Calendar