diff options
| author | J08nY | 2017-06-21 00:17:27 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-21 00:17:27 +0200 |
| commit | 12da4324fe8cddd738c2b2bdb8b0fad81ef89f69 (patch) | |
| tree | e0d8e088668304602c79f2001c343b5550e14ccf /src/mailman_pgp | |
| parent | 1c76a2e1b22298d7664f4a9f04f73b084113b92d (diff) | |
| download | mailman-pgp-12da4324fe8cddd738c2b2bdb8b0fad81ef89f69.tar.gz mailman-pgp-12da4324fe8cddd738c2b2bdb8b0fad81ef89f69.tar.zst mailman-pgp-12da4324fe8cddd738c2b2bdb8b0fad81ef89f69.zip | |
Diffstat (limited to 'src/mailman_pgp')
| -rw-r--r-- | src/mailman_pgp/pgp/inline.py | 2 | ||||
| -rw-r--r-- | src/mailman_pgp/pgp/mime.py | 10 | ||||
| -rw-r--r-- | src/mailman_pgp/runners/incoming.py | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/mailman_pgp/pgp/inline.py b/src/mailman_pgp/pgp/inline.py index 2eb6d43..437e29a 100644 --- a/src/mailman_pgp/pgp/inline.py +++ b/src/mailman_pgp/pgp/inline.py @@ -22,7 +22,7 @@ from pgpy import PGPKey, PGPMessage from pgpy.types import Armorable -class PGPInlineWrapper: +class InlineWrapper: def __init__(self, msg: Message): self.msg = msg diff --git a/src/mailman_pgp/pgp/mime.py b/src/mailman_pgp/pgp/mime.py index a2742f1..5641a34 100644 --- a/src/mailman_pgp/pgp/mime.py +++ b/src/mailman_pgp/pgp/mime.py @@ -22,7 +22,7 @@ from email.utils import collapse_rfc2231_value from pgpy import PGPKey, PGPMessage, PGPSignature -class PGPMIMEWrapper: +class MIMEWrapper: _signed_subtype = 'application/pgp-signature' _encrypted_subtype = 'application/pgp-encrypted' @@ -47,9 +47,9 @@ class PGPMIMEWrapper: content_subtype = self.msg.get_content_subtype() return \ - second_type == PGPMIMEWrapper._signed_subtype and \ + second_type == MIMEWrapper._signed_subtype and \ content_subtype == 'signed' and \ - protocol_param == PGPMIMEWrapper._signed_subtype + protocol_param == MIMEWrapper._signed_subtype def is_encrypted(self): """ @@ -66,10 +66,10 @@ class PGPMIMEWrapper: return \ 'Version: 1' in first_part and \ - first_type == PGPMIMEWrapper._encrypted_subtype and \ + first_type == MIMEWrapper._encrypted_subtype and \ second_type == 'application/octet-stream' and \ content_subtype == 'encrypted' and \ - protocol_param == PGPMIMEWrapper._encrypted_subtype + protocol_param == MIMEWrapper._encrypted_subtype def verify(self, key: PGPKey): """ diff --git a/src/mailman_pgp/runners/incoming.py b/src/mailman_pgp/runners/incoming.py index aae6bda..156cf78 100644 --- a/src/mailman_pgp/runners/incoming.py +++ b/src/mailman_pgp/runners/incoming.py @@ -25,8 +25,8 @@ from public import public from mailman_pgp.config import config from mailman_pgp.model.list import EncryptedMailingList -from mailman_pgp.pgp.inline import PGPInlineWrapper -from mailman_pgp.pgp.mime import PGPMIMEWrapper +from mailman_pgp.pgp.inline import InlineWrapper +from mailman_pgp.pgp.mime import MIMEWrapper @public @@ -43,8 +43,8 @@ class IncomingRunner(Runner): listid=mlist.list_id) return False # Is the message encrypted? - mime = PGPMIMEWrapper(msg) - inline = PGPInlineWrapper(msg) + mime = MIMEWrapper(msg) + inline = InlineWrapper(msg) if mime.is_signed(): # only signed. pass |
