[Pcsclite-cvs-commit] r6570 - /trunk/Drivers/ccid/src/commands.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Mar 14 09:12:48 UTC 2013


Author: rousseau
Date: Thu Mar 14 09:12:47 2013
New Revision: 6570

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6570
Log:
Add support of time extension for Escape commands

An CCID Escape command can now use the time extension request mechanism
to ask for more time.

Fixes Alioth bug [#314061] Time extension request and escape command

Thanks to Rachid HARBI-ASSYSTEM for the feature request

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=6570&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/commands.c (original)
+++ trunk/Drivers/ccid/src/commands.c Thu Mar 14 09:12:47 2013
@@ -855,6 +855,8 @@
 		goto end;
 	}
 
+time_request:
+	length_out = 10 + *RxLength;
 	res = ReadPort(reader_index, &length_out, cmd_out);
 
 	/* replay the command if NAK
@@ -883,6 +885,12 @@
 		DEBUG_CRITICAL2("Not enough data received: %d bytes", length_out);
 		return_value = IFD_COMMUNICATION_ERROR;
 		goto end;
+	}
+
+	if (cmd_out[STATUS_OFFSET] & CCID_TIME_EXTENSION)
+	{
+		DEBUG_COMM2("Time extension requested: 0x%02X", cmd_out[ERROR_OFFSET]);
+		goto time_request;
 	}
 
 	if (cmd_out[STATUS_OFFSET] & CCID_COMMAND_FAILED)




More information about the Pcsclite-cvs-commit mailing list