summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-06-17 15:23:20 +0100
committerGitHub <noreply@github.com>2016-06-17 15:23:20 +0100
commit6660f3755856926e8a698c6e2afd0408b544281a (patch)
tree09d1f1beae0ee1eb468431321772680b797a2c32 /synapse
parentMerge pull request #875 from matrix-org/markjh/email_formatting (diff)
parentOnly re-sign our own events (diff)
downloadsynapse-6660f3755856926e8a698c6e2afd0408b544281a.tar.xz
Merge pull request #876 from matrix-org/erikj/sign_own
Only re-sign our own events
Diffstat (limited to 'synapse')
-rw-r--r--synapse/federation/federation_server.py15
-rw-r--r--synapse/handlers/federation.py15
2 files changed, 18 insertions, 12 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index fe92457ba1..2a589524a4 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -193,13 +193,16 @@ class FederationServer(FederationBase):
             )
 
             for event in auth_chain:
-                event.signatures.update(
-                    compute_event_signature(
-                        event,
-                        self.hs.hostname,
-                        self.hs.config.signing_key[0]
+                # We sign these again because there was a bug where we
+                # incorrectly signed things the first time round
+                if self.hs.is_mine_id(event.event_id):
+                    event.signatures.update(
+                        compute_event_signature(
+                            event,
+                            self.hs.hostname,
+                            self.hs.config.signing_key[0]
+                        )
                     )
-                )
         else:
             raise NotImplementedError("Specify an event")
 
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index c2df43e2f6..6c0bc7eafa 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1018,13 +1018,16 @@ class FederationHandler(BaseHandler):
 
             res = results.values()
             for event in res:
-                event.signatures.update(
-                    compute_event_signature(
-                        event,
-                        self.hs.hostname,
-                        self.hs.config.signing_key[0]
+                # We sign these again because there was a bug where we
+                # incorrectly signed things the first time round
+                if self.hs.is_mine_id(event.event_id):
+                    event.signatures.update(
+                        compute_event_signature(
+                            event,
+                            self.hs.hostname,
+                            self.hs.config.signing_key[0]
+                        )
                     )
-                )
 
             defer.returnValue(res)
         else: