summaryrefslogtreecommitdiff
path: root/mail/src/leap/mail/incoming
diff options
context:
space:
mode:
Diffstat (limited to 'mail/src/leap/mail/incoming')
-rw-r--r--mail/src/leap/mail/incoming/tests/rfc822.multi-encrypt-signed.message61
-rw-r--r--mail/src/leap/mail/incoming/tests/test_incoming_mail.py8
2 files changed, 64 insertions, 5 deletions
diff --git a/mail/src/leap/mail/incoming/tests/rfc822.multi-encrypt-signed.message b/mail/src/leap/mail/incoming/tests/rfc822.multi-encrypt-signed.message
new file mode 100644
index 0000000..98304f2
--- /dev/null
+++ b/mail/src/leap/mail/incoming/tests/rfc822.multi-encrypt-signed.message
@@ -0,0 +1,61 @@
+Content-Type: multipart/encrypted;
+ boundary="Apple-Mail=_C01A1464-6C43-43BF-8F62-157335B7E25B";
+ protocol="application/pgp-encrypted";
+Subject: Enc signed
+Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
+From: Leap Test Key <leap@leap.se>
+Date: Tue, 24 May 2016 11:47:24 -0300
+Content-Description: OpenPGP encrypted message
+To: leap@leap.se
+
+This is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)
+--Apple-Mail=_C01A1464-6C43-43BF-8F62-157335B7E25B
+Content-Type: application/pgp-encrypted
+Content-Description: PGP/MIME Versions Identification
+
+--Apple-Mail=_C01A1464-6C43-43BF-8F62-157335B7E25B
+Content-Disposition: inline;
+ filename=encrypted.asc
+Content-Type: application/octet-stream;
+ name=encrypted.asc
+Content-Description: OpenPGP encrypted message
+
+-----BEGIN PGP MESSAGE-----
+Version: GnuPG v2
+
+hQIMAyj9aG/xtZOwAQ/9Gft0KmOpgzL6z4wmVlLm2aeAvHolXmxWb7N/ByL/dZ4n
+YZd/GPRj42X3BwUrDEL5aO3Mcp+rqq8ACh9hsZXiau0Q9cs1K7Gr55Y06qLrIjom
+2fLqwLFBxCL2sAX1dvClgStyfsRFk9Y/+5tX+IjWaD8dAoRdxCO8IbUDuYGnaKld
+bB9h0NMfKVddCAvuQvX1Zc1Nx0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+tSYOMO3JG6lbGw77PQ8s2So7xore
+8+FeDFPaaJqh6uhF5LETRSx8x/haZiXLd+WtO7wF8S3+Vz7AJIFIe8MUadZrYwnH
+wfMAktQKbep3iHCeZ5jHYA461AOhnCca2y+GoyHZUDDFwS1pC1RN4lMkafSE1AgH
+cmEcjLYsw1gqT0+DfqrvjbXmMjGgkgnkMybJH7df5TKu36Q0Nqvcbc2XLFkalr5V
+Vk0SScqKYnKL+cJjabqA8rKkeAh22E2FBCpKPqxSS3te2bRb3XBX26bP0LshkJuy
+GPu6LKvwmUn0obPKCnLJvb9ImIGZToXu6Fb/Cd2c3DG1IK5PptQz4f7ZRW98huPO
+2w59Bswwt5q4lQqsMEzVRnIDH45MmnhEUeS4NaxqLTO7eJpMpb4VxT2u/Ac3XWKp
+o2RE6CbqTyJ+n8tY9OwBRMKzdVd9RFAMqMHTzWTAuU4BgW2vT2sHYZdAsX8sktBr
+5mo9P3MqvgdPNpg8+AOB03JlIv0dzrAFWCZxxLLGIIIz0eXsjghHzQ9QjGfr0xFH
+Z79AKDjsoRisWyWCnadS2oM9fdAg4T/h1STnfxc44o7N1+ym7u58ODICFi+Kg8IR
+JBHIp3CK02JLTLd/WFhUVyWgc6l8gn+oBK+r7Dw+FTWhqX2/ZHCO8qKK1ZK3NIMn
+MBcSVvHSnTPtppb+oND5nk38xazVVHnwxNHaIh7g3NxDB4hl5rBhrWsgTNuqDDRU
+w7ufvMYr1AOV+8e92cHCEKPM19nFKEgaBFECEptEObesGI3QZPAESlojzQ3cDeBa
+=tEyc
+-----END PGP MESSAGE-----
+
+--Apple-Mail=_C01A1464-6C43-43BF-8F62-157335B7E25B-- \ No newline at end of file
diff --git a/mail/src/leap/mail/incoming/tests/test_incoming_mail.py b/mail/src/leap/mail/incoming/tests/test_incoming_mail.py
index 8b598f2..09a7e1e 100644
--- a/mail/src/leap/mail/incoming/tests/test_incoming_mail.py
+++ b/mail/src/leap/mail/incoming/tests/test_incoming_mail.py
@@ -39,16 +39,13 @@ from leap.keymanager.errors import KeyAddressMismatch
from leap.mail.adaptors import soledad_indexes as fields
from leap.mail.adaptors.soledad import cleanup_deferred_locks
from leap.mail.adaptors.soledad import SoledadMailAdaptor
-from leap.mail.constants import INBOX_NAME
from leap.mail.mail import MessageCollection
from leap.mail.mailbox_indexer import MailboxIndexer
-from leap.mail.imap.account import IMAPAccount
from leap.mail.incoming.service import IncomingMail
from leap.mail.rfc3156 import MultipartEncrypted, PGPEncrypted
from leap.mail.testing import KeyManagerWithSoledadTestCase
from leap.mail.testing import ADDRESS, ADDRESS_2
-from leap.mail import testing
from leap.soledad.common.document import SoledadDocument
from leap.soledad.common.crypto import (
EncryptionSchemes,
@@ -56,6 +53,8 @@ from leap.soledad.common.crypto import (
ENC_SCHEME_KEY,
)
+HERE = os.path.split(os.path.abspath(__file__))[0]
+
# TODO: add some tests for encrypted, unencrypted, signed and unsgined messages
@@ -330,9 +329,8 @@ subject: independence of cyberspace
return d
def testValidateSignatureFromEncryptedEmailFromAppleMail(self):
- testing_path = os.path.abspath(testing.__path__[0])
enc_signed_file = os.path.join(
- testing_path, 'rfc822.multi-encrypt-signed.message')
+ HERE, 'rfc822.multi-encrypt-signed.message')
self.fetcher._add_verified_signature_header = Mock()
def add_verified_signature_header_called(_):