summary refs log tree commit diff
path: root/synapse/crypto
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-03-21 09:49:41 +0000
committerGitHub <noreply@github.com>2017-03-21 09:49:41 +0000
commit733896e0462872ab07b13aa64e2d32bd9690d886 (patch)
treed1b18c18e7830ea41d50b279ce95bf21ed87ae88 /synapse/crypto
parentMerge pull request #2026 from matrix-org/rav/logcontext_docs (diff)
parentAdd some debug to help diagnose weird federation issue (diff)
downloadsynapse-733896e0462872ab07b13aa64e2d32bd9690d886.tar.xz
Merge pull request #2035 from matrix-org/rav/debug_federation
Add some debug to help diagnose weird federation issue
Diffstat (limited to 'synapse/crypto')
-rw-r--r--synapse/crypto/keyring.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py
index d7211ee9b3..80f27f8c53 100644
--- a/synapse/crypto/keyring.py
+++ b/synapse/crypto/keyring.py
@@ -96,10 +96,11 @@ class Keyring(object):
         verify_requests = []
 
         for server_name, json_object in server_and_json:
-            logger.debug("Verifying for %s", server_name)
 
             key_ids = signature_ids(json_object, server_name)
             if not key_ids:
+                logger.warn("Request from %s: no supported signature keys",
+                            server_name)
                 deferred = defer.fail(SynapseError(
                     400,
                     "Not signed with a supported algorithm",
@@ -108,6 +109,9 @@ class Keyring(object):
             else:
                 deferred = defer.Deferred()
 
+            logger.debug("Verifying for %s with key_ids %s",
+                         server_name, key_ids)
+
             verify_request = VerifyKeyRequest(
                 server_name, key_ids, json_object, deferred
             )
@@ -142,6 +146,9 @@ class Keyring(object):
 
             json_object = verify_request.json_object
 
+            logger.debug("Got key %s %s:%s for server %s, verifying" % (
+                key_id, verify_key.alg, verify_key.version, server_name,
+            ))
             try:
                 verify_signed_json(json_object, server_name, verify_key)
             except: