trezor-agent
trezor-agent copied to clipboard
Port to trio async library
Changed from sync IO to async IO with cancellation scopes. This enables a few improvements that would have been difficult or impossible before:
- GPG agent allows multiple concurrent clients
- SSH agent no longer holds an exclusive lock for every request handled. Instead, the device is locked while being connected, only for the duration of operations done with the device.
- Clean handling of exit from the agents with Ctrl+C
- Clean handling of exit while device interaction or pinentry are running with Ctrl+C
- When the device requests interaction, a pinentry message is displayed. It automatically closes when the operation completes.
- It is possible to close the GPG agent with either the KILLAGENT message or Ctrl+C.
- More gracefully handle various errors in GPG agent, preventing agent crash, or frozen client.
Many thanks! Will try to review when I'll be available (hopefully in a few weeks).