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

Yubikey Touch U2F Security Key #2

Open
silpol opened this issue Jan 21, 2023 · 0 comments
Open

Yubikey Touch U2F Security Key #2

silpol opened this issue Jan 21, 2023 · 0 comments

Comments

@silpol
Copy link

silpol commented Jan 21, 2023

looks like data parser has issues in case of unexpected response

hardware in question is - Yubikey Touch U2F Security Key

after installation on Ubuntu 20.04 LTS into venv space:

$ pip install lshid
Collecting lshid
  Downloading lshid-0.2.2-py3-none-any.whl (5.0 kB)
Collecting ioctl
  Downloading ioctl-0.2.2-py3-none-any.whl (4.4 kB)
Collecting hid-parser~=0.0.2
  Downloading hid_parser-0.0.3-py3-none-any.whl (22 kB)
Installing collected packages: ioctl, hid-parser, lshid
Successfully installed hid-parser-0.0.3 ioctl-0.2.2 lshid-0.2.2

running lshid gives

$ lshid
can't open '/dev/hidraw2': [Errno 13] Permission denied: '/dev/hidraw2'
can't open '/dev/hidraw1': [Errno 13] Permission denied: '/dev/hidraw1'
can't open '/dev/hidraw0': [Errno 13] Permission denied: '/dev/hidraw0'
Device /dev/hidraw3: ID 1050:0120 Yubico Security Key by Yubico

while running lsusb gives:

$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 06cb:00bd Synaptics, Inc. 
Bus 001 Device 003: ID 04f2:b67c Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 019: ID 1050:0120 Yubico.com Yubikey Touch U2F Security Key
Bus 001 Device 016: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 8087:0aaa Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

now if I run lsusb with sudo and -vvv keys on specific device (so I get maximum HW access and verbose details):

$ sudo lsusb -vvv -s 1:19

Bus 001 Device 019: ID 1050:0120 Yubico.com Yubikey Touch U2F Security Key
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1050 Yubico.com
  idProduct          0x0120 Yubikey Touch U2F Security Key
  bcdDevice            5.27
  iManufacturer           1 Yubico
  iProduct                2 Security Key by Yubico
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               30mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      34
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               2
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

while running lshid on specific devise, instead of same or more detailed output, it gives:

$ lshid -v -s 3
Device /dev/hidraw3: ID 1050:0120 Yubico Security Key by Yubico
Report Descriptor:
ERROR Expecting 64 usages but got 1

provided it sees it properly as ID, it's properly pointed HW device
is that parser mistake? should I uptick version of hid-parser?
or any other hint?

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

No branches or pull requests

1 participant