Closed Bug 1814893 Opened 3 years ago Closed 2 years ago

Remove unnecessary informational console log messages from OpenPGP code

Categories

(MailNews Core :: Security: OpenPGP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr115 wontfix, thunderbird126 verified)

VERIFIED FIXED
126 Branch
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird126 --- verified

People

(Reporter: KaiE, Assigned: mkmelin)

References

(Blocks 1 open bug)

Details

Attachments

(29 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

We have a few leftover console log/debug statements from OpenPGP development, we should remove everything that isn't related to reporting a failure.

In order to remove statements that are purely informational, but keep statements that are useful when diagnosing failures, I suggest:

Use Thunderbird OpenPGP feature, look at the console, and use the logged messages to identify code that can be removed.

Please keep log/debug statements that aren't reached during normal OpenPGP usage.

I suggest to keep the following, and move them to debug:

  • the otr and rnp and gpgme shared libraries that are loaded. Because we are loading them dynamically, and because they could be loaded from the wrong location, I consider it very very useful to be able to ask users to provide this information to developers in failure scenarios.
  • when loading the openpgp secret keyring, we currently print information about how many keys were loaded. We don't need to log that. However, we should continue to log information if any non-encrypted secret keys were found (that's a bad inconsistent state, and users should be able to discover that)
Version: unspecified → Thunderbird 102

Related to this we should rework EnigmailLog to just use logging like other modules does, so that logging is prefixed and can be set to higher level when needed.

Assignee: nobody → mkmelin+mozilla
Blocks: tb-logging

Will have to go through this file by file and clean up.
Much can simply be dropped. The "where am I" statements are not generally useful, but statements on some statuses are.
Production code should not have console.debug. For modules, where debug info is warranted we can add a logger where necessary.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/8fe166095d3c
Clean up PgpMimeHandler.sys.mjs. r=kaie
https://hg.mozilla.org/comm-central/rev/750d169f67ed
clean up MimeTree.sys.mjs. r=kaie
https://hg.mozilla.org/comm-central/rev/1b3bdef8542a
clean up enigmailKeyManager.js. r=kaie

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Much more to be done here.

Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED

This contained mostly junk that was not used.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/d4e6d66ec915 clean up enigmailMessengerOverlay.js. r=kaie https://hg.mozilla.org/comm-central/rev/d4aa74dc993e clean up enigmailMsgHdrViewOverlay.js. r=kaie https://hg.mozilla.org/comm-central/rev/66f9d9e76038 clean up enigmailMsgComposeOverlay.js. r=kaie https://hg.mozilla.org/comm-central/rev/5b696105dc8f Clean up filters.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/c128b2f2b44f Clean up armor.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/8555f96335ed Clean up persistentCrypto.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/acdde191fb28 Clean up mimeEncrypt.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/c10b96ea3e40 Clean up fixExchangeMsg.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/8bed76c89289 Clean up keyserver.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/3433aa6df14e Clean up encryption.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/4b173ca88133 Clean up sqliteDb.sys.mjs. r=kaie
See Also: → 1890632

When changing the way logging works, it's necessary to update the documentation at https://wiki.mozilla.org/Thunderbird:OpenPGP

It should say which versions use the old style logging, it should explain how to use the new style logging and in which version the new style logging works.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/86863b5bcee6 Clean up core.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/9aa17750272e Clean up wkdLookup.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/b60f8dccecec Clean up decryption.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/8a025aa44cac Clean up mimeVerify.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/144df9430204 Clean up RNPCryptoAPI.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/43a9526c42ab Clean up GnuPGCryptoAPI.sys.mjs. r=kaie https://hg.mozilla.org/comm-central/rev/81dbe861d484 Clean up masterpass.sys.mjs. r=kaie
Target Milestone: --- → 126 Branch
Status: ASSIGNED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED

I updated https://wiki.mozilla.org/Thunderbird:OpenPGP#OpenPGP_log "Thunderbird version 126 and up".
Heather, please check if you want to clarify anything there.

We should land the patches from comment 39 on beta as well. After that I can post a message about this change to the e2ee list.

Comment on attachment 9394959 [details]
Bug 1814893 - Clean up uris.sys.mjs. r=kaie

[Approval Request Comment]
User impact if declined: The patches from https://bugzilla.mozilla.org/show_bug.cgi?id=1814893#c39 should land on beta to get a consistent beta logging story.
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): without uplift, there's a mix of old style and new style logging which would be slightly messy.

Attachment #9394959 - Flags: approval-comm-beta?

Comment on attachment 9394959 [details]
Bug 1814893 - Clean up uris.sys.mjs. r=kaie

[Triage Comment]
Approve for beta

User impact if declined: The patches from https://bugzilla.mozilla.org/show_bug.cgi?id=1814893#c39 should land on beta to get a consistent beta logging story.

Flags: needinfo?(rob)
Flags: needinfo?(daniel)
Attachment #9394959 - Flags: approval-comm-beta? → approval-comm-beta+

Hello!

Is there anything QA can do here to verify that this issue is resolved?
If yes, could you please provide us with STR of what to verify?

Thank you in advance!

Flags: needinfo?(kaie)

Not sure this requires verification, but to do it, see the instructions at https://wiki.mozilla.org/Thunderbird:OpenPGP#OpenPGP_log
Then interact with an OpenPGP message and see that logs are logged in the error console.

Flags: needinfo?(kaie)

Thank you for leading me to the OpenPGP_log instructions.

Confirming this issue as verified fixed on macOS 14, Ubuntu 22 and Windows 11 with 126.0b2(20240429201016).

Status: RESOLVED → VERIFIED
Flags: needinfo?(rob)
Flags: needinfo?(daniel)
Regressions: 1908113
Regressions: 1911227
Regressions: 1917577
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: