From 89b23c0cd5559a318c0e4908e186e736dfdcbb44 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 2 Apr 2013 12:42:27 -0400 Subject: [PATCH 1/3] added embeddedTime fuzzing to pubkey and getpubkey message assembly --- bitmessagemain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index aa7987e2..bf4c8bd6 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -2182,7 +2182,7 @@ class singleWorker(QThread): myAddress = addressInKeysFile break - embeddedTime = int(time.time())+random.randrange(-300, 300) #the current time plus or minus five minutes + embeddedTime = int(time.time()+random.randrange(-300, 300)) #the current time plus or minus five minutes payload = pack('>I',(embeddedTime)) payload += encodeVarint(addressVersionNumber) #Address version number payload += encodeVarint(streamNumber) @@ -2567,7 +2567,7 @@ class singleWorker(QThread): def requestPubKey(self,addressVersionNumber,streamNumber,ripe): - payload = pack('>I',int(time.time())) + payload = pack('>I',(int(time.time())+random.randrange(-300, 300)))#the current time plus or minus five minutes. payload += encodeVarint(addressVersionNumber) payload += encodeVarint(streamNumber) payload += ripe -- 2.45.1 From ba4858de254b1fa326ad61bffa38be98de0ceddf Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 2 Apr 2013 13:01:41 -0400 Subject: [PATCH 2/3] no unicode encoding needed when setting text; it is already unicode --- bitmessagemain.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index bf4c8bd6..b7d434fb 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -2471,7 +2471,11 @@ class singleWorker(QThread): sqlSubmitQueue.put((toRipe,)) queryreturn = sqlReturnQueue.get() sqlLock.release() - + if queryreturn == []: + printLock.acquire() + sys.stderr.write('(within sendMsg) The needed pubkey was not found. This should never happen. Aborting send.\n') + printLock.release() + return for row in queryreturn: pubkeyPayload, = row @@ -3896,7 +3900,8 @@ class MyForm(QtGui.QMainWindow): toAddress = str(self.ui.tableWidgetSent.item(i,0).data(Qt.UserRole).toPyObject()) status,addressVersionNumber,streamNumber,ripe = decodeAddress(toAddress) if ripe == toRipe: - self.ui.tableWidgetSent.item(i,3).setText(unicode(textToDisplay,'utf-8')) + #self.ui.tableWidgetSent.item(i,3).setText(unicode(textToDisplay,'utf-8')) + self.ui.tableWidgetSent.item(i,3).setText(textToDisplay,'utf-8') def updateSentItemStatusByAckdata(self,ackdata,textToDisplay): for i in range(self.ui.tableWidgetSent.rowCount()): -- 2.45.1 From ccae1fcb8aeaed9cf39978a56324dc2b8cf57a08 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 2 Apr 2013 13:11:15 -0400 Subject: [PATCH 3/3] no unicode encoding needed when setting text; it is already unicode --- bitmessagemain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index b7d434fb..4d97bf0d 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -3901,7 +3901,7 @@ class MyForm(QtGui.QMainWindow): status,addressVersionNumber,streamNumber,ripe = decodeAddress(toAddress) if ripe == toRipe: #self.ui.tableWidgetSent.item(i,3).setText(unicode(textToDisplay,'utf-8')) - self.ui.tableWidgetSent.item(i,3).setText(textToDisplay,'utf-8') + self.ui.tableWidgetSent.item(i,3).setText(textToDisplay) def updateSentItemStatusByAckdata(self,ackdata,textToDisplay): for i in range(self.ui.tableWidgetSent.rowCount()): -- 2.45.1