summary refs log tree commit diff
path: root/synapse/util/third_party_invites.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-10-16 14:54:54 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-10-16 14:54:54 +0100
commitb8dd5b1a2d76f0426c600ae19ea9d9612e5327dc (patch)
tree6766c6b4ddbf74eb04b673ad3ad5c5edd4cf2a17 /synapse/util/third_party_invites.py
parentUse non-placeholder name for endpoint (diff)
downloadsynapse-b8dd5b1a2d76f0426c600ae19ea9d9612e5327dc.tar.xz
Verify third party ID server certificates
Diffstat (limited to 'synapse/util/third_party_invites.py')
-rw-r--r--synapse/util/third_party_invites.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/util/third_party_invites.py b/synapse/util/third_party_invites.py
index 41e597d5b9..335a9755b2 100644
--- a/synapse/util/third_party_invites.py
+++ b/synapse/util/third_party_invites.py
@@ -63,7 +63,7 @@ def check_key_valid(http_client, event):
             event.content["third_party_invite"]["key_validity_url"],
             {"public_key": event.content["third_party_invite"]["public_key"]}
         )
-        if not response["valid"]:
-            raise AuthError(403, "Third party certificate was invalid")
-    except IOError:
+    except Exception:
         raise AuthError(502, "Third party certificate could not be checked")
+    if "valid" not in response or not response["valid"]:
+        raise AuthError(403, "Third party certificate was invalid")