From 88193f2125ad2e1dc1c83d6876757cc5eb3c467d Mon Sep 17 00:00:00 2001 From: Jacek KuĊ›nierz Date: Wed, 1 Jun 2022 13:32:35 +0200 Subject: Remove direct refeferences to PyNaCl (use signedjson instead). (#12902) --- contrib/cmdclient/console.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'contrib') 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!") -- cgit 1.4.1