Add needs_pin_sent to indicate whether promptpin needs to be used
This commit is contained in:
parent
d2696cfadf
commit
bca85354f9
@ -252,6 +252,7 @@ def enumerate(password=''):
|
||||
d_data['fingerprint'] = client._get_fingerprint_hex()
|
||||
d_data['type'] = 'coldcard'
|
||||
d_data['path'] = CC_SIMULATOR_SOCK
|
||||
d_data['needs_pin_sent'] = False
|
||||
d_data['needs_passphrase_sent'] = False
|
||||
results.append(d_data)
|
||||
except RuntimeError as e:
|
||||
|
||||
@ -603,6 +603,7 @@ def enumerate(password=''):
|
||||
else:
|
||||
master_xpub = client.get_pubkey_at_path('m/0h')['xpub']
|
||||
d_data['fingerprint'] = get_xpub_fingerprint_hex(master_xpub)
|
||||
d_data['needs_pin_sent'] = False
|
||||
d_data['needs_passphrase_sent'] = True
|
||||
except HWWError as e:
|
||||
d_data['error'] = "Could not open client or get fingerprint information: " + e.get_msg()
|
||||
|
||||
@ -26,7 +26,10 @@ def enumerate(password=''):
|
||||
client.client.init_device()
|
||||
if not 'keepkey' in client.client.features.vendor:
|
||||
continue
|
||||
d_data['needs_pin_sent'] = client.client.features.pin_protection and not client.client.features.pin_cached
|
||||
d_data['needs_passphrase_sent'] = client.client.features.passphrase_protection and not client.client.features.passphrase_cached
|
||||
if d_data['needs_pin_sent']:
|
||||
raise DeviceNotReadyError('Keepkey is locked. Unlock by using \'promptpin\' and then \'sendpin\'.')
|
||||
if d_data['needs_passphrase_sent'] and not password:
|
||||
raise DeviceNotReadyError("Passphrase needs to be specified before the fingerprint information can be retrieved")
|
||||
if client.client.features.initialized:
|
||||
|
||||
@ -350,6 +350,7 @@ def enumerate(password=''):
|
||||
client = LedgerClient(path, password)
|
||||
master_xpub = client.get_pubkey_at_path('m/0h')['xpub']
|
||||
d_data['fingerprint'] = get_xpub_fingerprint_hex(master_xpub)
|
||||
d_data['needs_pin_sent'] = False
|
||||
d_data['needs_passphrase_sent'] = False
|
||||
except Exception as e:
|
||||
d_data['error'] = "Could not open client or get fingerprint information: " + str(e)
|
||||
|
||||
@ -421,7 +421,10 @@ def enumerate(password=''):
|
||||
client.client.init_device()
|
||||
if not 'trezor' in client.client.features.vendor:
|
||||
continue
|
||||
d_data['needs_pin_sent'] = client.client.features.pin_protection and not client.client.features.pin_cached
|
||||
d_data['needs_passphrase_sent'] = client.client.features.passphrase_protection and not client.client.features.passphrase_cached
|
||||
if d_data['needs_pin_sent']:
|
||||
raise DeviceNotReadyError('Trezor is locked. Unlock by using \'promptpin\' and then \'sendpin\'.')
|
||||
if d_data['needs_passphrase_sent'] and not password:
|
||||
raise DeviceNotReadyError("Passphrase needs to be specified before the fingerprint information can be retrieved")
|
||||
if client.client.features.initialized:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user