Skip to content

Commit 9ed9dbe

Browse files
committed
trezor: Default to empty string passphrase
If the passphrase is not provided and passphrase protection is enabled, default to the empty string.
1 parent 0c4df0c commit 9ed9dbe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hwilib/devices/trezor.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ def __init__(
289289
sim_path: str = SIMULATOR_PATH,
290290
model: Optional[TrezorModel] = None
291291
) -> None:
292+
if password is None:
293+
password = ""
292294
super(TrezorClient, self).__init__(path, password, expert, chain)
293295
self.simulator = False
294296
transport = get_path_transport(path, hid_ids, webusb_ids, sim_path)
@@ -879,7 +881,7 @@ def enumerate(password: Optional[str] = None) -> List[Dict[str, Any]]:
879881
if d_data['needs_pin_sent']:
880882
raise DeviceNotReadyError('Trezor is locked. Unlock by using \'promptpin\' and then \'sendpin\'.')
881883
if d_data['needs_passphrase_sent'] and password is None:
882-
raise DeviceNotReadyError("Passphrase needs to be specified before the fingerprint information can be retrieved")
884+
d_data["warnings"] = [["Passphrase protection enabled but passphrase was not provided. Using default passphrase of the empty string (\"\")"]]
883885
if client.client.features.initialized:
884886
d_data['fingerprint'] = client.get_master_fingerprint().hex()
885887
d_data['needs_passphrase_sent'] = False # Passphrase is always needed for the above to have worked, so it's already sent

0 commit comments

Comments
 (0)