Closed Bug 2011199 Opened 10 months ago Closed 5 months ago

Importing OpenPGP Keys when opening a message takes very long and blocks the UI for users who have imported many keys

Categories

(MailNews Core :: Security: OpenPGP, defect)

Thunderbird 140
defect

Tracking

(thunderbird_esr140 wontfix, thunderbird152 wontfix)

RESOLVED FIXED
153 Branch
Tracking Status
thunderbird_esr140 --- wontfix
thunderbird152 --- wontfix

People

(Reporter: steffen.rath, Assigned: marion.knopp)

References

Details

Attachments

(2 files, 2 external files)

Steps to reproduce:

Seen on Thunderbird 140.x and later on Linux but we assume other operating systems and earlier versions are affected as well. This affects users who have a large number of imported PGP keys (tested with 1000-3000). When such a user receives an email which contains attached PGP keys (either as attachment or as part of the autocrypt header), they are automatically imported which triggers multiple reloads of all imported keys. This takes multiple seconds during which the UI becomes unresponsive (similar behavior to bug 1742578). The non-responsiveness appears to coincide with the function commonProcessAttachedKey which takes care of importing the attached keys. The behavior also occurs for encrypted messages but can be a little harder to observe there since the non-responsiveness happens with a slight delay in this case.

  1. Thunderbird IMAP account with PGP encryption enabled (private key imported and selected) and about 1000 imported public PGP keys.
  2. Two messages in a folder (e.g., Inbox):
    a. A non-encrypted message which contains a known (e.g., accepted) PGP key in its autocrypt header and as attachment (as can be produced by sending a PGP signed email from Thunderbird with default settings). We used an ed25519 key for this.
    b. A reference email not containing any PGP keys.
  3. In the 3-pane message list, select the message with the attached keys.
  4. Wait until the message is displayed.
  5. Click on the reference message and observe the selection. Sometimes it is necessary to wait a little before clicking to see the bug occur.

Actual results:

  • The displayed message does not change for several seconds (With multiple attached keys, this becomes even longer), i.e., the UI does not respond to the click.
  • After import of the keys via commonProcessAttachedKey has finished (as observed in the profiler) the displayed message changes as expected.

Expected results:

The displayed message should change immediately, i.e. the UI should be responsive.

Attached file repr_example.eml —

Example of an email containing OpenPGP keys that can be used to reproduce the bug. In order for the bug to occur the attached keys must be known to the instance under test.

We are currently working on two different patches to address this issue:

  • Making the import of keys from received emails optional via the config editor (defaulting to existing behavior)
  • Avoiding redundant imports of keys and the associated cache invalidations
Assignee: nobody → marion.knopp
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Component: Security → Security: OpenPGP
Product: Thunderbird → MailNews Core
Depends on: 2046883

should we move the second patch to another bug? it seems that will take more time to get done

Attachment #9539675 - Attachment description: Bug 2011199 - Skip redundant key imports and use cache more. r=KaiE → Bug 2011199 - Skip redundant key imports and use cache more. r=KaiE,mkmelin

Pushed by corey@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/404a8aa8da5c
Skip redundant key imports and use cache more. r=KaiE,mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch

(In reply to Kai Engert [:KaiE:] from comment #5)

should we move the second patch to another bug? it seems that will take more time to get done

Hi! Very happy to see the patch got accepted. Can one already say when it will be part of a release? In my opinion there is no need for the second patch anymore: we mainly created it as an alternative offer that felt more lightweight.

This is now available in Daily. Around next Tuesday the first v153 beta will be available (and final v153 release around a month later).

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

This is now available in Daily. Around next Tuesday the first v153 beta will be available (and final v153 release around a month later).

Thanks! Will this also be included in the ESR release at some point?

Not in 140. v153 is the next ESR though

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: