-
Notifications
You must be signed in to change notification settings - Fork 709
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
opensc-notify endless loops #1903
Comments
Hmm, I see the problem. Basically, the current logic is too simple to realize the functionality that's promised with pcsc_wait_for_event should run SCardGetStatusChange with all known readers (including known states) and Anyway, that's quite a complex change, that needs some time to implement. I'm not sure when I'll have time to do that... |
No problem. I do not think it is very urgent, but I wanted to keep track of this issue here. Especially if we want to make the notify more useful. From my experience it somehow works for me in my Ubuntu, but I had hard time to get even some notifications in Fedora, especially from opensc tools for some reason. For now, we are building opensc without notify support in Fedora (it started as it was missing some dependencies in past releases, but when I tried to enable it, we hit few issues including this one so we left it disabled). Other nice option would be some possibility to make a decision about notifications at run time either through configuration or simply by presence of the notification binary, where the notifications would always go through the separate binary (possibly configured through some environment variable?). The use case would be to have the notification support split in separate subpackage, which would depend on the gio/gnome/desktop things, while the opensc itself would be headless without notification dependencies. |
Improving the notifications in general would be a seperate issue. For one, I think that the runtime/building requirements are already quite minimal; it just needs libgio (which just implements IPC with dbus...). Anyway, there's sure room for improvement. |
- allows re-attatching a reader to an existing reader object by resetting the SC_READER_REMOVED flag - readers that are flagged with SC_READER_REMOVED are not used for SCardGetStatusChange to avoid SCARD_E_UNKNOWN_READER fixes OpenSC#1903
I've drafted a change here, which works in PKCS#11 and Linux. However, macOS is still buggy and Windows is untested... |
From my fast re-read, it looks good. It would be great if you could create a PR and somebody with Mac/Windows could test it. |
- allows re-attatching a reader to an existing reader object by resetting the SC_READER_REMOVED flag - readers that are flagged with SC_READER_REMOVED are not used for SCardGetStatusChange to avoid SCARD_E_UNKNOWN_READER fixes OpenSC#1903
Problem Description
While playing with the
opensc-notify
, I noticed it ends up in infinite loop in case I plug out my yubikey and start the daemon (first log).Similarly, there is an issue when the daemon is started while yubikey connected. The disconnect of yubikey causes the
opensc-notify
deamon to exit (theSCardGetStatusChange
returnsSCARD_E_UNKNOWN_READER
). The reader is not removed from the reader list when the removal is detected and in the next round it is failing as it does not know this reader.Proposed Resolution
The inifinite loop should be probably solved with the following patch:
but I am not sure about the other issue. I tried to put something together, but it did not work so far.
Steps to reproduce
opensc-notify
daemon. It will end in infinite loopopensc-notify
and then disconnect the reader. It will exit with errors.Logs
Removal:
The text was updated successfully, but these errors were encountered: