Closed Bug 1638537 Opened 4 years ago Closed 4 years ago

OpenPGP: import public key fails silently

Categories

(MailNews Core :: Security: OpenPGP, defect)

x86_64
Linux
defect

Tracking

(thunderbird78 fixed)

RESOLVED FIXED
Thunderbird 78.0
Tracking Status
thunderbird78 --- fixed

People

(Reporter: chriechers, Assigned: KaiE)

References

Details

Attachments

(2 files)

TB daily 78.0a1 (2020-05-15) (64-bit), Linux

Trying to import a new public key from an .asc file via OpenPGP Key Management.
An Import prompt pops up. Upon clicking OK the key doesn't get imported. No error message or warning is shown. It fails silently without ever warning the user.

Messages from the error console:

Error: rnp_key_have_secret failed
addKeyAttributes chrome://openpgp/content/modules/RNP.jsm:83
getKeyInfoFromHandle chrome://openpgp/content/modules/RNP.jsm:413
getKeysFromFFI chrome://openpgp/content/modules/RNP.jsm:235
getKeyListFromKeyBlock chrome://openpgp/content/modules/RNP.jsm:1190
getKeyListFromKeyBlock chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm:242
getKeyListFromKeyBlock chrome://openpgp/content/modules/key.jsm:148
getKeyListFromKeyFile chrome://openpgp/content/modules/key.jsm:182
EnigmailCommon_importKeysFromFile chrome://openpgp/content/ui/commonWorkflows.js:69
oncommand chrome://openpgp/content/ui/enigmailKeyManager.xhtml:1
RNP.jsm:246:19

CryptoAPI.sync() failed result: Error: RNP.importToFFI failed
importKeyBlock chrome://openpgp/content/modules/RNP.jsm:1228
importKeyFromFile chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm:111
importKeyFromFile chrome://openpgp/content/modules/keyRing.jsm:354
EnigmailCommon_importKeysFromFile chrome://openpgp/content/ui/commonWorkflows.js:107
oncommand chrome://openpgp/content/ui/enigmailKeyManager.xhtml:1
interface.js:48:17

Uncaught TypeError: can't access property "length", res.importedKeys is undefined
importKeyFromFile chrome://openpgp/content/modules/keyRing.jsm:364
EnigmailCommon_importKeysFromFile chrome://openpgp/content/ui/commonWorkflows.js:107
oncommand chrome://openpgp/content/ui/enigmailKeyManager.xhtml:1
keyRing.jsm:364:9

Component: Security → Security: OpenPGP
Product: Thunderbird → MailNews Core

See also bug 1638194 for similar problems.

Also adds feedback if key discovery yields no results.

Assignee: nobody → kaie
Status: NEW → ASSIGNED

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/f08360126daf
Give feedback on OpenPGP key import failure. r=PatrickBrunschwig

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 78.0

Found another scenario in which we don't give feedback.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/e2a4ff696d51
Follow-up, show error message in additional failure scenario. r=PatrickBrunschwig

Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED

Comment on attachment 9154246 [details]
Bug 1638537 - Follow-up, show error message in additional failure scenario. r=PatrickBrunschwig

openpgp error feedback completeness

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

Comment on attachment 9154246 [details]
Bug 1638537 - Follow-up, show error message in additional failure scenario. r=PatrickBrunschwig

Approved for beta

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

Hi,
I have a .asc file containing a public key. I see that the option for import with open pgp key manager is greyed out. I am using Thunderbird 78.4.0 (64-bit). However I can click on the option to Decrypt and when that happens I get a popup with an message "null". Please let me know if I should create a new bug for this. I have tried the key file on both windows and Mac OS .

(In reply to shabrina.sharmin489 from comment #11)

Hi,
I have a .asc file containing a public key. I see that the option for import with open pgp key manager is greyed out.

It's not clear to which option you're referring. In key manager, the command "file / import public key from file" should never be greyed out.

However I can click on the option to Decrypt

Where do you see an option to decrypt?

Now it sounds like you weren't talking about openpgp key manager. It sounds like you are talking about an email, which had an .asc file attached, and you used the right click menu to open the popup menu, and you saw a menu entry "import openpgp key" which was disabled / greyed out.

This option is enabled, only, if we're certain that the attachment contains a key. We only are certain if the sending email program has indicated a special "type" of attachment (content type: application/pgp-keys).

It sounds like in your scenario we don't see this content type, and therefore disable the command.

You can use the following work around: Right click the attachment, and use Save As to save it to a file. Then open the OpenPGP key manager, and use command "file / import public key from file", and select the file you have saved.

Hope this is the right place to
I have a similar issue, but when importing an attached public key from an email (without using the key management). Most of the time the import fails silently. saving the key to disk and then importing as a file from key management works fine, so the problem is not with the keys.

I am using thunderbird (75.5.0) as a flatpak package and only running it via cli does not produce any outputs. I don't know which keyword is appropriate to get a useful debug log however.

(In reply to usi from comment #13)

Hope this is the right place to
I have a similar issue, but when importing an attached public key from an email (without using the key management). Most of the time the import fails silently. saving the key to disk and then importing as a file from key management works fine, so the problem is not with the keys.

I am using thunderbird (75.5.0) as a flatpak package and only running it via cli does not produce any outputs. I don't know which keyword is appropriate to get a useful debug log however.

I can confirm usi's problems on Windows with TB 78.5.1.

Should we reopen this ticket or file a new one, because it concerns attachments?

usi, Thomas, are you using macOS ?
If yes, it's probably because of regression bug 1680757.

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

usi, Thomas, are you using macOS ?
If yes, it's probably because of regression bug 1680757.

I'm using the flatpak build on manjaro linux.

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

usi, Thomas, are you using macOS ?
If yes, it's probably because of regression bug 1680757.

No, Windows 10 1909.

Saving the attached public key and importing it from within Key Management works fine. It's just when clicking on the attachment and answering the message box that pops up, if TB should import the key, with yes, it will fail.

I also experience silent import failures with Firefox 78.5.1 (64-bit) and with the current Firefox beta (the nightly build does not have this bug) on macOS Bug Sur 11.0.1. But in my case the error console reports a 'TypeError: "x" is not a function' error:

Uncaught (in promise) TypeError: fileObj.exists is not a function
    readFile chrome://openpgp/content/modules/files.jsm:200
    getKeyListFromKeyFile chrome://openpgp/content/modules/key.jsm:188
    importSecretKey chrome://openpgp/content/ui/keyWizard.js:792

Should I open a separate issue for this bug or is this the the right place?

78.6.0 will have to fixes for handling of key attachments, and to key importing.

At this point it is unclear to me if your reports are related to those, or if they are different.

I would like to ask you, please test if your scenarios are fixed with 78.6.0.
If it still doesn't work, please file a new bug report, and describe in detail what exactly you click, and ideally, please provide a copy of the message that contains the attached key.

We usually don't open up old bug reports, because that is confusing for tracking fixes and the versions they are fixed in. If a bug is fixed, and a new problem is found, it's usually a different cause.

With 78.6.0 Thunderbird will no longer try to import the attached public key. Here, on Windows, it opens up the external key management software Kleopatra -- which is not really helpful but at least it no longer pretends to have imported the key.

Ahh: I discovered the import option in the context menu of the attachment, which seems to work now.

78.6.0 fixed the problem for me I had with importing keys (TypeError: fileObj.exists is not a function).

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

Attachment

General

Created:
Updated:
Size: