Closed Bug 1795698 Opened 3 years ago Closed 3 years ago

Failure to import OpenPGP secret keys, if public key, with additional public subkey, is already present

Categories

(MailNews Core :: Security: OpenPGP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102+ fixed, thunderbird107 fixed)

RESOLVED FIXED
108 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird107 --- fixed

People

(Reporter: KaiE, Assigned: KaiE)

Details

Attachments

(2 files)

Use GnuPG to create an advanced key.
In addition to the default [SC] and [E] keys, add another [E] key, as a result you have two [E] subkeys.

(In the test scenario, additional subkeys for [S] and [A] were added, but that probably doesn't matter.)

Export the PUBLIC key from GnuPG, store it as pubkey-1.asc

Import pubkey-1.asc into Thunderbird.

Go back to GnuPG, and use --edit-key, then delete the older [E] subkey.

(In the test scenario, in addition another used ID was added, but that probably doesn't matter.)

Export the SECRET key from GnuPG, store it as seckey-2.asc

Import seckey-2.asc as a secret key into Thunderbird.

Result: An exception is reported:

Error: rnp_key_get_protection_type failed
isSecretKeyMaterialAvailable chrome://openpgp/content/modules/RNPLib.jsm:393
protectKeyWithSubKeys chrome://openpgp/content/modules/RNPLib.jsm:468
_importKeyBlockWithAutoAccept chrome://openpgp/content/modules/RNP.jsm:2295

The bug is in the Thunderbird code, which makes wrong assumptions about the combination of public keys and secret keys that are possible.

Assignee: nobody → kaie
Status: NEW → ASSIGNED
Attachment #9298854 - Attachment description: Bug 1795698 - When importing secret OpenPGP key, don't assume secret keys for all subkeys are available. r=mkmelin → Bug 1795698 - When protecting a secret OpenPGP key, don't assume secret keys for all subkeys are available. r=mkmelin

The second patch adds a test.

Patch and test work on both comm-central and comm-esr102.

Version: unspecified → Thunderbird 102

Comment on attachment 9298854 [details]
Bug 1795698 - When protecting a secret OpenPGP key, don't assume secret keys for all subkeys are available. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): no
User impact if declined: Some advanced users of GnuPG cannot use their existing key with Thunderbird
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): low risk

Attachment #9298854 - Flags: approval-comm-beta?
Attachment #9299878 - Flags: approval-comm-beta?

This should be safe for 102.5.0, too.

Target Milestone: --- → 108 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/d7a504dc269e
When protecting a secret OpenPGP key, don't assume secret keys for all subkeys are available. r=mkmelin
https://hg.mozilla.org/comm-central/rev/a2eb61ecd28e
Test importing secret key with existing additional public subkey. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9298854 [details]
Bug 1795698 - When protecting a secret OpenPGP key, don't assume secret keys for all subkeys are available. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9298854 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9299878 [details]
Bug 1795698 - Test importing secret key with existing additional public subkey. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9299878 - Flags: approval-comm-beta? → approval-comm-beta+

Should get uplifted to esr102 in two weeks

Attachment #9298854 - Flags: approval-comm-esr102?

Comment on attachment 9298854 [details]
Bug 1795698 - When protecting a secret OpenPGP key, don't assume secret keys for all subkeys are available. r=mkmelin

[Triage Comment]
Approved for esr102

Attachment #9298854 - Flags: approval-comm-esr102? → approval-comm-esr102+

Comment on attachment 9299878 [details]
Bug 1795698 - Test importing secret key with existing additional public subkey. r=mkmelin

[Triage Comment]
Approved for esr102

Attachment #9299878 - Flags: approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: