Yubico / libfido2

Provides library functionality for FIDO2, including communication with a device over USB or NFC.
Other
581 stars 153 forks source link

osx: handle report_callback() firing multiple times #762

Closed LDVG closed 8 months ago

LDVG commented 8 months ago

One invocation of CFRunLoopRunInMode() may fire report_callback() multiple times. In such a case, the next call to fido_hid_read() may block for the full duration of the timeout. We can handle this by querying the (non-blocking) pipe for any readily available data on entering fido_hid_read() and fall back to executing the run loop if it was empty.

Debugged with @elibon99 and @martelletto.

Resolves #763

martelletto commented 8 months ago

it might make sense to bump the copyright in hid_osx.c; otherwise LGTM