aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ08nY2017-08-23 22:55:44 +0200
committerJ08nY2017-08-23 22:55:44 +0200
commit77c2dc1feed19224e1884250341873b88444a041 (patch)
tree0664cbe28ff4ae1f651e2a3ce76856bbcbf2fd4d
parent70ce42462124c6638ae3e14fda7a763f5aa48b2e (diff)
downloadmailman-pgp-77c2dc1feed19224e1884250341873b88444a041.tar.gz
mailman-pgp-77c2dc1feed19224e1884250341873b88444a041.tar.zst
mailman-pgp-77c2dc1feed19224e1884250341873b88444a041.zip
-rw-r--r--src/mailman_pgp/pgp/mime_multisig.py18
-rw-r--r--src/mailman_pgp/pgp/tests/test_wrapper.py3
2 files changed, 11 insertions, 10 deletions
diff --git a/src/mailman_pgp/pgp/mime_multisig.py b/src/mailman_pgp/pgp/mime_multisig.py
index 1dbb73c..fb06cad 100644
--- a/src/mailman_pgp/pgp/mime_multisig.py
+++ b/src/mailman_pgp/pgp/mime_multisig.py
@@ -170,15 +170,15 @@ class MIMEMultiSigWrapper(MIMEWrapper):
self.msg.set_param('micalg', micalg)
second_part = MIMEMultipart()
for signature in decrypted.signatures:
- sig_part = MIMEApplication(_data=str(signature),
- _subtype=MIMEWrapper._signature_subtype,
- _encoder=encode_7or8bit,
- name='signature.asc')
- sig_part.add_header('Content-Description',
- 'OpenPGP digital signature')
- sig_part.add_header('Content-Disposition', 'attachment',
- filename='signature.asc')
- second_part.attach(sig_part)
+ sig = MIMEApplication(_data=str(signature),
+ _subtype=MIMEWrapper._signature_subtype,
+ _encoder=encode_7or8bit,
+ name='signature.asc')
+ sig.add_header('Content-Description',
+ 'OpenPGP digital signature')
+ sig.add_header('Content-Disposition', 'attachment',
+ filename='signature.asc')
+ second_part.attach(sig)
self.msg.attach(second_part)
else:
# result should be
diff --git a/src/mailman_pgp/pgp/tests/test_wrapper.py b/src/mailman_pgp/pgp/tests/test_wrapper.py
index b49eece..9d5a383 100644
--- a/src/mailman_pgp/pgp/tests/test_wrapper.py
+++ b/src/mailman_pgp/pgp/tests/test_wrapper.py
@@ -243,4 +243,5 @@ class TestPGPWrapper(PGPWrapperTestCase):
PGPWrapper(self.msg)
for wrap_class in (InlineWrapper, MIMEWrapper, MIMEMultiSigWrapper):
PGPWrapper(self.msg, default=wrap_class)
- self.assertRaises(ValueError, PGPWrapper, self.msg, default='Not a class')
+ self.assertRaises(ValueError, PGPWrapper, self.msg,
+ default='Not a class')