correct more python3 problems

This commit is contained in:
Mario Fetka 2024-03-26 21:03:43 +01:00
parent bb9f6c3a8b
commit d3de84f45d

View File

@ -12,6 +12,7 @@ import config
import log import log
import crypto import crypto
import M2Crypto import M2Crypto
import binascii
import json import json
import util import util
@ -89,8 +90,9 @@ class Command:
SignEVP = M2Crypto.EVP.load_key(c.privkey) SignEVP = M2Crypto.EVP.load_key(c.privkey)
SignEVP.sign_init() SignEVP.sign_init()
SignEVP.sign_update(text) encoded_text = text.encode('utf-8')
StringSignature = SignEVP.sign_final().encode('hex') SignEVP.sign_update(encoded_text)
StringSignature = binascii.hexlify(SignEVP.sign_final()).decode('utf-8')
logger.debug("Our signature for this message is: " + StringSignature) logger.debug("Our signature for this message is: " + StringSignature)
self.signature = StringSignature self.signature = StringSignature
return StringSignature return StringSignature