md: protect MD entry points with CriticalSection

CardDeleteContext may be called at any time, interrupting any ongoing
operation with the same PCARD_DATA. This leads to a race condition when
CardDeleteContext deletes, for example, the sc_context_t which the
interrupted call still wants to access. We have seen and fixed this
problem in https://github.com/OpenSC/OpenSC/issues/973 specifically for
the PIN entry process, however, it also applies to all other calls to
the md.

The new implementation removes the need for global data in the md.
This commit is contained in:
Frank Morgner 2017-11-21 13:20:02 +01:00
parent 9583d3b650
commit d0d9b974a7

File diff suppressed because it is too large Load Diff