summary refs log tree commit diff
path: root/contrib
diff options
context:
space:
mode:
authorJacek KuĊ›nierz <jacek.kusnierz@tum.de>2022-06-01 13:32:35 +0200
committerGitHub <noreply@github.com>2022-06-01 07:32:35 -0400
commit88193f2125ad2e1dc1c83d6876757cc5eb3c467d (patch)
treec7d7f07b3afbb6a81b32dd413dac2324f46878f0 /contrib
parentFix 404 on `/sync` when the last event is a redaction of an unknown/purged ev... (diff)
downloadsynapse-88193f2125ad2e1dc1c83d6876757cc5eb3c467d.tar.xz
Remove direct refeferences to PyNaCl (use signedjson instead). (#12902)
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cmdclient/console.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/cmdclient/console.py b/contrib/cmdclient/console.py

index 856dd437db..895b2a7af1 100755 --- a/contrib/cmdclient/console.py +++ b/contrib/cmdclient/console.py
@@ -16,6 +16,7 @@ """ Starts a synapse client console. """ import argparse +import binascii import cmd import getpass import json @@ -26,9 +27,8 @@ import urllib from http import TwistedHttpClient from typing import Optional -import nacl.encoding -import nacl.signing import urlparse +from signedjson.key import NACL_ED25519, decode_verify_key_bytes from signedjson.sign import SignatureVerifyException, verify_signed_json from twisted.internet import defer, reactor, threads @@ -41,7 +41,6 @@ TRUSTED_ID_SERVERS = ["localhost:8001"] class SynapseCmd(cmd.Cmd): - """Basic synapse command-line processor. This processes commands from the user and calls the relevant HTTP methods. @@ -420,8 +419,8 @@ class SynapseCmd(cmd.Cmd): pubKey = None pubKeyObj = yield self.http_client.do_request("GET", url) if "public_key" in pubKeyObj: - pubKey = nacl.signing.VerifyKey( - pubKeyObj["public_key"], encoder=nacl.encoding.HexEncoder + pubKey = decode_verify_key_bytes( + NACL_ED25519, binascii.unhexlify(pubKeyObj["public_key"]) ) else: print("No public key found in pubkey response!")