* fixed broken block metadata validation, incorrect time integer check and missing size value for encryptType

master
Kevin Froman 2018-07-10 01:17:30 -05:00
parent 9083775887
commit 33787ef39d
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
2 changed files with 4 additions and 3 deletions

View File

@ -329,6 +329,7 @@ class OnionrUtils:
break
if i == 'time':
if not self.isIntegerString(metadata[i]):
logger.warn('Block metadata time stamp is not integer string')
break
else:
# if metadata loop gets no errors, it does not break, therefore metadata is valid
@ -358,9 +359,9 @@ class OnionrUtils:
try:
int(data)
except ValueError:
return True
else:
return False
else:
return True
def validateID(self, id):
'''

View File

@ -21,4 +21,4 @@
class OnionrValues:
def __init__(self):
self.passwordLength = 20
self.blockMetadataLengths = {'meta': 1000, 'sig': 88, 'signer': 64, 'time': 10, 'powRandomToken': '1000'}
self.blockMetadataLengths = {'meta': 1000, 'sig': 88, 'signer': 64, 'time': 10, 'powRandomToken': 1000, 'encryptType': 4}