From 0f8ce0a476223035d63f9e29a5edce8f11bf028b Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 26 Sep 2021 18:57:05 +0200 Subject: [PATCH] Fix PGP/MIME layout in publish response --- easywks/types.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/easywks/types.py b/easywks/types.py index bffdaf9..5bee98d 100644 --- a/easywks/types.py +++ b/easywks/types.py @@ -217,9 +217,8 @@ Encrypt live everybody is. encrypted: PGPMessage = self.key.encrypt(to_encrypt) encrypted |= pgp_sign(self.domain, encrypted) payload = MIMEApplication(str(encrypted), _subtype='octet-stream') - mpenc = MIMEApplication(payload.as_string(policy=default), _subtype='pgp-encrypted') - mpenc['Version'] = '1' - email = MIMEMultipart(_subtype='encrypted', _subparts=[mpenc], policy=default, + mpenc = MIMEApplication('Version: 1\r\n', _subtype='pgp-encrypted') + email = MIMEMultipart(_subtype='encrypted', _subparts=[mpenc, payload], policy=default, protocol='application/pgp-encrypted') email['Subject'] = 'Your key has been published' email['To'] = self.submitter_address