-
Notifications
You must be signed in to change notification settings - Fork 155
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
hidraw: fallback to HID_NAME #769
Conversation
There was a off by one in the buffer size for the string, which the pipeline runner caught. I updated the PR accordingly. |
There are 2 warning reported by the pipelines. One is:
This should be resolved by adding a hid_name != NULL to the previous condition. The other is:
I didn't change this line in my patch though. This is in the context of |
My bad, it was in my patch after all, just the warning was slightly misleading to me. Once I ran
and then
similar to how the pipeline ran the code, the potential memory leak became apparent. I updated the PR accordingly. |
I really appreciate the static analysis in the pipeline. |
The fuzzer discovered another issue, which I think is a false positive. Nevertheless I slightly rewrote that line in copy_info to make it clear to the compiler that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for your patch. Am I correct in understanding that you mostly want to expose a friendly name of the (virtual) HID device as created by UHID_CREATE2
, e.g. when listing authenticators connected to the system?
Yes, that is exactly the point: Make the listing of connected authenticators more human-friendly for virtual hid device (using |
if we can't get the vendor/product string of the USB attributes, fallback to the HID_NAME string collected from the uevent.
I updated the PR to follow your 2 recommendations. |
Paging in @martelletto: I see that something similar to this has both been added to and removed from libfido2 previously. Do you have any additional context? |
We merged your changes with some additional tweaks on top. Thank you for your contribution! |
if we can't get the vendor/product string of the USB attributes, fallback to the HID_NAME string collected from the uevent.
This will be useful in linux when you provide a virtual fido2 device via
/dev/uhid
that emulates a USB connected HID device.