Closed Bug 1690387 Opened 3 years ago Closed 3 years ago

Attempting to import a secret key with no account identities set up causes: TypeError: can't access property "email", gIdentity is null

Categories

(MailNews Core :: Security: OpenPGP, defect)

defect

Tracking

(thunderbird_esr78+ fixed, thunderbird86+ affected)

RESOLVED FIXED
87 Branch
Tracking Status
thunderbird_esr78 + fixed
thunderbird86 + affected

People

(Reporter: lasana, Assigned: lasana)

References

Details

Attachments

(1 file)

This happens when I click the "Import Secret Key(s) from File" menu entry. The error is thrown here:

https://searchfox.org/comm-central/source/mail/extensions/openpgp/content/ui/keyWizard.js#185

A consequence of this error is that the sub-dialog shows the "wizardStart" section instead of the "wizardImportKey" section.

So my question now is, should we bother to fix this or should the key manager be disabled if there are no configured identities?

Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(alessandro)

The key manager should be enabled regardless of whether we have identities. People may want to use that so that they can import keys to configure identities to use them. And also handling of other people's keys.

Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(alessandro)

I'm not sure about this as I'm not acquainted with the technical requirements of an OpenPGP secret key.
Does the secret key need to be attached/associated to an identity in order to work?
Do we even allow that? (I don't think we currently do)

I think we should fix it if it's an expected behavior or something that other software can do.
Maybe Kai has more insights on this.

Flags: needinfo?(kaie)

Keys are just keys. They can be associated to an identity or not. The key can be used to decrypt even if it's not associated with an identity. This could be fairly common: e.g. an old key you have, and you're decrypting old mails - but the key is not associated to anything.

Flags: needinfo?(kaie)
Summary: Attempting to import a secret key with now account identities set up causes: TypeError: can't access property "email", gIdentity is null → Attempting to import a secret key with no account identities set up causes: TypeError: can't access property "email", gIdentity is null
Assignee: nobody → lasana
See Also: → 1656391
Attached patch bug1690387.patchSplinter Review

This changes the window title update to only happen if the menu has a selected item.

Attachment #9201509 - Flags: review?(alessandro)
Status: NEW → ASSIGNED
Comment on attachment 9201509 [details] [diff] [review]
bug1690387.patch

Review of attachment 9201509 [details] [diff] [review]:
-----------------------------------------------------------------

Yup, this does it, thanks!
Attachment #9201509 - Flags: review?(alessandro) → review+
Target Milestone: --- → 87 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/3867cee7853f
Do not update identity email in key generation dialog if no identity set. r=aleca

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

Comment on attachment 9201509 [details] [diff] [review]
bug1690387.patch

[Approval Request Comment]
User impact if declined: user confusion is importing keys under certain conditions.
Testing completed (on c-c, etc.): beta
Risk to taking this patch (and alternatives if risky): low risk

Attachment #9201509 - Flags: approval-comm-esr78?

Comment on attachment 9201509 [details] [diff] [review]
bug1690387.patch

[Triage Comment]
Approved for esr78

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

Attachment

General

Creator:
Created:
Updated:
Size: