GoogleChromeLabs / chromeos_smart_card_connector

Smart Card Connector App for Chrome OS
https://chrome.google.com/webstore/detail/smart-card-connector/khpfeaanjngmcnplbdlpegiifgpfgdco
Apache License 2.0
133 stars 50 forks source link

Cherry-pick CCID fix for 10-min hang on shutdown #1079

Closed emaxx-google closed 9 months ago

emaxx-google commented 9 months ago

Apply the fix that was submitted upstream: https://github.com/LudovicRousseau/CCID/pull/116.

This fixes #1078.

github-actions[bot] commented 9 months ago

Continuous Integration: All tests passed. C/C++ test coverage: 72.04% lines.

emaxx-google commented 8 months ago

I suspect this PR might've caused some regressions we've observed in production... Apparently it's possible for the driver to re-start the interrupt transfer USB communication after stopping it previously, however this commit makes it impossible. This makes the CCID code fall back from the interrupt-based detection (with 10-minute timeout) to a quick polling-based detection (with 400 ms timeout), which in turn combined with the old issue #1104 means that we open too many concurrent USB transfers and eventually break after a few hours.