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

Major changes for all cards that needs developer review #850

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a78bc32
Set PIN-PUK association for cards that don't have it set
maciejsszmigiero Aug 13, 2016
ac2412d
Print size_t variables on properly on Windows
maciejsszmigiero Sep 28, 2016
5ce4937
Make minidriver installer custom action library optional
maciejsszmigiero Aug 25, 2016
2ae5f93
Make minidriver buildable again on mingw
maciejsszmigiero Jan 25, 2017
3f49d9b
Fix most of warnings shown when building on Linux and mingw
maciejsszmigiero Jan 25, 2017
435a4a0
Move SM test in configure.ac after LIB_PRE and DYN_LIB_EXT assignment
maciejsszmigiero Oct 22, 2016
31c63c2
Add session handle uniqueness check to PKCS#11 C_OpenSession()
maciejsszmigiero Aug 25, 2016
b83a806
Add multiple PINs support to minidriver
maciejsszmigiero Aug 25, 2016
480b442
Add reset operation to opensc-tool
maciejsszmigiero Aug 23, 2016
db5e03c
Provide notification about and handle card resets by other contexts
maciejsszmigiero Jan 28, 2017
8e4941b
Add ptrdiff_t (pointer difference) printf length modifier
maciejsszmigiero Aug 23, 2016
1b56dba
Remove logprintf() mingw hack in minidriver
maciejsszmigiero Aug 23, 2016
2a9e175
Support PIN unblocking in minidriver via PUK as response to challenge
maciejsszmigiero Aug 25, 2016
f2df771
Keep track of card resets by other contexts in minidriver
maciejsszmigiero Jan 28, 2017
4678706
Add GCC format checking attributes to log functions
maciejsszmigiero Aug 24, 2016
ee6d7f2
Fix log messages format and parameter issues flagged by GCC
maciejsszmigiero Jan 1, 2017
35efa57
Fix cases of log function format strings not being a string literal
maciejsszmigiero Aug 26, 2016
ee8f1cc
Use built-in formatted output functions on mingw
maciejsszmigiero Jan 28, 2017
6f2bbf5
Add GCC format checking attributes to minidriver logging function
maciejsszmigiero Sep 30, 2016
00478c8
Fix minidriver log messages format and parameter issues flagged by GCC
maciejsszmigiero Oct 1, 2016
5128d0d
Minidriver CardGetChallenge() parameters are output only
maciejsszmigiero Oct 1, 2016
5deedf3
Minidriver CardReadFile() parameters are optional
maciejsszmigiero Oct 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Keep track of card resets by other contexts in minidriver
Most of the cards supported by OpenSC do not support the "logout" method
required to deauthenticate a card.

This means that the only way to deauthenticate the card without removing it
from reader is to reset it.

This is done by Base CSP if we return SCARD_E_UNSUPPORTED_FEATURE from
CardDeauthenticate() in minidriver, which we do if calling "logout" card
method fails.

If this happens, all users of this card will lose its state and at least
some cards (OpenPGP card and cards having multiple applets) will be
non-functional in currently active minidriver contexts as they need some
initialization after reset.

This makes it really hard to use card from multiple applications as some
Windows libraries (like WinHTTP used by IE and WebDAV client) prefer to
deauthenticate card after only a few seconds of inactivity (with PIN cached
for future operations).

Keep a list (critical section protected) of other minidriver contexts which
are using this reader (and so this card) to make sure all of them will be
reinitialized after the card is reset by Base CSP or some other user.

There are other reasons (like card handles changed) where a card needs to
be reinitialized, too.

This solution isn't most optimal possible, but at least makes these cards
work properly - for more detailed discussion about card reset issue please
have a look at description of commit "Provide notification about and handle
card resets by other contexts".

Signed-off-by: Maciej S. Szmigiero <[email protected]>
  • Loading branch information
maciejsszmigiero committed Jan 28, 2017
commit f2df771049af1a7261ed2ba92a19e5d7b3c2552a
1 change: 1 addition & 0 deletions src/minidriver/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src
opensc_minidriver@LIBRARY_BITNESS@_la_SOURCES = minidriver.c minidriver.exports versioninfo-minidriver.rc
opensc_minidriver@LIBRARY_BITNESS@_la_LIBADD = \
$(top_builddir)/src/libopensc/libopensc.la \
$(top_builddir)/src/common/libcompat.la \
$(OPTIONAL_OPENSSL_LIBS) \
-lbcrypt -lcrypt32 -lrpcrt4
opensc_minidriver@LIBRARY_BITNESS@_la_LDFLAGS = $(AM_LDFLAGS) \
Expand Down
3 changes: 2 additions & 1 deletion src/minidriver/Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ TARGET = opensc-minidriver.dll
OBJECTS = minidriver.obj versioninfo-minidriver.res
LIBS = $(TOPDIR)\src\libopensc\opensc_a.lib \
$(TOPDIR)\src\pkcs15init\pkcs15init.lib \
$(TOPDIR)\src\common\libscdl.lib
$(TOPDIR)\src\common\libscdl.lib \
$(TOPDIR)\src\common\common.lib

all: $(TARGET)

Expand Down
Loading