added cryptotests

This commit is contained in:
Kevin Froman 2018-04-02 02:21:58 -05:00
parent 8022781a8f
commit 6dafcffd5a
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
3 changed files with 39 additions and 3 deletions

View file

@ -18,7 +18,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
'''
# Misc functions that do not fit in the main api, but are useful
import getpass, sys, requests, os, socket, hashlib, logger, sqlite3, config
import getpass, sys, requests, os, socket, hashlib, logger, sqlite3, config, binascii
import nacl.signing, nacl.encoding
if sys.version_info < (3, 6):
@ -190,6 +190,8 @@ class OnionrUtils:
nacl.signing.SigningKey(seed=key, encoder=nacl.encoding.Base32Encoder)
except nacl.exceptions.ValueError:
pass
except binascii.Error:
pass
else:
retVal = True
return retVal