From 302f6964757ea03fc54776b3298b4c64d2a60304 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 14 Dec 2018 11:23:56 -0600 Subject: [PATCH] removed randomness beacon stuff --- .gitmodules | 0 onionr/communicator2.py | 1 - onionr/core.py | 1 - onionr/onionrutils.py | 23 ----------------------- 4 files changed, 25 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..e69de29b diff --git a/onionr/communicator2.py b/onionr/communicator2.py index 0bce1511..bddb21da 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -82,7 +82,6 @@ class OnionrCommunicatorDaemon: # daemon tools are misc daemon functions, e.g. announce to online peers # intended only for use by OnionrCommunicatorDaemon - #self.daemonTools = onionrdaemontools.DaemonTools(self) self.daemonTools = onionrdaemontools.DaemonTools(self) self._chat = onionrchat.OnionrChat(self) diff --git a/onionr/core.py b/onionr/core.py index 0219a875..017b4313 100644 --- a/onionr/core.py +++ b/onionr/core.py @@ -678,7 +678,6 @@ class Core: ''' retData = False - # check nonce dataNonce = self._utils.bytesToStr(self._crypto.sha3Hash(data)) try: diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index dbcf01e6..e06c1e27 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -23,7 +23,6 @@ import nacl.signing, nacl.encoding from onionrblockapi import Block import onionrexceptions from onionr import API_VERSION -from defusedxml import minidom import onionrevents import pgpwords, onionrusers, storagecounter if sys.version_info < (3, 6): @@ -653,28 +652,6 @@ class OnionrUtils: retData = False return retData - def getNistBeaconSalt(self, torPort=0, rounding=3600): - ''' - Get the token for the current hour from the NIST randomness beacon - ''' - if torPort == 0: - try: - sys.argv[2] - except IndexError: - raise onionrexceptions.MissingPort('Missing Tor socks port') - retData = '' - curTime = self.getRoundedEpoch(rounding) - self.nistSaltTimestamp = curTime - data = self.doGetRequest('https://beacon.nist.gov/rest/record/' + str(curTime), port = torPort) - dataXML = minidom.parseString(data, forbid_dtd = True, forbid_entities = True, forbid_external = True) - try: - retData = dataXML.getElementsByTagName('outputValue')[0].childNodes[0].data - except ValueError: - logger.warn('Failed to get the NIST beacon value.') - else: - self.powSalt = retData - return retData - def strToBytes(self, data): try: data = data.encode()