summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTulio Casagrande <tcasagra@thoughtworks.com>2017-01-24 19:01:50 -0200
committerRuben Pollan <meskio@sindominio.net>2017-01-31 09:44:28 +0100
commitf1c9b1aaa9fc1019c8b27162f4778dc2120b6ee3 (patch)
treedf24b7ffa5af889086c8700cbf80dc07e6afaf5d /src
parent6dd47f1d5df4f12c867062c47a40358ef7cb6a7c (diff)
[docs] update parameters and return names
Signed-off-by: Ruben Pollan <meskio@sindominio.net>
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/mail/incoming/service.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/leap/bitmask/mail/incoming/service.py b/src/leap/bitmask/mail/incoming/service.py
index 1213a44..9b8bc3f 100644
--- a/src/leap/bitmask/mail/incoming/service.py
+++ b/src/leap/bitmask/mail/incoming/service.py
@@ -345,7 +345,7 @@ class IncomingMail(Service):
def _process_decrypted_doc(self, doc, data):
"""
- Process a document containing a succesfully decrypted message.
+ Process a document containing a successfully decrypted message.
:param doc: the incoming message
:type doc: SoledadDocument
@@ -643,7 +643,7 @@ class IncomingMail(Service):
return failure
@defer.inlineCallbacks
- def _maybe_extract_keys(self, data_signkey, encrypted_msg, senderAddress,
+ def _maybe_extract_keys(self, data_signkey, origmsg, senderAddress,
encoding):
"""
Retrieve attached keys to the mesage and parse message headers for an
@@ -652,13 +652,19 @@ class IncomingMail(Service):
only urls with https and the same hostname than the email are supported
for security reasons.
- :param msgtuple: a tuple consisting of a SoledadDocument
- instance containing the incoming message
- and data, the json-encoded, decrypted content of the
- incoming message
- :type msgtuple: (SoledadDocument, str)
+ :param data_signkey: a tuple consisting of a decrypted Message and the
+ signing OpenPGPKey if the signature is valid or
+ InvalidSignature or KeyNotFound.
+ :type data_signkey: (Message, OpenPGPKey or InvalidSignature or
+ KeyNotFound)
+ :param origmsg: The original, possibly encrypted message.
+ :type origmsg: Message
+ :param encoding: The encoding of the email message.
+ :type encoding: str
+ :param senderAddress: The email address of the sender of the message.
+ :type senderAddress: str
- :return: A Deferred that will be fired with msgtuple when key
+ :return: A Deferred that will be fired with data_signkey when key
extraction finishes
:rtype: Deferred
"""
@@ -690,7 +696,7 @@ class IncomingMail(Service):
if previous_verify_failed() and key_imported:
logger.info('Decrypting again to verify with new key')
data_signkey = yield self._decrypt_by_content_type(
- encrypted_msg, senderAddress, encoding)
+ origmsg, senderAddress, encoding)
defer.returnValue(data_signkey)
@@ -703,7 +709,8 @@ class IncomingMail(Service):
:param address: email address in the from header
:type address: str
- :return: A Deferred that will be fired when header extraction is done
+ :return: A Deferred that will be fired with a boolean, indicating True
+ if the key was successfully imported, or False otherwise.
:rtype: Deferred
"""
fields = dict([f.strip(' ').split('=') for f in header.split(';')])