Closed Bug 1883855 Opened 4 months ago Closed 29 days ago

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)

Thunderbird 115
defect

Tracking

(thunderbird_esr115 wontfix)

RESOLVED FIXED
128 Branch
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.

./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.

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.

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.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Import of public PGP key (Apple Security) fails without clear error message → Import of public PGP key (Apple Security) fails without clear error message - due to extra empty line with space after the crc line

Only trimming there is apparently not enough. I'll wait for the RNP fix.

Assignee: nobody → mkmelin+mozilla
Attachment #9393559 - Attachment description: WIP: Bug 1883855 - Allow Import of public PGP key where key block has empty line with space after the crc line. r=kaie → Bug 1883855 - Add test for Import of public PGP key where key block has empty line with space after the crc line. r=kaie
Status: NEW → ASSIGNED

JFYI: It was fixed in the rnp v0.17.1 release.

Target Milestone: --- → 128 Branch

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

Status: ASSIGNED → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: