From 46ab2976848d4cce77522d796f68493da5859ed3 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 6 Mar 2024 13:16:45 +0100 Subject: gpg: use export-minimal when attaching public key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depending on how many signatures the public key has, it may be very large. The key signatures are not required to verify the authenticity of an email. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCZKDO3ETIOAI.1DDOYI8Z8LY5O%40cepl.eu%3E Reported-by: Matěj Cepl Signed-off-by: Robin Jarry Tested-by: Matěj Cepl --- lib/crypto/gpg/gpgbin/keys.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crypto/gpg/gpgbin/keys.go b/lib/crypto/gpg/gpgbin/keys.go index ca166e9d..93f48210 100644 --- a/lib/crypto/gpg/gpgbin/keys.go +++ b/lib/crypto/gpg/gpgbin/keys.go @@ -30,7 +30,8 @@ func GetKeyId(s string) (string, error) { // ExportPublicKey exports the public key identified by k in armor format func ExportPublicKey(k string) (io.Reader, error) { - cmd := exec.Command("gpg", "--export", "--armor", k) + cmd := exec.Command("gpg", "--armor", + "--export-options", "export-minimal", "--export", k) var outbuf bytes.Buffer var stderr strings.Builder -- cgit v1.2.3-54-g00ecf