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

ykman 5.4.0 crashes on fido set-min-length when FIDO PIN is not supported #608

Closed
disconnect3d opened this issue Apr 11, 2024 · 1 comment

Comments

@disconnect3d
Copy link

disconnect3d commented Apr 11, 2024

  • YubiKey Manager (ykman) version: 5.4.0
  • How was it installed?: installed from Homebrew (Homebrew formula)
  • Operating system and version: macOS Sonoma 14.2
  • YubiKey model and version: Yubikey 5C Nano, firmware 4.3.7
  • Bug description summary: the ykman fido access set-min-length 4 crashes

Steps to reproduce

$ ykman --version
YubiKey Manager (ykman) version: 5.4.0

$ ykman info
Device type: YubiKey 4
Serial number: <redacted>
Firmware version: 4.3.7
Enabled USB interfaces: OTP, FIDO, CCID

Applications
Yubico OTP  	Enabled
FIDO U2F    	Enabled
FIDO2       	Not available
OATH        	Enabled
PIV         	Enabled
OpenPGP     	Enabled
YubiHSM Auth	Not available

$ ykman fido access set-min-length 4
ERROR: An unexpected error has occurredTraceback (most recent call last):
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/ykman/_cli/__main__.py", line 421, in main
    cli(obj={})
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/ykman/_cli/fido.py", line 525, in set_min_pin_length
    info = ctx.obj["ctap2"].info
           ~~~~~~~^^^^^^^^^
  File "/usr/local/Cellar/ykman/5.4.0/libexec/lib/python3.12/site-packages/ykman/_cli/util.py", line 198, in __getitem__
    return self._objects[key]
           ~~~~~~~~~~~~~^^^^^
KeyError: 'ctap2'

Expected result

Since this firmware version does not support FIDO PIN, setting min length for it does not make sense.

I expected a similar error as here:

$ ykman fido access verify-pin
ERROR: This YubiKey does not support a FIDO PIN.
@disconnect3d disconnect3d changed the title ykman 5.4.0 crash on fido set-min-length when FIDO PIN is not supported ykman 5.4.0 crashes on fido set-min-length when FIDO PIN is not supported Apr 11, 2024
@dainnilsson
Copy link
Member

This is resolved in the latest version (5.5.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants