[Pcsclite-cvs-commit] Drivers/ccid/src commands.c,1.19,1.20
rousseau@haydn.debian.org
rousseau@haydn.debian.org
Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv24438
Modified Files:
commands.c
Log Message:
CmdXfrBlockTPDU_T1(): use the T=1 TPDU layer from opensc/ instead of towitoko/
Index: commands.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/commands.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- commands.c 30 Jun 2004 13:23:42 -0000 1.19
+++ commands.c 30 Jun 2004 13:25:03 -0000 1.20
@@ -511,32 +511,13 @@
unsigned char tx_buffer[], unsigned int *rx_length,
unsigned char rx_buffer[])
{
- RESPONSECODE return_value;
- APDU_Cmd cmd;
- APDU_Rsp rsp;
+ RESPONSECODE return_value = IFD_SUCCESS;
DEBUG_COMM2("T=1: %d bytes", tx_length);
- /* set up command APDU */
- cmd.command = tx_buffer;
- cmd.length = tx_length;
-
- return_value = Protocol_T1_Command(&((get_ccid_slot(lun)) -> t1), &cmd,
- &rsp);
-
- if (return_value == PROTOCOL_T1_OK)
- {
- return_value = IFD_SUCCESS;
-
- /* copy the response */
- memcpy(rx_buffer, rsp.response, rsp.length);
-
- /* free the allocated response buffer */
- free(rsp.response);
+ *rx_length = t1_transceive(&((get_ccid_slot(lun)) -> t1), 0, tx_buffer, tx_length, rx_buffer, *rx_length);
- *rx_length = rsp.length;
- }
- else
+ if (*rx_length < 0)
{
*rx_length = 0;
return_value = IFD_COMMUNICATION_ERROR;