From 224d714bdf3bd955154fa52f9d0c9de815c5b37e Mon Sep 17 00:00:00 2001 From: askiiart Date: Fri, 1 Mar 2024 08:36:34 -0600 Subject: [PATCH] i should probably read an rfc or something lol anyways, add support for detached signatures --- gpg-email-helper.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gpg-email-helper.py b/gpg-email-helper.py index ae5d62b..728567b 100644 --- a/gpg-email-helper.py +++ b/gpg-email-helper.py @@ -63,13 +63,21 @@ async def main(log): elif ( email.rfind('-----BEGIN PGP SIGNATURE-----') != -1 and email.rfind('-----END PGP SIGNATURE-----') != -1 - ): + ) or (email.rfind('-----BEGIN PGP MESSAGE-----') != -1 + and email.rfind('-----END PGP MESSAGE-----') != -1): signature = email[ email.rfind('-----BEGIN PGP SIGNATURE-----') : email.rfind( '-----END PGP SIGNATURE-----' ) + 27 ] + if signature == '': + signature = email[ + email.rfind('-----BEGIN PGP MESSAGE-----') : email.rfind( + '-----END PGP MESSAGE-----' + ) + + 25 + ] signature.replace('=3D', '=') try: