Return new address on method 'new'

This commit is contained in:
nolash 2020-09-20 10:15:48 +02:00
parent 630db89381
commit 5a45512f3b
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 5 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class ReferenceKeystore(Keystore):
def new(self, password=None): def new(self, password=None):
b = os.urandom(32) b = os.urandom(32)
pk = keyapi.PrivateKey(b) pk = keyapi.PrivateKey(b)
self.import(pk, password) return self.import_key(pk, password)
def import_key(self, pk, password=None): def import_key(self, pk, password=None):

View File

@ -1,13 +1,16 @@
#!/usr/bin/python #!/usr/bin/python
# standard imports
import unittest import unittest
import logging import logging
import base64 import base64
# third-party imports
import psycopg2 import psycopg2
from psycopg2 import sql from psycopg2 import sql
from cryptography.fernet import Fernet, InvalidToken from cryptography.fernet import Fernet, InvalidToken
# local imports
from crypto_dev_signer.keystore import ReferenceKeystore from crypto_dev_signer.keystore import ReferenceKeystore
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
@ -23,6 +26,7 @@ class TestDatabase(unittest.TestCase):
db = None db = None
def setUp(self): def setUp(self):
logg.debug('setup')
# arbitrary value # arbitrary value
symkey_hex = 'E92431CAEE69313A7BE9E443C4ABEED9BF8157E9A13553B4D5D6E7D51B5021D9' symkey_hex = 'E92431CAEE69313A7BE9E443C4ABEED9BF8157E9A13553B4D5D6E7D51B5021D9'
self.symkey = bytes.fromhex(symkey_hex) self.symkey = bytes.fromhex(symkey_hex)