Forego proxying for direct message sending.

This commit is contained in:
Nick Daly 2012-05-10 07:29:24 -05:00
parent 5cc01cc92d
commit e8f6df8d04

View File

@ -339,15 +339,22 @@ class Santiago(object):
in that case, it must be ignored. in that case, it must be ignored.
""" """
request = Unwrapper(str(kwargs["request"]), gpg=self.gpg) request = self.gpg.decrypt(request)
proxied_request = self.verify_sender(request.next()) if not str(request):
encrypted_body = dict(self.verify_client(request.next())) raise InvalidSignatureError()
request_body = dict(self.decrypt_client(request.next()))
if not request.keyid:
# an unsigned or invalid request!
return
request_body = dict(request)
reqeust_body["to"] = self.me
request_body["from"] = request.keyid
return request_body return request_body
def verify_sender(self, request_body): def verify_sender(self, request):
"""Verify the signature of the message's sender. """Verify the signature of the message's sender.
This is part (A) in the message diagram. This is part (A) in the message diagram.