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>
Thu, 22 Aug 2019 19:11:59 +0000 (20:11 +0100)
commit27c7de33d49d146e96b79e8af4c75bf0036a666e
treea0307b519385fed6c751b43e438081dbe7fa44b0
parent3ff4f28eb50ccbed12a62f35cbdeed7008e2b3df
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