From 88efb92c15b563188987c41c697875c340dd72a4 Mon Sep 17 00:00:00 2001 From: themighty1 Date: Mon, 20 Oct 2014 18:45:53 +0300 Subject: [PATCH 1/4] dont freeze UI when mass-marking unread --- src/bitmessageqt/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index df6b3b45..1c1c08a6 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2663,15 +2663,19 @@ class MyForm(QtGui.QMainWindow): def on_action_InboxMarkUnread(self): font = QFont() font.setBold(True) + inventoryHashesToMarkUnread = [] for row in self.ui.tableWidgetInbox.selectedIndexes(): currentRow = row.row() inventoryHashToMarkUnread = str(self.ui.tableWidgetInbox.item( currentRow, 3).data(Qt.UserRole).toPyObject()) - sqlExecute('''UPDATE inbox SET read=0 WHERE msgid=?''', inventoryHashToMarkUnread) + inventoryHashesToMarkUnread.append(inventoryHashToMarkUnread) self.ui.tableWidgetInbox.item(currentRow, 0).setFont(font) self.ui.tableWidgetInbox.item(currentRow, 1).setFont(font) self.ui.tableWidgetInbox.item(currentRow, 2).setFont(font) self.ui.tableWidgetInbox.item(currentRow, 3).setFont(font) + #sqlite requires the exact number of ?s to prevent injection + sqlExecute('''UPDATE inbox SET read=0 WHERE msgid IN (%s)''' % ( + "?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread) self.changedInboxUnread() # self.ui.tableWidgetInbox.selectRow(currentRow + 1) # This doesn't de-select the last message if you try to mark it unread, but that doesn't interfere. Might not be necessary. -- 2.45.1 From 362cac8c27cf836aaed81e873ec95b36bd19c373 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Wed, 22 Oct 2014 21:12:44 +0800 Subject: [PATCH 2/4] Update all version numbers to 0.4.4 --- Makefile | 2 +- arch.sh | 4 ++-- archpackage/PKGBUILD | 2 +- debian.sh | 4 ++-- ebuild.sh | 4 ++-- generate.sh | 2 +- puppy.sh | 4 ++-- rpm.sh | 4 ++-- rpmpackage/pybitmessage.spec | 2 +- slack.sh | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index d3818f4d..36927797 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ APP=pybitmessage -VERSION=0.4.2 +VERSION=0.4.4 RELEASE=1 ARCH_TYPE=`uname -m` PREFIX?=/usr/local diff --git a/arch.sh b/arch.sh index 64c903a7..825367d8 100755 --- a/arch.sh +++ b/arch.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.2 -VERSION=0.4.2 +PREV_VERSION=0.4.4 +VERSION=0.4.4 RELEASE=1 ARCH_TYPE=any CURRDIR=`pwd` diff --git a/archpackage/PKGBUILD b/archpackage/PKGBUILD index 33eed270..061795dc 100644 --- a/archpackage/PKGBUILD +++ b/archpackage/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Bob Mottram (4096 bits) pkgname=pybitmessage -pkgver=0.4.2 +pkgver=0.4.4 pkgrel=1 pkgdesc="Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide "non-content" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." arch=('any') diff --git a/debian.sh b/debian.sh index 117d863c..709f1879 100755 --- a/debian.sh +++ b/debian.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.2 -VERSION=0.4.2 +PREV_VERSION=0.4.4 +VERSION=0.4.4 RELEASE=1 ARCH_TYPE=all DIR=${APP}-${VERSION} diff --git a/ebuild.sh b/ebuild.sh index e5550355..cacd7b06 100755 --- a/ebuild.sh +++ b/ebuild.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.2 -VERSION=0.4.2 +PREV_VERSION=0.4.4 +VERSION=0.4.4 RELEASE=1 SOURCEDIR=. ARCH_TYPE=`uname -m` diff --git a/generate.sh b/generate.sh index 933c08e9..c8f0e393 100755 --- a/generate.sh +++ b/generate.sh @@ -4,7 +4,7 @@ rm -f Makefile rpmpackage/*.spec -packagemonkey -n "PyBitmessage" --version "0.4.2" --dir "." -l "mit" \ +packagemonkey -n "PyBitmessage" --version "0.4.4" --dir "." -l "mit" \ -e "Bob Mottram (4096 bits) " \ --brief "Send encrypted messages" \ --desc "Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide \"non-content\" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs." \ diff --git a/puppy.sh b/puppy.sh index 6107ff4a..48832734 100755 --- a/puppy.sh +++ b/puppy.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.2 -VERSION=0.4.2 +PREV_VERSION=0.4.4 +VERSION=0.4.4 RELEASE=1 BUILDDIR=~/petbuild CURRDIR=`pwd` diff --git a/rpm.sh b/rpm.sh index 9b67ba61..be2e21fa 100755 --- a/rpm.sh +++ b/rpm.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.2 -VERSION=0.4.2 +PREV_VERSION=0.4.4 +VERSION=0.4.4 RELEASE=1 SOURCEDIR=. ARCH_TYPE=`uname -m` diff --git a/rpmpackage/pybitmessage.spec b/rpmpackage/pybitmessage.spec index c30bbe0d..537a012e 100644 --- a/rpmpackage/pybitmessage.spec +++ b/rpmpackage/pybitmessage.spec @@ -1,5 +1,5 @@ Name: pybitmessage -Version: 0.4.2 +Version: 0.4.4 Release: 1%{?dist} Summary: Send encrypted messages License: MIT diff --git a/slack.sh b/slack.sh index 9b6d70f7..c19ff954 100755 --- a/slack.sh +++ b/slack.sh @@ -1,8 +1,8 @@ #!/bin/bash APP=pybitmessage -PREV_VERSION=0.4.2 -VERSION=0.4.2 +PREV_VERSION=0.4.4 +VERSION=0.4.4 RELEASE=1 ARCH_TYPE=`uname -m` BUILDDIR=~/slackbuild -- 2.45.1 From 80fa32de41b8465c340923976e57757c09b2fd1c Mon Sep 17 00:00:00 2001 From: digital dreamer Date: Wed, 12 Nov 2014 11:31:15 +0100 Subject: [PATCH 3/4] Fix #417 - bad relative path breaks translations --- src/bitmessageqt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index df6b3b45..9952caf8 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3852,7 +3852,7 @@ def run(): translator = QtCore.QTranslator() translationpath = os.path.join( - getattr(sys, '_MEIPASS', ''), + getattr(sys, '_MEIPASS', sys.path[0]), 'translations', 'bitmessage_' + l10n.getTranslationLanguage() ) -- 2.45.1 From 38b861033dccd31cd218864623e6c8bda9719c12 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Thu, 13 Nov 2014 16:32:31 -0500 Subject: [PATCH 4/4] acknowledgement EOL time: 2.5 days --- src/class_singleWorker.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 8fad2ea8..541ecd98 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -96,8 +96,8 @@ class singleWorker(threading.Thread): status, addressVersionNumber, streamNumber, hash = decodeAddress( myAddress) - TTL = 28 * 24 * 60 * 60 # 28 days - embeddedTime = int(time.time() + random.randrange(-300, 300) + TTL) # 28 days from now plus or minus five minutes + TTL = int(28 * 24 * 60 * 60 + random.randrange(-300, 300))# 28 days from now plus or minus five minutes + embeddedTime = int(time.time() + TTL) payload = pack('>Q', (embeddedTime)) payload += '\x00\x00\x00\x01' # object type: pubkey payload += encodeVarint(addressVersionNumber) # Address version number @@ -174,8 +174,8 @@ class singleWorker(threading.Thread): status, addressVersionNumber, streamNumber, hash = decodeAddress( myAddress) - TTL = 28 * 24 * 60 * 60 # 28 days - embeddedTime = int(time.time() + random.randrange(-300, 300) + TTL) # 28 days from now plus or minus five minutes + TTL = int(28 * 24 * 60 * 60 + random.randrange(-300, 300))# 28 days from now plus or minus five minutes + embeddedTime = int(time.time() + TTL) signedTimeForProtocolV2 = embeddedTime - TTL """ According to the protocol specification, the expiresTime along with the pubkey information is @@ -273,8 +273,8 @@ class singleWorker(threading.Thread): status, addressVersionNumber, streamNumber, hash = decodeAddress( myAddress) - TTL = 28 * 24 * 60 * 60 # 28 days - embeddedTime = int(time.time() + random.randrange(-300, 300) + TTL) # 28 days from now plus or minus five minutes + TTL = int(28 * 24 * 60 * 60 + random.randrange(-300, 300))# 28 days from now plus or minus five minutes + embeddedTime = int(time.time() + TTL) payload = pack('>Q', (embeddedTime)) payload += '\x00\x00\x00\x01' # object type: pubkey payload += encodeVarint(addressVersionNumber) # Address version number @@ -407,8 +407,8 @@ class singleWorker(threading.Thread): pubEncryptionKey = highlevelcrypto.privToPub( privEncryptionKeyHex).decode('hex') - TTL = 2.5 * 24 * 60 * 60 # 2.5 days - embeddedTime = int(time.time() + random.randrange(-300, 300) + TTL) + TTL = int(28 * 24 * 60 * 60 + random.randrange(-300, 300))# 28 days from now plus or minus five minutes + embeddedTime = int(time.time() + TTL) payload = pack('>Q', embeddedTime) payload += '\x00\x00\x00\x03' # object type: broadcast @@ -460,9 +460,11 @@ class singleWorker(threading.Thread): dataToEncrypt += encodeVarint(len(signature)) dataToEncrypt += signature - # Encrypt the broadcast with the information contained in the broadcaster's address. Anyone who knows the address can generate - # the private encryption key to decrypt the broadcast. This provides virtually no privacy; its purpose is to keep questionable - # and illegal content from flowing through the Internet connections and being stored on the disk of 3rd parties. + # Encrypt the broadcast with the information contained in the broadcaster's address. + # Anyone who knows the address can generate the private encryption key to decrypt + # the broadcast. This provides virtually no privacy; its purpose is to keep + # questionable and illegal content from flowing through the Internet connections + # and being stored on the disk of 3rd parties. if addressVersionNumber <= 3: privEncryptionKey = hashlib.sha512(encodeVarint( addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()[:32] @@ -624,8 +626,8 @@ class singleWorker(threading.Thread): continue #on with the next msg on which we can do some work # At this point we know that we have the necessary pubkey in the pubkeys table. - TTL = 2.5 * 24 * 60 * 60 # 2.5 days - embeddedTime = int(time.time() + random.randrange(-300, 300) + TTL) # 2.5 days from now plus or minus five minutes + TTL = int(28 * 24 * 60 * 60 + random.randrange(-300, 300))# 28 days from now plus or minus five minutes + embeddedTime = int(time.time() + TTL) if not shared.config.has_section(toaddress): # if we aren't sending this to ourselves or a chan shared.ackdataForWhichImWatching[ackdata] = 0 @@ -967,8 +969,8 @@ class singleWorker(threading.Thread): if tag not in shared.neededPubkeys: shared.neededPubkeys[tag] = (toAddress, highlevelcrypto.makeCryptor(privEncryptionKey.encode('hex'))) # We'll need this for when we receive a pubkey reply: it will be encrypted and we'll need to decrypt it. - TTL = 2.5 * 24 * 60 * 60 # 2.5 days - embeddedTime = int(time.time() + random.randrange(-300, 300) + TTL) # 2.5 days from now plus or minus five minutes + TTL = int(2.5 * 24 * 60 * 60 + random.randrange(-300, 300)) # 2.5 days from now plus or minus five minutes + embeddedTime = int(time.time() + TTL) payload = pack('>Q', embeddedTime) payload += '\x00\x00\x00\x00' # object type: getpubkey payload += encodeVarint(addressVersionNumber) @@ -988,7 +990,6 @@ class singleWorker(threading.Thread): shared.UISignalQueue.put(('updateSentItemStatusByHash', ( ripe, tr.translateText("MainWindow",'Doing work necessary to request encryption key.')))) - TTL = 2.5 * 24 * 60 * 60 # 2.5 days target = 2 ** 64 / (shared.networkDefaultProofOfWorkNonceTrialsPerByte*(len(payload) + 8 + shared.networkDefaultPayloadLengthExtraBytes + ((TTL*(len(payload)+8+shared.networkDefaultPayloadLengthExtraBytes))/(2 ** 16)))) initialHash = hashlib.sha512(payload).digest() trialValue, nonce = proofofwork.run(target, initialHash) @@ -1014,13 +1015,14 @@ class singleWorker(threading.Thread): shared.UISignalQueue.put(('updateSentItemStatusByHash', (ripe, tr.translateText("MainWindow",'Sending public key request. Waiting for reply. Requested at %1').arg(l10n.formatTimestamp())))) def generateFullAckMessage(self, ackdata, toStreamNumber): - embeddedTime = int(time.time() + random.randrange(-300, 300)) # the current time plus or minus five minutes. + TTL = int(2.5 * 24 * 60 * 60 + random.randrange(-300, 300)) # 2.5 days plus or minus 5 minutes + embeddedTime = int(time.time() + TTL) payload = pack('>Q', (embeddedTime)) payload += '\x00\x00\x00\x02' # object type: msg if int(time.time()) >= 1416175200: # Sun, 16 Nov 2014 22:00:00 GMT payload += encodeVarint(1) # msg version payload += encodeVarint(toStreamNumber) + ackdata - TTL = 2.5 * 24 * 60 * 60 # 2.5 days + target = 2 ** 64 / (shared.networkDefaultProofOfWorkNonceTrialsPerByte*(len(payload) + 8 + shared.networkDefaultPayloadLengthExtraBytes + ((TTL*(len(payload)+8+shared.networkDefaultPayloadLengthExtraBytes))/(2 ** 16)))) with shared.printLock: print '(For ack message) Doing proof of work...' -- 2.45.1