From f4559183269b7bb3b3a4e46de3e95b065f63b900 Mon Sep 17 00:00:00 2001 From: nimdahk Date: Tue, 30 Jul 2013 19:24:24 -0400 Subject: [PATCH] Don't send acks to ignored senders. --- src/class_receiveDataThread.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index 2693b293..25620f2a 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -1,4 +1,5 @@ doTimingAttackMitigation = True +sendAckEvenIfMsgIgnored = False import time import threading @@ -1050,10 +1051,16 @@ class receiveDataThread(threading.Thread): toAddress, '[Broadcast subscribers]', fromAddress, subject, message, ackdata))) shared.workerQueue.put(('sendbroadcast', '')) - if self.isAckDataValid(ackData): - print 'ackData is valid. Will process it.' - self.ackDataThatWeHaveYetToSend.append( - ackData) # When we have processed all data, the processData function will pop the ackData out and process it as if it is a message received from our peer. + if self.isAckDataValid(ackData): + print 'ackData is valid. Will process it.' + self.ackDataThatWeHaveYetToSend.append( + ackData) # When we have processed all data, the processData function will pop the ackData out and process it as if it is a message received from our peer. + else: # BlockMsg is true + if sendAckEvenIfMsgIgnored: + if self.isAckDataValid(ackData): + print 'ackData is valid. Will process it.' + self.ackDataThatWeHaveYetToSend.append( + ackData) # When we have processed all data, the processData function will pop the ackData out and process it as if it is a message received from our peer. # Display timing data timeRequiredToAttemptToDecryptMessage = time.time( ) - self.messageProcessingStartTime