Fix ECDSA on CryptMessage (#1987)
* Add ecdsaSign and ecdsaVerify * Fix return * Fix unicode * Update CryptMessagePlugin.py * Remove .encode("utf8") * Fix keys during ECDSA signing
This commit is contained in:
parent
afbacdfc96
commit
d7d75a1fe8
1 changed files with 3 additions and 3 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue