Hi all,
I am trying to setup my RSA SSH key with my OnlyKey but can’t get it to work.
Adding OpenGPG keys seem to work as expected (although it is a while back that I used that). Using a derived key also works.
Adding the RSA key using the GUI works, though when I run onlykey-agent
to obtain the fingerprint I notice it is different from the one I already use with SSH. is that expected?
I need to use RSA with SSH as it is the only thing some the devices I need to connect to support unfortunately.
When I try to connect I see that onlykey-agent
complaints about the key-size:
% onlykey-agent -e rsa2048 -sk RSA3 me@my.net -s
% ssh myhost
Enter the 3 digit challenge code on OnlyKey to authorize <ssh://me@my.net|rsa2048>
6 1 5
2022-10-26 00:52:27,017 ERROR signature with "<ssh://me@my.net|rsa2048>" key failed [protocol.py:152]
Traceback (most recent call last):
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/device/onlykey.py", line 344, in sign
sig_part = self.ok.read_bytes(timeout_ms=100)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/onlykey/client.py", line 416, in read_bytes
raise RuntimeError('Error with RSA data to sign invalid size')
RuntimeError: Error with RSA data to sign invalid size
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/protocol.py", line 148, in sign_message
signature = self.conn.sign(blob=blob, identity=key['identity'])
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/__init__.py", line 246, in sign
return conn.sign_ssh_challenge(blob=blob, identity=identity)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/client.py", line 54, in sign_ssh_challenge
return self.device.sign(blob=blob, identity=identity)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/device/onlykey.py", line 354, in sign
raise interface.DeviceError(e)
libagent.device.interface.DeviceError: Error with RSA data to sign invalid size
sign_and_send_pubkey: signing failed for RSA "<ssh://me@my.net|rsa2048>" from agent: communication with agent failed
2022-10-26 00:52:27,019 WARNING error: Error with RSA data to sign invalid size [server.py:100]
Traceback (most recent call last):
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/device/onlykey.py", line 344, in sign
sig_part = self.ok.read_bytes(timeout_ms=100)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/onlykey/client.py", line 416, in read_bytes
raise RuntimeError('Error with RSA data to sign invalid size')
RuntimeError: Error with RSA data to sign invalid size
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/server.py", line 95, in handle_connection
reply = handler.handle(msg=msg)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/protocol.py", line 106, in handle
reply = method(buf=buf)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/protocol.py", line 148, in sign_message
signature = self.conn.sign(blob=blob, identity=key['identity'])
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/__init__.py", line 246, in sign
return conn.sign_ssh_challenge(blob=blob, identity=identity)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/ssh/client.py", line 54, in sign_ssh_challenge
return self.device.sign(blob=blob, identity=identity)
File "/usr/local/Cellar/onlykey-agent/1.1.14_1/libexec/lib/python3.10/site-packages/libagent/device/onlykey.py", line 354, in sign
raise interface.DeviceError(e)
libagent.device.interface.DeviceError: Error with RSA data to sign invalid size
2022-10-26 00:52:27,036 WARNING Unsupported command: SSH2_AGENTC_ADD_IDENTITY (17) [protocol.py:101]
I know it is a 2048 bit key (as that is what OpenSSH and OpenSSL both tell me) .
I am using OnlyKey App v5.3.6 and an OnlyKey DUO with firmwar v3.0.2-prodn with the latest version of onlykey-agent
installed on MacOS with brew install onlykey-agent
. Does anyone have any idea what I am missing here? Is this supposed to work?
regards,
Frederik