Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list-credentials exception #352

Closed
Sector14 opened this issue Mar 24, 2023 · 0 comments · Fixed by #359
Closed

list-credentials exception #352

Sector14 opened this issue Mar 24, 2023 · 0 comments · Fixed by #359
Labels
bug Something isn't working device/Nitrokey 3

Comments

@Sector14
Copy link

Sector14 commented Mar 24, 2023

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 [email protected] 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:


@szszszsz szszszsz added bug Something isn't working device/Nitrokey 3 labels Mar 27, 2023
robin-nitrokey added a commit that referenced this issue Mar 28, 2023
The RP name is optional when enumerating RPs using the credential
management command.  Only the id is required.  This patch changes the
fido2 list-credentials subcommand to show the id instead of the name if
the name is not set.

Fixes: #352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working device/Nitrokey 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants