From 5a8fbbe4295d8f4f1a7aa8e57618a7e19231a7d0 Mon Sep 17 00:00:00 2001 From: "jai.s" Date: Sat, 4 Jan 2020 20:29:54 +0530 Subject: [PATCH 1/2] Solved person-to-person,brodcast,publickey,objects In network section via using the python2 database --- src/network/bmproto.py | 2 -- src/protocol.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index cd839a96..66950380 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -468,8 +468,6 @@ class BMProto(AdvancedDispatcher, ObjectTracker): return self.decode_payload_content("LQIQ16sH") def bm_command_addr(self): - # print('+++++++++++++++++++++++++++\ - # bm_command_addr bm_command_addr bm_command_addr ++++++++++++++++') """Incoming addresses, process them""" addresses = self._decode_addr() # pylint: disable=redefined-outer-name for i in addresses: diff --git a/src/protocol.py b/src/protocol.py index fd3ce26b..dd3af795 100644 --- a/src/protocol.py +++ b/src/protocol.py @@ -326,6 +326,7 @@ def assembleVersionMessage(remoteHost, remotePort, participatingStreams, server= # = 127.0.0.1. This will be ignored by the remote host. The actual remote connected IP will be used. #python3 need to check payload += '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF'.encode('raw_unicode_escape') + pack('>L', 2130706433) + # we have a separate extPort and incoming over clearnet # or outgoing through clearnet extport = BMConfigParser().safeGetInt('bitmessagesettings', 'extport') From 381be6e104e058b42ae7e53ed6c008587750e1de Mon Sep 17 00:00:00 2001 From: "jai.s" Date: Wed, 8 Jan 2020 17:15:45 +0530 Subject: [PATCH 2/2] ECDSA Issue Solved --- src/class_objectProcessor.py | 6 +++--- src/highlevelcrypto.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/class_objectProcessor.py b/src/class_objectProcessor.py index 3e3261ad..cad8fe63 100644 --- a/src/class_objectProcessor.py +++ b/src/class_objectProcessor.py @@ -147,7 +147,7 @@ class objectProcessor(threading.Thread): sqlExecute( 'UPDATE sent SET status=?, lastactiontime=?' ' WHERE ackdata=?', - ' ackreceived', int(time.time()), data[readPosition:]) + 'ackreceived', int(time.time()), data[readPosition:]) queues.UISignalQueue.put(( 'updateSentItemStatusByAckdata', (data[readPosition:], @@ -383,9 +383,9 @@ class objectProcessor(threading.Thread): signatureLength, signatureLengthLength = decodeVarint( data[readPosition:readPosition + 10]) readPosition += signatureLengthLength - signature = data[readPosition:readPosition + signatureLength] + signature = bytes(data[readPosition:readPosition + signatureLength]) if highlevelcrypto.verify( - data[8:endOfSignedDataPosition], + bytes(data[8:endOfSignedDataPosition]), signature, hexlify(publicSigningKey)): logger.debug('ECDSA verify passed (within processpubkey)') else: diff --git a/src/highlevelcrypto.py b/src/highlevelcrypto.py index c2d9ebb2..03e2d1d3 100644 --- a/src/highlevelcrypto.py +++ b/src/highlevelcrypto.py @@ -30,7 +30,7 @@ def makeCryptor(privkey): def hexToPubkey(pubkey): """Convert a pubkey from hex to binary""" 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