Closed Bug 1751885 Opened 3 years ago Closed 3 years ago

Multiple fixes for updating/searching OpenPGP keys from online sources

Categories

(MailNews Core :: Security: OpenPGP, enhancement)

enhancement

Tracking

(thunderbird_esr91+ affected)

RESOLVED FIXED
100 Branch
Tracking Status
thunderbird_esr91 + affected

People

(Reporter: KaiE, Assigned: KaiE)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 4 obsolete files)

Today, when doing an online search for OpenPGP keys, for keys that we already had previously imported (same fingerprint), we prompt the user, asking to import (and also offering the choice to accept).

We should use the same behavior here when processing email attachments.

If a found key was previously imported (same fingerprint), we should automatically import it (no prompt).

This will enable us to process extended lifetime and revocations, there's no question, we must import those.

Status: NEW → ASSIGNED

I'm extending the scope of this bug, because of code overlap. See duplicates (soon).

Summary: When searching for updated keys, auto refresh keys that we already have imported (same fingerprint) → Multiple fixes for updating/searching OpenPGP keys from online sources

To summarize what this should fix:

  • auto import keys found online, if we already have the key (same fingerprint) imported, without asking.
  • always search both WKD and keyserver, because one of both might be outdated
  • we should search the keyserver by fingerprint to discover revocation or extended validity (which might be old keys, while a search by email gives us a different key)

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

  • we should search the keyserver by fingerprint to discover revocation or extended validity (which might be old keys, while a search by email gives us a different key)

This also requires the fix from bug 1634524.
That's a very small change, so let's just move that code in here, too.

(In reply to Kai Engert (:KaiE:) from comment #6)

This also requires the fix from bug 1634524.
That's a very small change, so let's just move that code in here, too.

I take that back. That one might be a candidate for backporting, so let's keep it separate.

Attachment #9260803 - Attachment is obsolete: true

IMHO we should consider backporting this work to the stable esr91 branch. I'm already running a backported patch locally. I think it's an important usability improvement, with little risk.

Attached patch 1751885-esr91-v1.patch (obsolete) (deleted) — Splinter Review
Attached patch 1751885-esr91-v2.patch (obsolete) (deleted) — Splinter Review
Attachment #9262236 - Attachment is obsolete: true
Blocks: 1753446

The current patch has insufficient handling for WKD, which may contain multiple keys in the single blob of data we receive.

We need to do the following:

  • split the blob into individual keys, which will allow us to handle keys differently
    (currently, it's only offer/import all or none, or auto-import all or none,
    this simplification was added temporarily for a code/UI experiment)
  • for all keys that we already have (same fingerprint),
    automatically update them (silently).
  • ignore keys that are revoked/expired and which we don't have yet
  • offer the remaining good keys for import

I've updated the revision in phab, it implements the functionality I've described in comment 12.

Attached patch 1751885-esr91-multi-wkd.patch (obsolete) (deleted) — Splinter Review

additional pieces backported to esr91

Attached patch 1751885-esr91-v3.patch (deleted) — Splinter Review

esr91 backport merged into single patch
(The backport excludes the silent import mechanism.)

Attachment #9263086 - Attachment is obsolete: true
Attachment #9263493 - Attachment is obsolete: true
Attachment #9261086 - Attachment description: WIP: Bug 1751885 - Update existing OpenPGP keys without asking. Search both WKD and keyserver during discovery, also by key ID. → Bug 1751885 - Update existing OpenPGP keys without asking. Search both WKD and keyserver during discovery, also by key ID. r=mkmelin

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/f1400a5a846d
Update existing OpenPGP keys without asking. Search both WKD and keyserver during discovery, also by key ID. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

Comment on attachment 9263495 [details] [diff] [review]
1751885-esr91-v3.patch

[Approval Request Comment]
Regression caused by (bug #): no
User impact if declined: it's more painful to obtain keys
Testing completed (on c-c, etc.): yes
Risk to taking this patch (and alternatives if risky): This is new functionality, so there's some risk for new effects. But I think the improved functionality is worth it.

Attachment #9263495 - Flags: approval-comm-esr91?

Comment on attachment 9263495 [details] [diff] [review]
1751885-esr91-v3.patch

[Triage Comment]
Approved for esr91

Attachment #9263495 - Flags: approval-comm-esr91? → approval-comm-esr91+

I just noticed this is not yet on beta. Is that OK with you?

Flags: needinfo?(kaie)

(In reply to Wayne Mery (:wsmwk) from comment #20)

I just noticed this is not yet on beta. Is that OK with you?

No. Thanks for pointing that out. It needs beta testing.

Flags: needinfo?(kaie)
Attachment #9263495 - Flags: approval-comm-esr91+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: