gpg: enable OpenPGP export of cleartext keys with comments
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 14 May 2019 01:22:38 +0000 (21:22 -0400)
committerWerner Koch <wk@gnupg.org>
Wed, 15 May 2019 07:02:31 +0000 (09:02 +0200)
commit392e59a3d487e174edcea570e69a0f946c55a19a
treef500be94293592a67a758c8f139523cfbbf26761
parenta4be077abdbf286e3dcdeb0553ba0e74b7e2df5f
gpg: enable OpenPGP export of cleartext keys with comments

* g10/export.c (cleartext_secret_key_to_openpgp): ignore trailing
sublists in private-key S-expression.

--

When gpg-agent learns about a private key from its ssh-agent
interface, it stores its S-expression with the comment attached.  The
export mechanism for OpenPGP keys already in cleartext was too brittle
because it would choke on these comments.  This change lets it ignore
any additional trailing sublists.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gnupg-Bug-Id: 4490
g10/export.c