mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 06:50:52 +00:00
Add signing host and keyname to signatures
This commit is contained in:
parent
b8dd5b1a2d
commit
c225d63e9e
2 changed files with 10 additions and 6 deletions
|
@ -416,11 +416,15 @@ class Auth(object):
|
||||||
key_validity_url
|
key_validity_url
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
verify_key = nacl.signing.VerifyKey(decode_base64(public_key))
|
for _, signature_block in join_third_party_invite["signatures"].items():
|
||||||
encoded_signature = join_third_party_invite["signature"]
|
for key_name, encoded_signature in signature_block.items():
|
||||||
signature = decode_base64(encoded_signature)
|
if not key_name.startswith("ed25519:"):
|
||||||
verify_key.verify(token, signature)
|
return False
|
||||||
return True
|
verify_key = nacl.signing.VerifyKey(decode_base64(public_key))
|
||||||
|
signature = decode_base64(encoded_signature)
|
||||||
|
verify_key.verify(token, signature)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
except (KeyError, BadSignatureError,):
|
except (KeyError, BadSignatureError,):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ JOIN_KEYS = {
|
||||||
"token",
|
"token",
|
||||||
"public_key",
|
"public_key",
|
||||||
"key_validity_url",
|
"key_validity_url",
|
||||||
"signature",
|
"signatures",
|
||||||
"sender",
|
"sender",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue