From d7d75a1fe8f88f5d57781fd980cf7531de133f91 Mon Sep 17 00:00:00 2001 From: Ivanq Date: Fri, 19 Apr 2019 20:34:07 +0300 Subject: [PATCH] Fix ECDSA on CryptMessage (#1987) * Add ecdsaSign and ecdsaVerify * Fix return * Fix unicode * Update CryptMessagePlugin.py * Remove .encode("utf8") * Fix keys during ECDSA signing --- plugins/CryptMessage/CryptMessagePlugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/CryptMessage/CryptMessagePlugin.py b/plugins/CryptMessage/CryptMessagePlugin.py index f1fdc4d4..5abb95ed 100644 --- a/plugins/CryptMessage/CryptMessagePlugin.py +++ b/plugins/CryptMessage/CryptMessagePlugin.py @@ -113,9 +113,9 @@ class UiWebsocketPlugin(object): # Sign data using ECDSA # Return: Signature - def actionEcdsaSign(self, to, data, privatekey=0): - if type(privatekey) is int: # Decrypt using user's privatekey - privatekey = self.user.getEncryptPrivatekey(self.site.address, privatekey) + def actionEcdsaSign(self, to, data, privatekey=None): + if privatekey is None: # Sign using user's privatekey + privatekey = self.user.getAuthPrivatekey(self.site.address) self.response(to, CryptBitcoin.sign(data.encode("utf8"), privatekey))