Sign outgoing PDUs.

This commit is contained in:
Mark Haines 2014-10-16 00:09:48 +01:00
parent 1c445f88f6
commit 66104da10c
9 changed files with 62 additions and 24 deletions

View file

@ -15,6 +15,7 @@
# limitations under the License.
from synapse.federation.units import Pdu
from synapse.api.events.utils import prune_pdu
from syutil.jsonutil import encode_canonical_json
from syutil.base64util import encode_base64, decode_base64
@ -25,8 +26,7 @@ import hashlib
def hash_event_pdu(pdu, hash_algortithm=hashlib.sha256):
hashed = _compute_hash(pdu, hash_algortithm)
hashes[hashed.name] = encode_base64(hashed.digest())
pdu.hashes = hashes
pdu.hashes[hashed.name] = encode_base64(hashed.digest())
return pdu