Merge branch 'master' into flood-fill
This commit is contained in:
commit
44112750ec
8 changed files with 30 additions and 30 deletions
|
@ -45,7 +45,8 @@ def connect_new_peer_to_communicator(shared_state, peer='', useBootstrap=False):
|
|||
peerList = keydb.listkeys.list_adders()
|
||||
|
||||
mainPeerList = keydb.listkeys.list_adders()
|
||||
peerList = onionrpeers.get_score_sorted_peer_list()
|
||||
if not peerList:
|
||||
peerList = onionrpeers.get_score_sorted_peer_list()
|
||||
|
||||
"""
|
||||
If we don't have enough peers connected or random chance,
|
||||
|
|
|
@ -23,7 +23,7 @@ import filepaths
|
|||
DENIABLE_PEER_ADDRESS = "OVPCZLOXD6DC5JHX4EQ3PSOGAZ3T24F75HQLIUZSDSMYPEOXCPFA"
|
||||
PASSWORD_LENGTH = 25
|
||||
ONIONR_TAGLINE = 'Private P2P Communication - GPLv3 - https://Onionr.net'
|
||||
ONIONR_VERSION = '6.1.1'
|
||||
ONIONR_VERSION = '6.2.0'
|
||||
ONIONR_VERSION_CODENAME = 'Genesis'
|
||||
ONIONR_VERSION_TUPLE = tuple(ONIONR_VERSION.split('.')) # (MAJOR, MINOR, VERSION)
|
||||
API_VERSION = '2' # increments of 1; only change when something fundamental about how the API works changes. This way other nodes know how to communicate without learning too much information about you.
|
||||
|
|
|
@ -36,7 +36,7 @@ def accept_upload(request):
|
|||
resp = 'failure'
|
||||
data = request.get_data()
|
||||
data_size = sys.getsizeof(data)
|
||||
print(data)
|
||||
|
||||
if data_size < 30:
|
||||
resp = 'size'
|
||||
elif data_size < 100000000:
|
||||
|
|
|
@ -79,10 +79,7 @@ class Block:
|
|||
# decrypt data
|
||||
if self.getHeader('encryptType') == 'asym':
|
||||
try:
|
||||
try:
|
||||
self.bcontent = encryption.pub_key_decrypt(self.bcontent, encodedData=encodedData)
|
||||
except (binascii.Error, ValueError) as e:
|
||||
self.bcontent = encryption.pub_key_decrypt(self.bcontent, encodedData=False)
|
||||
self.bcontent = encryption.pub_key_decrypt(self.bcontent, encodedData=False)
|
||||
|
||||
bmeta = encryption.pub_key_decrypt(self.bmetadata, encodedData=encodedData)
|
||||
|
||||
|
@ -93,9 +90,11 @@ class Block:
|
|||
pass
|
||||
self.bmetadata = json.loads(bmeta)
|
||||
self.signature = encryption.pub_key_decrypt(self.signature, encodedData=encodedData)
|
||||
|
||||
self.signer = encryption.pub_key_decrypt(self.signer, encodedData=encodedData)
|
||||
|
||||
self.bheader['signer'] = self.signer.decode()
|
||||
self.signedData = json.dumps(self.bmetadata).encode() + self.bcontent
|
||||
self.signedData = json.dumps(self.bmetadata).encode() + self.bcontent
|
||||
|
||||
if not self.signer is None:
|
||||
if not self.verifySig():
|
||||
|
@ -124,8 +123,8 @@ class Block:
|
|||
except (onionrexceptions.DecryptionError, nacl.exceptions.CryptoError) as e:
|
||||
logger.error(str(e))
|
||||
pass
|
||||
except nacl.exceptions.CryptoError:
|
||||
logger.debug('Could not decrypt block. Either invalid key or corrupted data')
|
||||
except (nacl.exceptions.CryptoError,) as e:
|
||||
logger.debug(f'Could not decrypt block. encodedData: {encodedData}. Either invalid key or corrupted data ' + str(e))
|
||||
except onionrexceptions.ReplayAttack:
|
||||
logger.warn('%s is possibly a replay attack' % (self.hash,))
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue