[Pcsclite-git-commit] [PCSC] 01/01: SCardDisconnect(): fix ATR update for SCARD_UNPOWER_CARD
Ludovic Rousseau
rousseau at moszumanska.debian.org
Fri May 12 13:37:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository PCSC.
commit 70468bfaa08eae5715312de43aecb873a2df115f
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date: Fri May 12 15:16:34 2017 +0200
SCardDisconnect(): fix ATR update for SCARD_UNPOWER_CARD
When the card is disconnected with SCARD_RESET_CARD or
SCARD_UNPOWER_CARD then disable the current ATR early in the code and in
all cases.
The problem was that the ATR was disabled only in the case
SCARD_RESET_CARD and only in case of failure.
So if SCARD_UNPOWER_CARD was used the ATR was still considered as valid,
even if the card was no more powered.
---
src/winscard.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/winscard.c b/src/winscard.c
index 06bc377..44821ea 100644
--- a/src/winscard.c
+++ b/src/winscard.c
@@ -883,6 +883,9 @@ LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
{
DWORD dwAtrLen;
+ /* invalidate ATR */
+ rContext->readerState->cardAtrLength = 0;
+
/*
* Notify the card has been reset
*/
@@ -937,7 +940,6 @@ LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
}
else
{
- rContext->readerState->cardAtrLength = 0;
Log1(PCSC_LOG_ERROR, "Error resetting card.");
if (rv == SCARD_W_REMOVED_CARD)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git
More information about the Pcsclite-cvs-commit
mailing list