Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
98 stars 27 forks source link

list-credentials exception #352

Closed Sector14 closed 1 year ago

Sector14 commented 1 year ago

I've just added a ssh resident key to the NK3 and since then "fido2 list-credentials" is producing the following exception:


$ nitropy fido2 list-credentials
Command line tool to interact with Nitrokey devices 0.4.34
Please provide pin: 
There are 4 registered credentials
-----------------------------------
-----------------------------------
passkeys.io: 
[snip content of first 3 keys]
-----------------------------------
-----------------------------------
Critical error:
An unhandled exception occurred
        Exception encountered: KeyError('name')

--------------------------------------------------------------------------------
Critical error occurred, exiting now
Unexpected? Is this a bug? Would you like to get support/help?
- You can report issues at: https://support.nitrokey.com/
- Writing an e-mail to support@nitrokey.com is also possible
- Please attach the log: '/tmp/nitropy.log._si0tw0a' with any support/help request!
- Please check if you have udev rules installed: https://docs.nitrokey.com/nitrokey3/linux/firmware-update.html#troubleshooting

The first 3 keys list fine, the 4th key is the ssh key created using ssh-keygen with -O resident -O application=ssh:somename

Credential listing aside, the ssh key is valid and works when "ssh-add -K" is used. I have the log file generated and can provide on request to any of the developers, I've not attached the full content here as it contains credential ids.

Stack trace from the log

4508     WARNING pynitrokey.cli An unhandled exception occurred
Traceback (most recent call last):
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/pynitrokey/cli/__init__.py", line 130, in main
    nitropy()
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/pynitrokey/cli/fido2.py", line 239, in list_credentials
    local_print(f"{reliable_party['name']}: ")
KeyError: 'name'
4509      DEBUG       root print: Critical error:
4509      DEBUG       root print: An unhandled exception occurred
4509      ERROR       root 'name'
Traceback (most recent call last):
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/pynitrokey/cli/__init__.py", line 130, in main
    nitropy()
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/.local/pipx/venvs/pynitrokey/lib/python3.9/site-packages/pynitrokey/cli/fido2.py", line 239, in list_credentials
    local_print(f"{reliable_party['name']}: ")
KeyError: 'name'
4509      DEBUG       root listing all connected devices: