From 4843fb1e9cd37baef3a0b36c27dde15bdcae692c Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 17 Feb 2019 14:21:03 -0600 Subject: [PATCH] fixes after module moves --- onionr/onionrblockapi.py | 10 +++++----- onionr/onionrusers/onionrusers.py | 4 ++-- onionr/onionrutils.py | 5 +++-- onionr/static-data/bootstrap-nodes.txt | 2 +- onionr/static-data/default-plugins/encrypt/main.py | 2 +- onionr/static-data/default-plugins/pms/main.py | 3 ++- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/onionr/onionrblockapi.py b/onionr/onionrblockapi.py index 732071d3..e9724b03 100755 --- a/onionr/onionrblockapi.py +++ b/onionr/onionrblockapi.py @@ -60,7 +60,7 @@ class Block: self.update() - def decrypt(self, anonymous = True, encodedData = True): + def decrypt(self, encodedData = True): ''' Decrypt a block, loading decrypted data into their vars ''' @@ -72,16 +72,16 @@ class Block: # decrypt data if self.getHeader('encryptType') == 'asym': try: - self.bcontent = core._crypto.pubKeyDecrypt(self.bcontent, anonymous=anonymous, encodedData=encodedData) - bmeta = core._crypto.pubKeyDecrypt(self.bmetadata, anonymous=anonymous, encodedData=encodedData) + self.bcontent = core._crypto.pubKeyDecrypt(self.bcontent, encodedData=encodedData) + bmeta = core._crypto.pubKeyDecrypt(self.bmetadata, 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.signer = core._crypto.pubKeyDecrypt(self.signer, anonymous=anonymous, encodedData=encodedData) + self.signature = core._crypto.pubKeyDecrypt(self.signature, encodedData=encodedData) + self.signer = core._crypto.pubKeyDecrypt(self.signer, encodedData=encodedData) self.bheader['signer'] = self.signer.decode() self.signedData = json.dumps(self.bmetadata) + self.bcontent.decode() try: diff --git a/onionr/onionrusers/onionrusers.py b/onionr/onionrusers/onionrusers.py index b51e93cf..ab14a5a0 100755 --- a/onionr/onionrusers/onionrusers.py +++ b/onionr/onionrusers/onionrusers.py @@ -79,7 +79,7 @@ class OnionrUser: encrypted = coreInst._crypto.pubKeyEncrypt(data, self.publicKey, encodedData=True) return encrypted - def decrypt(self, data, anonymous=True): + def decrypt(self, data): decrypted = coreInst._crypto.pubKeyDecrypt(data, self.publicKey, encodedData=True) return decrypted @@ -97,7 +97,7 @@ class OnionrUser: retData = "" for key in self.getGeneratedForwardKeys(False): try: - retData = self._core._crypto.pubKeyDecrypt(encrypted, privkey=key[1], anonymous=True, encodedData=True) + retData = self._core._crypto.pubKeyDecrypt(encrypted, privkey=key[1], encodedData=True) except nacl.exceptions.CryptoError: retData = False else: diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index 85f26d66..afe834e8 100755 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -24,8 +24,9 @@ from onionrblockapi import Block import onionrexceptions from onionr import API_VERSION import onionrevents -import onionrusers, storagecounter -from etc import pgpwords +import storagecounter +from etc import pgpwords +from onionrusers import onionrusers if sys.version_info < (3, 6): try: import sha3 diff --git a/onionr/static-data/bootstrap-nodes.txt b/onionr/static-data/bootstrap-nodes.txt index 3dbed366..fe11c63d 100755 --- a/onionr/static-data/bootstrap-nodes.txt +++ b/onionr/static-data/bootstrap-nodes.txt @@ -1 +1 @@ -n6bvl3azuqkzckfc6ny2ruxxn2yh56tfpnbgzb3cz6zvwj64blfxj6id.onion +yjlbrt6ins7rhacaapk4a4rfwf3dqh55merbaobxd7qumuok6j6vd7yd.onion \ No newline at end of file diff --git a/onionr/static-data/default-plugins/encrypt/main.py b/onionr/static-data/default-plugins/encrypt/main.py index ac60cc69..7ea5b446 100755 --- a/onionr/static-data/default-plugins/encrypt/main.py +++ b/onionr/static-data/default-plugins/encrypt/main.py @@ -88,7 +88,7 @@ class PlainEncryption: return encrypted = data.replace('ONIONR ENCRYPTED DATA ', '').replace('END ENCRYPTED DATA', '') myPub = self.api.get_core()._crypto.pubKey - decrypted = self.api.get_core()._crypto.pubKeyDecrypt(encrypted, privkey=self.api.get_core()._crypto.privKey, anonymous=True, encodedData=True) + decrypted = self.api.get_core()._crypto.pubKeyDecrypt(encrypted, privkey=self.api.get_core()._crypto.privKey, encodedData=True) if decrypted == False: logger.error("Decryption failed") else: diff --git a/onionr/static-data/default-plugins/pms/main.py b/onionr/static-data/default-plugins/pms/main.py index bc261317..806e4eef 100755 --- a/onionr/static-data/default-plugins/pms/main.py +++ b/onionr/static-data/default-plugins/pms/main.py @@ -21,7 +21,8 @@ # Imports some useful libraries import logger, config, threading, time, readline, datetime from onionrblockapi import Block -import onionrexceptions, onionrusers +import onionrexceptions +from onionrusers import onionrusers import locale, sys, os, json locale.setlocale(locale.LC_ALL, '')