Bug 93656

Summary: OpenPGP armored public key *.key is identified as Apple Keynote
Product: shared-mime-info Reporter: intrigeri
Component: freedesktop.org.xmlAssignee: Shared Mime Info group <shared_mime_info>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: intrigeri, lamby
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: suggested patch
suggested patch

Description intrigeri 2016-01-10 17:15:37 UTC
Presumably since https://bugs.freedesktop.org/show_bug.cgi?id=71827 was resolved in 1.3, any OpenPGP armored public key (e.g. exported with "gpg --armor --export $KEY_ID" is recognized as application/x-iwork-keynote-sffkey.

The ideal behavior IMO would be that the "BEGIN PGP PUBLIC KEY BLOCK" magic has precedence over the .key file extension.
Comment 1 Dwayne Litzenberger 2018-04-01 02:58:39 UTC
Created attachment 138470 [details] [review]
suggested patch

Feel free to modify and apply as needed; I'm probably not going to follow up beyond this.

(In case you have trouble applying the full patch; note that tests/test-garbage.key is just a file populated with junk from /dev/urandom)
Comment 2 Dwayne Litzenberger 2018-04-01 02:59:35 UTC
(I'm not a maintainer of shared-mime-info.)
Comment 3 intrigeri 2018-05-07 12:14:00 UTC
Thanks Dwayne for proposing a patch! What's the next step here? Would it help if I tested whether Dwayne's patch fixes the problem I've reported?
Comment 4 Bastien Nocera 2018-05-09 09:43:55 UTC
Comment on attachment 138470 [details] [review]
suggested patch

Review of attachment 138470 [details] [review]:
-----------------------------------------------------------------

::: tests/list
@@ +643,4 @@
>  test-public-key.asc application/pgp-keys xoo
>  test-secret-key.skr application/pgp-keys ooo
>  test-secret-key.asc application/pgp-keys xoo
> +# files named *.key shouldn't be detected as Apple Keynote

They should, you set up the glob to that effect. Maybe the comment doesn't match what you want here.
Comment 5 Chris Lamb 2018-07-27 12:00:46 UTC
Created attachment 140852 [details] [review]
suggested patch

Updated patch attached.
Comment 6 Chris Lamb 2018-08-03 00:34:06 UTC
Gentle ping on this? :)
Comment 7 Chris Lamb 2018-08-17 07:39:51 UTC
Just wondering what else might needed on my end for this?
Comment 8 GitLab Migration User 2018-10-13 10:38:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/39.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.