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

Not working on MacOS Catalina #15

Closed dIELERx closed 4 years ago

dIELERx commented 4 years ago

Hello, I just bought my Onlykey and wanted to start on MacOS Catalina, but it does not seem to work as expected. On my Ubuntu maschine everything works fine.

what I did sofar

I installed the Onlykey app and configured my key on MacOS. I am able to unlock it and assign keys or whatever.

But I wanted to give onlykey-agent a try to secure my SSH keys. Following https://docs.crp.to/onlykey-agent.html, I installed onlykey and onlykey-agent via pip.

Versions: onlykey-1.1.0, onlykey-agent-1.0.0

Install log

Collecting onlykey
Collecting onlykey-agent
  Downloading https://files.pythonhosted.org/packages/2a/a5/2f2ec09cd3132885647a00eada5384cd55f1bfdb7d0ef483f765bb3a66dc/onlykey_agent-1.0.0-py2-none-any.whl
Requirement already satisfied: ecdsa>=0.13 in /Library/Python/2.7/site-packages (from onlykey) (0.14.1)
Requirement already satisfied: hidapi in /Library/Python/2.7/site-packages (from onlykey) (0.7.99.post21)
Requirement already satisfied: Cython>=0.23.4 in /Library/Python/2.7/site-packages (from onlykey) (0.29.14)
Requirement already satisfied: aenum in /Library/Python/2.7/site-packages (from onlykey) (2.2.3)
Requirement already satisfied: ed25519>=1.4 in /Library/Python/2.7/site-packages (from onlykey) (1.5)
Requirement already satisfied: prompt-toolkit>=2 in /Library/Python/2.7/site-packages (from onlykey) (2.0.10)
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from onlykey) (1.12.0)
Requirement already satisfied: protobuf>=2.6.1 in /Library/Python/2.7/site-packages (from onlykey-agent) (3.11.0)
Requirement already satisfied: semver>=2.2 in /Library/Python/2.7/site-packages (from onlykey-agent) (2.9.0)
Requirement already satisfied: setuptools>=19.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from hidapi->onlykey) (41.0.1)
Requirement already satisfied: wcwidth in /Library/Python/2.7/site-packages (from prompt-toolkit>=2->onlykey) (0.1.7)
Installing collected packages: onlykey, onlykey-agent
Successfully installed onlykey-1.1.0 onlykey-agent-1.0.0

Running onlykey-agent

onlykey-agent test

2019-12-01 14:55:47,440 ERROR        failed to connect                                                                                    [client.py:192]
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 184, in _connect
    self._hid.open_path(path)
  File "hid.pyx", line 72, in hid.device.open_path
IOError: open failed
2019-12-01 14:55:48,955 ERROR        failed to connect                                                                                    [client.py:192]
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 184, in _connect
    self._hid.open_path(path)
  File "hid.pyx", line 72, in hid.device.open_path
IOError: open failed
2019-12-01 14:55:50,467 ERROR        failed to connect                                                                                    [client.py:192]
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 184, in _connect
    self._hid.open_path(path)
  File "hid.pyx", line 72, in hid.device.open_path
IOError: open failed
2019-12-01 14:55:51,978 ERROR        failed to connect                                                                                    [client.py:192]
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 184, in _connect
    self._hid.open_path(path)
  File "hid.pyx", line 72, in hid.device.open_path
IOError: open failed
2019-12-01 14:55:53,489 ERROR        failed to connect                                                                                    [client.py:192]
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 184, 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/local/bin/onlykey-agent", line 10, in <module>
    sys.exit(run_agent())
  File "/Library/Python/2.7/site-packages/onlykey_agent/__main__.py", line 123, in wrapper
    return func(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/onlykey_agent/__main__.py", line 136, in run_agent
    with client_factory(curve=args.ecdsa_curve_name) as conn:
  File "/Library/Python/2.7/site-packages/onlykey_agent/client.py", line 28, in __init__
    self.ok = OnlyKey()
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 167, in __init__
    raise e
onlykey.client.OnlyKeyUnavailableException

Running onlykey-cli

onlykey-cli

No handlers could be found for logger "onlykey.client"
Traceback (most recent call last):
  File "/usr/local/bin/onlykey-cli", line 6, in <module>
    from onlykey.cli import main
  File "/Library/Python/2.7/site-packages/onlykey/cli.py", line 20, in <module>
    only_key = OnlyKey()
  File "/Library/Python/2.7/site-packages/onlykey/client.py", line 167, in __init__
    raise e
onlykey.client.OnlyKeyUnavailableException

Am I missing something? I have my key plugged in and unlocked.

Thanks and regards

dIELER

onlykey commented 4 years ago

@dIELERx I will try and get a Catalina system to test this.

onlykey commented 4 years ago

@dIELERx I was able to try this out on Catalina. It works fine on the system I am testing on. Mac comes with python built-in but that version of python often has issues. Can you try installing a 3rd party version of python, we recommend anaconda - https://www.anaconda.com/distribution/