Import of public PGP key (Apple Security) fails without clear error message - due to extra empty line with space after the crc line
Categories
(MailNews Core :: Security: OpenPGP, defect)
Tracking
(thunderbird_esr115 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr115 | --- | wontfix |
People
(Reporter: r0bcas7, Assigned: mkmelin)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0
Steps to reproduce:
I want to import the Apple Security PGP key from https://support.apple.com/en-us/HT201214
I copied the key and used the "Import keys from clipboard" menu. This resulted in the message "Can’t read public key file."
I saved the key in a file and used the "Import public keys from file" menu. This resulted in the message "Importing the keys failed"
I am running "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:115.0) Gecko/20100101 Thunderbird/115.8.1"
Actual results:
I copied the key and used the "Import keys from clipboard" menu. This resulted in the message "Can’t read public key file." and one message in the error log: "rnp_import_keys failed with rv: 301989888 RNP.jsm:2584:15"
I saved the key in a file and used the "Import public keys from file" menu. This resulted in the message "Importing the keys failed" and a message in the error log: "rnp_import_keys failed with rv: 301989888 RNP.jsm:2584:15"
Expected results:
Thunderbird should have imported the public key.
The same key imports fine in GnuPG.
Assignee | ||
Comment 1•7 months ago
|
||
./rnpkeys --homedir=/tmp/rnphome --import-keys ~/tmp/apple-key.txt
[armor_parse_headers() /builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-armor.cpp:751] Warning: no empty line after the base64 headers
[armored_src_read() /builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-armor.cpp:428] wrong armor trailer
[process_pgp_key_auto() /builds/worker/checkouts/gecko/comm/third_party/rnp/src/librepgp/stream-key.cpp:341] wrong key tag: -1 at pos 0
failed to import key(s) from /home/magnus/tmp/apple-gpgkey.txt, stopping.
Import finished: 0 keys processed, 0 new public keys, 0 new secret keys, 0 updated, 0 unchanged.
Comment 2•7 months ago
•
|
||
The problem is in extra empty line with space after the crc line ( one with text =ZF7h).
Removing that extra line fixes the issue, however we would also relax this check on the RNP side.
Reporter | ||
Comment 3•7 months ago
|
||
Ok, removing the extra space made it possible to import the key.
It would be nice if Thunderbird would either provide the more helpful error message of the rnpkeys tool or be more relaxed with the ascii armor format like gnupg is.
Assignee | ||
Comment 4•7 months ago
|
||
Probably adding trim() here should help: https://searchfox.org/comm-central/rev/1468a002a723439d0a85756e036320b76000a010/mail/extensions/openpgp/content/modules/RNP.jsm#2566,2569
Updated•7 months ago
|
Assignee | ||
Comment 5•6 months ago
|
||
Assignee | ||
Comment 6•6 months ago
|
||
Only trimming there is apparently not enough. I'll wait for the RNP fix.
Updated•5 months ago
|
Comment 7•5 months ago
|
||
JFYI: It was fixed in the rnp v0.17.1 release.
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Updated•5 months ago
|
Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/b615fc82fe5c
Add test for Import of public PGP key where key block has empty line with space after the crc line. r=kaie
Description
•