* macOS does not have `client.pair()`, as documented in bleak docs. This
way we just ignore the NotImplementedError and everything Just Works(tm)
* installing firmware will fail on macos unless response=True. we don't
want to limit other OSes for that so we configure that with a top level
constant
`TrezorConnection._version` wasn't set, so the command was failing with:
```
Traceback (most recent call last):
File "./venv/bin/trezorctl", line 8, in <module>
sys.exit(cli())
^^^^^
File "./venv/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "./venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/rzeyde/src/trezor-firmware/python/src/trezorlib/cli/trezorctl.py", line 161, in invoke
return super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^
File "./venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "./venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "./venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "./venv/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func
return f(get_current_context().obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rzeyde/src/trezor-firmware/python/src/trezorlib/cli/trezorctl.py", line 361, in get_session
if obj.features.model == "1" and obj.version < (1, 9, 0):
^^^^^^^^^^^
File "/home/rzeyde/src/trezor-firmware/python/src/trezorlib/cli/__init__.py", line 280, in version
if self._version is None:
^^^^^^^^^^^^^
AttributeError: 'TrezorConnection' object has no attribute '_version'. Did you mean: 'version'?
```
[no changelog]
Otherwise we conflict with atexit registered in webusb transport and may
cause a segfault in libusb.
What we practically want is to close the obj "after a command", not "at
exit", so we hook into Click's invoke()
[no changelog]
this way a high-level "reopen" functionality is exposed to callers that
want to cycle the connection, without needing to fragilly mess with open
count
[no changelog]
the session id string now includes device path as well, so setting
TREZOR_SESSION_ID is always sufficient when multiple Trezors are
connected.
THP sessions can now be restored (fixes#5855)
* expose Trezor masked key set after handshake phase
* change "username" of keyring passwords to be a random identifier,
store unmasked Trezor key as another password
* allow credential lookup by id, unmasked Trezor public key, or
the masked key set
* expose functionality to trezorctl for forgetting current key or
all remembered keys
[no changelog]
because SkipPairing takes us straight to FINISHED phase, where
CredentialRequest doesn't work without a pre-existing credential
this implies that trezorctl won't skip pairing anymore, even if the skip
method is available
[no changelog]
The function as written didn't really belong into debuglink, so it was
moved to trezorctl, and emu.py can import it from there. Also improved
type annotations, simplified implementation, and made sure that
recording is properly stopped even on an error.
[no changelog]
* for trezorctl, implement custom version of `ensure_unlocked()` on
TrezorConnection, so that we can reuse the standard session which
unlocked the device
* move some of the passphrase handling into TrezorConnection in order
to avoid get_default_session, which has to call its own
ensure_unlocked()
* clean up features handling in client.get_session(), to properly handle
the case that features are locked
[no changelog]
It seems that even if the model is listening for connections it sometimes needs up to 2 seconds more before it actually correctly processes requests.
See #6128.
[no changelog]