parent
ee7e4289f1
commit
862b609687
|
@ -81,7 +81,13 @@ class Block:
|
||||||
if self.getHeader('encryptType') == 'asym':
|
if self.getHeader('encryptType') == 'asym':
|
||||||
try:
|
try:
|
||||||
self.bcontent = core._crypto.pubKeyDecrypt(self.bcontent, anonymous=anonymous, encodedData=encodedData)
|
self.bcontent = core._crypto.pubKeyDecrypt(self.bcontent, anonymous=anonymous, encodedData=encodedData)
|
||||||
self.bmetadata = json.loads(core._crypto.pubKeyDecrypt(self.bmetadata, anonymous=anonymous, encodedData=encodedData))
|
bmeta = core._crypto.pubKeyDecrypt(self.bmetadata, anonymous=anonymous, encodedData=encodedData)
|
||||||
|
try:
|
||||||
|
bmeta = bmeta.decode()
|
||||||
|
except AttributeError:
|
||||||
|
# yet another bytes fix
|
||||||
|
pass
|
||||||
|
self.bmetadata = json.loads(bmeta)
|
||||||
self.signature = core._crypto.pubKeyDecrypt(self.signature, anonymous=anonymous, encodedData=encodedData)
|
self.signature = core._crypto.pubKeyDecrypt(self.signature, anonymous=anonymous, encodedData=encodedData)
|
||||||
self.signer = core._crypto.pubKeyDecrypt(self.signer, anonymous=anonymous, encodedData=encodedData)
|
self.signer = core._crypto.pubKeyDecrypt(self.signer, anonymous=anonymous, encodedData=encodedData)
|
||||||
self.signedData = json.dumps(self.bmetadata) + self.bcontent.decode()
|
self.signedData = json.dumps(self.bmetadata) + self.bcontent.decode()
|
||||||
|
@ -101,7 +107,6 @@ class Block:
|
||||||
|
|
||||||
if core._crypto.edVerify(data=self.signedData, key=self.signer, sig=self.signature, encodedData=True):
|
if core._crypto.edVerify(data=self.signedData, key=self.signer, sig=self.signature, encodedData=True):
|
||||||
self.validSig = True
|
self.validSig = True
|
||||||
print('ded')
|
|
||||||
else:
|
else:
|
||||||
self.validSig = False
|
self.validSig = False
|
||||||
return self.validSig
|
return self.validSig
|
||||||
|
|
|
@ -117,7 +117,8 @@ class OnionrUtils:
|
||||||
else:
|
else:
|
||||||
logger.warn("Failed to add key")
|
logger.warn("Failed to add key")
|
||||||
else:
|
else:
|
||||||
logger.debug('%s pow failed' % key[0])
|
pass
|
||||||
|
#logger.debug('%s pow failed' % key[0])
|
||||||
return retVal
|
return retVal
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.error('Failed to merge keys.', error=error)
|
logger.error('Failed to merge keys.', error=error)
|
||||||
|
@ -137,7 +138,8 @@ class OnionrUtils:
|
||||||
logger.info('Added %s to db.' % adder, timestamp = True)
|
logger.info('Added %s to db.' % adder, timestamp = True)
|
||||||
retVal = True
|
retVal = True
|
||||||
else:
|
else:
|
||||||
logger.debug('%s is either our address or already in our DB' % adder)
|
pass
|
||||||
|
#logger.debug('%s is either our address or already in our DB' % adder)
|
||||||
return retVal
|
return retVal
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.error('Failed to merge adders.', error = error)
|
logger.error('Failed to merge adders.', error = error)
|
||||||
|
|
Loading…
Reference in New Issue