Closed Bug 1677088 Opened 5 years ago Closed 1 year ago

remove compat.jsm and other basically unused or unneeded former enigmail modules

Categories

(MailNews Core :: Security: OpenPGP, task)

task

Tracking

(thunderbird_esr78 wontfix, thunderbird_esr115 wontfix, thunderbird_esr128 wontfix, thunderbird139 wontfix, thunderbird140 wontfix)

RESOLVED FIXED
89 Branch
Tracking Status
thunderbird_esr78 --- wontfix
thunderbird_esr115 --- wontfix
thunderbird_esr128 --- wontfix
thunderbird139 --- wontfix
thunderbird140 --- wontfix

People

(Reporter: mkmelin, Assigned: mkmelin)

References

(Blocks 1 open bug)

Details

(Keywords: leave-open)

Attachments

(41 external files)

https://searchfox.org/comm-central/rev/47359f1d9b32d1f35c969409511309d8f4762b63/mail/extensions/openpgp/content/modules/compat.jsm

This doesn't seem to do anything useful. All the services can be called directly, and the tree stuff is for old versions of Thunderbird.

Assignee: nobody → mkmelin+mozilla
Summary: remove enigmail compat.jsm → remove compat.jsm and other basically unused former enigmail modules

Replace EnigmailCompat.generateQI with ChromeUtils.generateQI

find mail -type f -not -path ".hg/" -regex ".*.(jsm|js)$" -exec sed -i -E 's/EnigmailCompat.generateQI/ChromeUtils.generateQI/g' {} ;

Delete lazy import lines

find mail -type f -not -path ".hg/" -regex ".*.(jsm|js)$" -exec sed -i -E '/EnigmailCompat: "chrome://openpgp/content/modules/compat.jsm"/d' {} ;

EnigmailCompat.copyFileToMailFolder -> MailServices.copy.CopyFileMessage

+ then manually adjust the arguments

find mail -type f -not -path ".hg/" -regex ".*.(jsm|js)$" -exec sed -i -E 's/EnigmailCompat.copyFileToMailFolder/MailServices.copy.CopyFileMessage/g' {} ;

EnigmailCompat.getUrlFromUriSpec: move this function to EnigmailFuncs, mail/extensions/openpgp/content/modules/funcs.jsm

find mail -type f -not -path ".hg/" -regex ".*.(jsm|js)$" -exec sed -i -E 's/EnigmailCompat.getUrlFromUriSpec/EnigmailFuncs.getUrlFromUriSpec/g' {} ;

EnigmailCompat.getExistingFolder -> MailUtils.getExistingFolder

find mail -type f -not -path ".hg/" -regex ".*.(jsm|js)$" -exec sed -i -E 's/EnigmailCompat.getExistingFolder/MailUtils.getExistingFolder/g' {} ;

getTreeCompatibleFuncs: manually change to operate on the tree and not on the functs (which just wrapped the functions)

FeedUtils had copy of the same functionality. Perhaps the function should be moved somewhere else, but we're not even hooking up the keyserver atm so it's for the moment unused code.

Status: NEW → ASSIGNED
Keywords: leave-open
Target Milestone: --- → 89 Branch
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/9dfed969aa03 remove unused socks5Proxy.jsm. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/bff7b0d79ad4 remove enigmail compat.jsm. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/003725015964 remove xhrUtils.jsm. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/429e8371e786 remove unused mail/extensions/openpgp/content/modules/addrbook.jsm. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/b99806ebe6dc remove unused mail/extensions/openpgp/content/modules/autoSetup.jsm. r=PatrickBrunschwig
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/170bd65d2093 remove unused mail/extensions/openpgp/content/modules/configBackup.jsm. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/9978d549ed99 remove mail/extensions/openpgp/content/modules/configure.jsm which doesn't do anything. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/1cf448c6e178 remove mail/extensions/openpgp/content/modules/app.jsm. r=PatrickBrunschwig

We're not using anything from the enigmail.properties file, since everything was converted to Fluent.
Inlining the strings now so we know what they were, in case some of them are needed in the future.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/3cae048e6dfb remove EngimailLocale - mail/extensions/openpgp/content/modules/locale.jsm. r=PatrickBrunschwig
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/41ef5743e159 clean out most of the globals from enigmailCommon.js. r=PatrickBrunschwig
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/f0174708d594 remove EnigmailPrefs. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/d417ebc52419 remove EnigmailTime. r=PatrickBrunschwig
Summary: remove compat.jsm and other basically unused former enigmail modules → remove compat.jsm and other basically unused or unneeded former enigmail modules
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/f5c2785a9c8c remove EngmailOS. r=PatrickBrunschwig

I assume this was used for something more at some point in the past. At the moment, it doesn't appear to do much.
Nothing was every pushed to createdURIs.

For the buggy exchange message, it appears we always just display blank now until we can decrypt. The message that (maybe?) was intended to show, I don't see ever getting accessed.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/cb7f881249d4 remove EnigmailProtocolHandler. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/9a5cb3c312a4 remove EnigmailRNG (rng.jsm). r=PatrickBrunschwig
Regressions: 1706918
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/5b21121bd4bb remove unused EnigmailDialog.longAlert. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/41c84577b76f remove EnigmailDialog.promptValue. r=PatrickBrunschwig

Remove temp dir handling (temp dir must always exist), and also a few other methods never used anymore.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/46e8fd271da4 remove EngimailFiles tempdir handling. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/83bf1a13c865 remove EnigmailCommandLine. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/1e6945cf19f2 clean out unused things from EnigmailCore.jsm. r=PatrickBrunschwig
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/2cf27c5269cc remove EnigmailStdlib. r=PatrickBrunschwig

Only use in uncommented code...

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/56660aed4ff5 remove EnigmailAttachment. r=PatrickBrunschwig

This makes the cases that were already in async contexts use normal async/await instead,
and makes some easy-to-convert functions to async as well.

Remaining cases are harder and may each require more work.

It's possible Thunderbird should also have some functionality to remind about expiring keys, but I don't think this would be it.
I don't understand why the recommendation has been to create a new key. Wouldn't it be better to extend the validity?

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/a3092558b8b8 use the Clipboard API instead of EnigmailClipboard. r=PatrickBrunschwig
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/efac1b46face remove unused EnigmailKeyUsability. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/872c8a9e3b02 remove the "easy" cases of capi.sync() calls from openpgp code. r=PatrickBrunschwig

Inlined and slight cleaned up into the one uncommnented (and very broken) use case...

Removing EnigmailFiles required making more functions async, so fixing it rippled a bit.

Making things async changed some timings slightly, which caused some test failures.
I located and fixed a few such problems, where async methods were not properly awaited.

Depends on D133947

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/f1af77be5c05 remove EnigmailSend. r=PatrickBrunschwig https://hg.mozilla.org/comm-central/rev/d7dc20e53bb8 convert EnigmailFiles to using IOUtils. r=PatrickBrunschwig

Removed the whenDoneDB param and made proper use of the functions being async instead.
Fixes some minor buggy behavior as well.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/ad7f3cd2911e fix KeyLookupHelper async functionality. r=PatrickBrunschwig
Regressions: 1748918
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/332dc778c1ce remove pointless comment. rs=me
Regressions: 1763258
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/27993795da6f remove unused EnigmailGgp. r=PatrickBrunschwig
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/5d8d79df8659 remove/inline enigmailMsgComposeHelper.js. r=PatrickBrunschwig

(In reply to Magnus Melin [:mkmelin] from comment #40)

Created attachment 9255584 [details]
Bug 1677088 - convert EnigmailFiles to using IOUtils. r=PatrickBrunschwig

This patch introduced (at least) regression bug 1778509.

Code that previously used binary file reading, and that expected to handle binary files, was converted to use readUTF8.

Regressions: 1778509
Regressions: 1780123

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/1a1d2a8fd6ff
Remove some dead code in EnigmailMime. r=kaie

Depends on D191956

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/645b84e9cf2e
Remove unused and not fully implemented EnigmailWks. r=kaie
https://hg.mozilla.org/comm-central/rev/4178e8e2e920
Remove EnigmailWksMimeHandler. r=kaie

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/2ecf0c43aaab follow-up, remove webKey and wksMimeHandler references. rs=bustage-fix

I don't think this ever worked in Thunderbird. Doesn't work now at least. If I set it up so it should work, finishCryptoEncapsulation still errors out so sending fails.
Seems very little point keeping this code around.

Depends on D196607

Used once, in unused code. For a case I'm not sure we should ask the user if we can shoot their foot...

Depends on D196608

Replace with normal alert. No reason OpenPGP code should be all special around this.
More than a few of these would seem like they should have been alerts anyway.

Depends on D196609

grep -rEl "(lazy.)?EnigmailDialog.alert\(.+, .+\)" --exclude-dir=.hg --exclude-dir=suite --exclude-dir=rust --include="*.js" --include="*.jsm" --exclude=".*" . | xargs xargs sed -i -E 's/(lazy.)?EnigmailDialog.alert\(([^,]+), ([^,]+)\)/Services.prompt.alert(\2, null, \3)/g'
  • fixup of the multiline ones by hand.

Depends on D196611

Depends on D196612

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/18aec38c7877 remove unused EnigmailDialog.alertPref. r=aleca https://hg.mozilla.org/comm-central/rev/b3b0cf32afb2 remove EnigmailDialog.getPromptSvc(). r=aleca
Attachment #9368986 - Attachment description: Bug 1677088 - Remove EnigmailDialog.confirmDlg. r=#thunderbird-reviewers → Bug 1677088 - Remove EnigmailDialog.confirmDlg. r=aleca
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/866e2f8e68d5 remove EnigmailDialog.confirmBoolPref and last caller: (dysfunctional) encrypt to news. r=kaie
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/fad8b09da1ff Remove EnigmailDialog.confirmIntPref. r=aleca

(In reply to Magnus Melin [:mkmelin] from comment #60)

Created attachment 9368983 [details]

Used once, in unused code. For a case I'm not sure we should ask the user if we can shoot their foot...

The dialog is superfluous for MIME-PGP anyway. However, it could become relevant again as soon as Bug 1602481 is implemented again.

Kai Engert what do you think?

Flags: needinfo?(kaie)
See Also: → 1602481
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/3f6e6309fd54 Remove EnigmailDialog.info. r=aleca
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/bb05631954a0 Remove EnigmailDialog.alert. r=aleca
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/559471c3c1b0 Remove EnigmailDialog.confirmDlg. r=aleca
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/4ab32edc743e Remove EnigmailDialog.filePicker. r=aleca

(In reply to Alfred Peters [:infofrommozilla] from comment #68)

(In reply to Magnus Melin [:mkmelin] from comment #60)

Created attachment 9368983 [details]

Used once, in unused code. For a case I'm not sure we should ask the user if we can shoot their foot...

The dialog is superfluous for MIME-PGP anyway. However, it could become relevant again as soon as Bug 1602481 is implemented again.

Kai Engert what do you think?

I don't intend to introduce any prompts or interaction for bug 1602481, I don't need this dialog.

Flags: needinfo?(kaie)

The fix for bug 1602481 further removes old code, including some of the code you have touched here.

Regressions: 1891689

Further work in other bugs. Closing this.

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: