diff options
author | Erik Johnston <erik@matrix.org> | 2015-06-24 13:04:37 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-06-24 13:04:37 +0100 |
commit | ec6ceadeeb861e26c905248fa96091bce4c392a4 (patch) | |
tree | 3597cc9d566b6dd163ce0bffc85346d28fcc6e43 | |
parent | Fix up process_v2_response (diff) | |
download | synapse-ec6ceadeeb861e26c905248fa96091bce4c392a4.tar.xz |
Only fail individular deferred for invalid signature
-rw-r--r-- | synapse/crypto/keyring.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py index a35e93f279..2cfec39851 100644 --- a/synapse/crypto/keyring.py +++ b/synapse/crypto/keyring.py @@ -64,20 +64,21 @@ class Keyring(object): group_ids = [] next_group_id = 0 + deferreds = {} for server_name, json_object in server_and_json: logger.debug("Verifying for %s", server_name) + group_id = next_group_id + next_group_id += 1 + group_ids.append(group_id) + key_ids = signature_ids(json_object, server_name) if not key_ids: - raise SynapseError( + deferreds[group_id] = defer.fail(SynapseError( 400, "Not signed with a supported algorithm", Codes.UNAUTHORIZED, - ) - - group_id = next_group_id - next_group_id += 1 - group_ids.append(group_id) + )) group = KeyGroup(server_name, group_id, key_ids) @@ -124,9 +125,9 @@ class Keyring(object): Codes.UNAUTHORIZED, ) - deferreds = self.get_server_verify_keys( + deferreds.update(self.get_server_verify_keys( group_id_to_group - ) + )) logger.info( "Deferred count: %d vs. %d", |