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)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 1 Jul 2022 16:06:43 +0000 (17:06 +0100)
commitaf33c339560af1cb7df62c17330e41024c1cab8a
treeebd8e81378decfb1da23e643378d3c05e2303879
parent8e045df66a723172d7ada900c8115138844d3fb2
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
(cherry picked from commit 9c704d9d46338769a66bfc6c378efeda3c4bd9ec)

Gbp-Pq: Topic from-2.2.16
Gbp-Pq: Name gpg-enable-OpenPGP-export-of-cleartext-keys-with-comments.patch
g10/export.c