keygen.py: test_avail(): minor fix
This commit is contained in:
parent
7d7bb5dbce
commit
beff87a467
2 changed files with 4 additions and 4 deletions
|
|
@ -44,7 +44,7 @@ class keygen_base:
|
|||
return None
|
||||
|
||||
@classmethod
|
||||
def test_avail(cls,silent=False):
|
||||
def test_avail(cls,cfg,silent=False):
|
||||
return cls.__name__
|
||||
|
||||
backend_data = {
|
||||
|
|
@ -119,6 +119,6 @@ def KeyGenerator(cfg,proto,pubkey_type,backend=None,silent=False):
|
|||
backend_clsname = getattr(
|
||||
pubkey_type_cls,
|
||||
backend_id.replace('-','_')
|
||||
).test_avail(silent=silent)
|
||||
).test_avail(cfg,silent=silent)
|
||||
|
||||
return getattr(pubkey_type_cls,backend_clsname)(cfg)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class backend:
|
|||
compressed = privkey.compressed )
|
||||
|
||||
@classmethod
|
||||
def test_avail(cls,silent=False):
|
||||
def test_avail(cls,cfg,silent=False):
|
||||
try:
|
||||
from .secp256k1 import priv2pub
|
||||
if not priv2pub(bytes.fromhex('deadbeef'*8),1):
|
||||
|
|
@ -41,7 +41,7 @@ class backend:
|
|||
if not silent:
|
||||
from ...util import ymsg
|
||||
ymsg(str(e))
|
||||
self.cfg._util.qmsg('Using (slow) native Python ECDSA library for public key generation')
|
||||
cfg._util.qmsg('Using (slow) native Python ECDSA library for public key generation')
|
||||
return 'python_ecdsa'
|
||||
|
||||
class python_ecdsa(keygen_base):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue