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

fido2 list-credentials: Skip enumerating RPs when empty #360

Merged
merged 1 commit into from
May 10, 2023

Conversation

robin-nitrokey
Copy link
Member

If we know that the credentials count is zero, we don’t have to enumerate RPs. This works around an issue with the Nitrokey FIDO2 not including the totalRPs field in the enumeration response if it is zero.

Fixes: #336

@szszszsz Can you please test this change with a FIDO2 without credentials? I don’t have a development FIDO2 device.

Checklist

  • tested with Python3.9
  • run make check or make fix for the formatting check
  • signed commits
  • updated documentation (e.g. parameter description, inline doc, docs.nitrokey)
  • added labels

If we know that the credentials count is zero, we don’t have to
enumerate RPs.  This works around an issue with the Nitrokey FIDO2 not
including the totalRPs field in the enumeration response if it is zero.

Fixes: #336
@robin-nitrokey robin-nitrokey added the device/Nitrokey FIDO2 Concerns Nitrokey FIDO2 label Mar 28, 2023
@szszszsz szszszsz self-assigned this Mar 28, 2023
@szszszsz
Copy link
Member

Works. Tested with empty NK FIDO2 on the current master and this PR:

master $ ./venv/bin/nitropy fido2 list-credentials
Command line tool to interact with Nitrokey devices 0.4.36
Please provide pin:
Critical error:
An unhandled exception occurred
        Exception encountered: KeyError(<RESULT.TOTAL_RPS: 5>)

--------------------------------------------------------------------------------
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.oxpe2_yj' with any support/help request!
- Please check if you have udev rules installed: https://docs.nitrokey.com/nitrokey3/linux/firmware-updat
.html#troubleshooting

~/w/pynitrokey (master|✔) [1]$ gh pr checkout 360
Switched to branch 'list-credentials-total'
Your branch is up to date with 'origin/list-credentials-total'.
Already up to date.
~/w/pynitrokey (list-credentials-total|✔) $ ./venv/bin/nitropy fido2 list-credentials
Command line tool to interact with Nitrokey devices 0.4.35
Please provide pin:
There are no registered credentials
There is an estimated amount of 50 credential slots left
~/w/pynitrokey (list-credentials-total|✔) $

@szszszsz szszszsz merged commit 9141c09 into master May 10, 2023
@szszszsz szszszsz deleted the list-credentials-total branch May 10, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device/Nitrokey FIDO2 Concerns Nitrokey FIDO2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FIDO2 list-credentials fails
2 participants