ECDSA Issue Solved
This commit is contained in:
parent
5a8fbbe429
commit
381be6e104
|
@ -147,7 +147,7 @@ class objectProcessor(threading.Thread):
|
||||||
sqlExecute(
|
sqlExecute(
|
||||||
'UPDATE sent SET status=?, lastactiontime=?'
|
'UPDATE sent SET status=?, lastactiontime=?'
|
||||||
' WHERE ackdata=?',
|
' WHERE ackdata=?',
|
||||||
' ackreceived', int(time.time()), data[readPosition:])
|
'ackreceived', int(time.time()), data[readPosition:])
|
||||||
queues.UISignalQueue.put((
|
queues.UISignalQueue.put((
|
||||||
'updateSentItemStatusByAckdata',
|
'updateSentItemStatusByAckdata',
|
||||||
(data[readPosition:],
|
(data[readPosition:],
|
||||||
|
@ -383,9 +383,9 @@ class objectProcessor(threading.Thread):
|
||||||
signatureLength, signatureLengthLength = decodeVarint(
|
signatureLength, signatureLengthLength = decodeVarint(
|
||||||
data[readPosition:readPosition + 10])
|
data[readPosition:readPosition + 10])
|
||||||
readPosition += signatureLengthLength
|
readPosition += signatureLengthLength
|
||||||
signature = data[readPosition:readPosition + signatureLength]
|
signature = bytes(data[readPosition:readPosition + signatureLength])
|
||||||
if highlevelcrypto.verify(
|
if highlevelcrypto.verify(
|
||||||
data[8:endOfSignedDataPosition],
|
bytes(data[8:endOfSignedDataPosition]),
|
||||||
signature, hexlify(publicSigningKey)):
|
signature, hexlify(publicSigningKey)):
|
||||||
logger.debug('ECDSA verify passed (within processpubkey)')
|
logger.debug('ECDSA verify passed (within processpubkey)')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -30,7 +30,7 @@ def makeCryptor(privkey):
|
||||||
def hexToPubkey(pubkey):
|
def hexToPubkey(pubkey):
|
||||||
"""Convert a pubkey from hex to binary"""
|
"""Convert a pubkey from hex to binary"""
|
||||||
pubkey_raw = a.changebase(pubkey[2:], 16, 256, minlen=64)
|
pubkey_raw = a.changebase(pubkey[2:], 16, 256, minlen=64)
|
||||||
pubkey_bin = '\x02\xca\x00 ' + pubkey_raw[:32] + '\x00 ' + pubkey_raw[32:]
|
pubkey_bin = '\x02\xca\x00 '.encode('raw_unicode_escape') + pubkey_raw[:32] + '\x00 '.encode() + pubkey_raw[32:]
|
||||||
return pubkey_bin
|
return pubkey_bin
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user