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

pkcs11: leverage sc_wait_for_event to avoid unneccesary queries to card #3126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

frankmorgner
Copy link
Member

card_detect_all() is now used as global entry point even to reader specific card detection (card_detect() is removed). This enforces a constant update of reader_states so that no events are silently dropped. This removes the need for having a timer in C_GetSlotInfo() for avoiding too many queries. If the reader implementation (i.e. reader-*.c) does not implement wait_for_event, then all slots will be queried on request just like it used to be.

fixes #3107

Checklist
  • PKCS#11 module is tested

card_detect_all() is now used as global entry point even to reader
specific card detection (card_detect() is removed). This enforces
a constant update of reader_states so that no events are silently
dropped. This removes the need for having a timer in C_GetSlotInfo() for
avoiding too many queries. If the reader implementation (i.e.
reader-*.c) does not implement wait_for_event, then all slots will be
queried on request just like it used to be.

fixes OpenSC#3107
@dengert
Copy link
Member

dengert commented Apr 24, 2024

Cool.

@Jakuje
Copy link
Member

Jakuje commented Apr 30, 2024

Code wise I do not see any issue, but some tests look like failing (even after the rerun of the previous failure) so it clearly needs some more investigation and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenSC in Firefox constantly sending SELECT(AID) APDUs for probing
3 participants