[Pcsclite-cvs-commit] Drivers/ccid/src/towitoko pps.c,1.5,1.6 pps.h,1.3,1.4
rousseau@haydn.debian.org
rousseau@haydn.debian.org
Update of /cvsroot/pcsclite/Drivers/ccid/src/towitoko
In directory haydn:/tmp/cvs-serv11103
Modified Files:
pps.c pps.h
Log Message:
PPS_Exchange() has a new argument (unsigned char *pps1) which is the
PPS1 returned by the card (TA1 the card wants to use)
Index: pps.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/towitoko/pps.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pps.c 30 Jun 2004 14:00:19 -0000 1.5
+++ pps.c 30 Jun 2004 14:02:54 -0000 1.6
@@ -42,7 +42,7 @@
static BYTE PPS_GetPCK (BYTE * block, unsigned length);
int
-PPS_Exchange (int lun, BYTE * params, unsigned *length)
+PPS_Exchange (int lun, BYTE * params, unsigned *length, unsigned char *pps1)
{
BYTE confirm[PPS_MAX_LENGTH];
unsigned len_request, len_confirm;
@@ -70,6 +70,12 @@
ret = PPS_HANDSAKE_ERROR;
else
ret = PPS_OK;
+
+ *pps1 = 0x11; /* default TA1 */
+
+ /* if PPS1 is echoed */
+ if (PPS_HAS_PPS1 (params) && PPS_HAS_PPS1 (confirm))
+ *pps1 = confirm[2];
/* Copy PPS handsake */
memcpy (params, confirm, len_confirm);
Index: pps.h
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/towitoko/pps.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pps.h 30 Jun 2004 13:57:33 -0000 1.3
+++ pps.h 30 Jun 2004 14:02:54 -0000 1.4
@@ -64,6 +64,7 @@
* Exported functions declaration
*/
-int PPS_Exchange (int lun, BYTE * params, unsigned *length);
+int PPS_Exchange (int lun, BYTE * params, unsigned *length, unsigned char *pps1);
#endif /* _PPS_ */
+