[Pcsclite-cvs-commit] r3353 - /trunk/Drivers/ccid/src/commands.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Fri Mar 20 16:04:16 UTC 2009
Author: rousseau
Date: Fri Mar 20 16:04:16 2009
New Revision: 3353
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3353
Log:
SecurePINVerify() and SecurePINModify(): correctly restore the
communication timeout if sending the command fails
Modified:
trunk/Drivers/ccid/src/commands.c
Modified: trunk/Drivers/ccid/src/commands.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/commands.c?rev=3353&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/commands.c (original)
+++ trunk/Drivers/ccid/src/commands.c Fri Mar 20 16:04:16 2009
@@ -399,7 +399,10 @@
ccid_descriptor -> readTimeout = max(30, TxBuffer[0]+10); /* at least 30 seconds */
if (WritePort(reader_index, a, cmd) != STATUS_SUCCESS)
- return IFD_COMMUNICATION_ERROR;
+ {
+ ret = IFD_COMMUNICATION_ERROR;
+ goto end;
+ }
ret = CCID_Receive(reader_index, RxLength, RxBuffer, NULL);
@@ -424,6 +427,7 @@
}
}
+end:
ccid_descriptor -> readTimeout = old_read_timeout;
return ret;
} /* SecurePINVerify */
@@ -620,7 +624,10 @@
ccid_descriptor -> readTimeout = max(30, TxBuffer[0]+10); /* at least 30 seconds */
if (WritePort(reader_index, a, cmd) != STATUS_SUCCESS)
- return IFD_COMMUNICATION_ERROR;
+ {
+ ret = IFD_COMMUNICATION_ERROR;
+ goto end;
+ }
ret = CCID_Receive(reader_index, RxLength, RxBuffer, NULL);
@@ -645,6 +652,7 @@
}
}
+end:
ccid_descriptor -> readTimeout = old_read_timeout;
return ret;
} /* SecurePINModify */
More information about the Pcsclite-cvs-commit
mailing list