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

Add retry logic into reader initialization code #90

Closed
emaxx-google opened this issue Nov 29, 2019 · 0 comments
Closed

Add retry logic into reader initialization code #90

emaxx-google opened this issue Nov 29, 2019 · 0 comments

Comments

@emaxx-google
Copy link
Collaborator

Currently, the Smart Card Connector app only makes a single attempt to connect to each USB device.

We should change this to be more bulletproof by retrying the connection attempts (possibly, with an exponential backoff).

Fabian-Sommer added a commit that referenced this issue Dec 11, 2019
Fix bug #100: Previously, smartcard users could not unlock the lock screen since
the user space smartcard connector app would still own the smartcard reader.
This makes the app show no available devices when the user is locking the
screen. PCSC automatically releases devices that it used to own but no longer
show as present.

This alone is not sufficient to solve the problem. PCSC scans devices only once
every second. When locking the screen, the login-space app might already try to
access the reader before the user-space app releases it. This race condition is
fixed by issue #90: When connecting to a reader fails, we retry connecting
later. This is done by showing another Bus number for the device.
We need to fake Bus numbers anyway as chrome.usb does not let us retrieve them.
PCSC then views it as a different device from the previous one and attempts
to connect to it once a smartcard reader needs to be accessed.
Fabian-Sommer added a commit that referenced this issue Dec 11, 2019
Fabian-Sommer added a commit that referenced this issue Dec 11, 2019
When connecting to a reader fails, we retry connecting later.
This is done by showing another Bus number for the device.
We need to fake Bus numbers anyway as chrome.usb does not let us retrieve them.
PCSC then views it as a different device from the previous one and attempts
to connect to it once a smartcard reader needs to be accessed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant