From 9487a90c318b3908212e0a4aacc19dce3e2e5e6f Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 28 Feb 2024 09:21:59 -0600 Subject: [PATCH] add supported for pgp public keys attached as quoted-printable --- gpg-email-helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gpg-email-helper.py b/gpg-email-helper.py index a2839b5..46a0d12 100644 --- a/gpg-email-helper.py +++ b/gpg-email-helper.py @@ -21,6 +21,7 @@ with open(f'{XDG_DATA_HOME}/gpg-email-helper/log', 'a') as log: if email.rfind('-----BEGIN PGP PUBLIC KEY BLOCK-----') != -1 and email.rfind('-----END PGP PUBLIC KEY BLOCK-----') != -1: public_key = email[email.rfind( '-----BEGIN PGP PUBLIC KEY BLOCK-----'):email.rfind('-----END PGP PUBLIC KEY BLOCK-----')+35] + public_key = public_key.replace('=3D', '=') # quoted-printable attachments have the equals sign escaped as =3D apparently log.write( f'Attempted to import key from email: {gpg.Context(armor=True).key_import(public_key.encode())}\n')