From c6a03c46e644061155587c141e75f44dc028ed75 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 19 May 2015 10:23:02 +0100 Subject: [PATCH] SYN-383: Extract the response list from 'server_keys' in the response JSON as it might work better than iterating over the top level dict --- synapse/crypto/keyring.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py index a859872ce2..c7e47f6bf9 100644 --- a/synapse/crypto/keyring.py +++ b/synapse/crypto/keyring.py @@ -188,7 +188,7 @@ class Keyring(object): # TODO(mark): Set the minimum_valid_until_ts to that needed by # the events being validated or the current time if validating # an incoming request. - responses = yield self.client.post_json( + query_response = yield self.client.post_json( destination=perspective_name, path=b"/_matrix/key/v2/query", data={ @@ -204,6 +204,8 @@ class Keyring(object): keys = {} + responses = query_response["server_keys"] + for response in responses: if (u"signatures" not in response or perspective_name not in response[u"signatures"]):