trustcrypto / onlykey-agent

The OnlyKey agent is essentially middleware that lets you use OnlyKey as a hardware SSH/GPG device.
https://docs.crp.to/onlykey-agent.html
GNU Lesser General Public License v3.0
46 stars 15 forks source link

Cannot open multiple simultaneous connections #2

Closed schlomie closed 6 years ago

schlomie commented 6 years ago

It is not currently possible to open multiple simultaneous connections to remote machines using onlykey-agent.

Steps to reproduce:

  1. Connect to machine A onlykey-agent -e e -c user@hostA
  2. Attempt to connect to machine B onlykey-agent -e e -c user@hostB

The connection attempt to host B spits out the following python stack:

2018-03-01 16:21:58,247 ERROR failed to connect [client.py:182] Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/onlykey/client.py", line 178, in _connect self._hid.open_path(path) File "hid.pyx", line 72, in hid.device.open_path IOError: open failed 2018-03-01 16:21:59,760 ERROR failed to connect [client.py:182] Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/onlykey/client.py", line 178, in _connect self._hid.open_path(path) File "hid.pyx", line 72, in hid.device.open_path IOError: open failed 2018-03-01 16:22:01,267 ERROR failed to connect [client.py:182] Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/onlykey/client.py", line 178, in _connect self._hid.open_path(path) File "hid.pyx", line 72, in hid.device.open_path IOError: open failed 2018-03-01 16:22:02,777 ERROR failed to connect [client.py:182] Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/onlykey/client.py", line 178, in _connect self._hid.open_path(path) File "hid.pyx", line 72, in hid.device.open_path IOError: open failed 2018-03-01 16:22:04,286 ERROR failed to connect [client.py:182] Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/onlykey/client.py", line 178, in _connect self._hid.open_path(path) File "hid.pyx", line 72, in hid.device.open_path IOError: open failed Traceback (most recent call last): File "/usr/bin/onlykey-agent", line 11, in load_entry_point('onlykey-agent==0.0.2', 'console_scripts', 'onlykey-agent')() File "/usr/lib/python2.7/site-packages/onlykey_agent/main.py", line 123, in wrapper return func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/onlykey_agent/main.py", line 136, in run_agent with client_factory(curve=args.ecdsa_curve_name) as conn: File "/usr/lib/python2.7/site-packages/onlykey_agent/client.py", line 28, in init self.ok = OnlyKey() File "/usr/lib/python2.7/site-packages/onlykey/client.py", line 162, in init raise e onlykey.client.OnlyKeyUnavailableException

After disconnecting from host A, the connection to host B works as expected.

Additional: OnlyKey Color, Firmware Beta 6 STD onlykey-agent Arch Linux, 4.14.21-1-lts

Also, the --debug flag spits out exactly the same stack as without.

Original Google Group Thread: https://groups.google.com/forum/#!category-topic/onlykey/ssh-and-pgpgpg/vJcJsISkjPc