[Pcsclite-cvs-commit] r1859 - trunk/Drivers/ccid/src
Ludovic Rousseau
rousseau at costa.debian.org
Mon Feb 6 15:26:29 UTC 2006
Author: rousseau
Date: 2006-02-06 15:26:28 +0000 (Mon, 06 Feb 2006)
New Revision: 1859
Modified:
trunk/Drivers/ccid/src/commands.c
Log:
SecurePINVerify(): move the prologue filing part to be homogenous with
SecurePINModify()
Modified: trunk/Drivers/ccid/src/commands.c
===================================================================
--- trunk/Drivers/ccid/src/commands.c 2006-02-06 15:23:41 UTC (rev 1858)
+++ trunk/Drivers/ccid/src/commands.c 2006-02-06 15:26:28 UTC (rev 1859)
@@ -210,6 +210,32 @@
}
#endif
+ /* T=1 Protocol Management for a TPDU reader */
+ if ((SCARD_PROTOCOL_T1 == ccid_descriptor->cardProtocol)
+ && (CCID_CLASS_TPDU == (ccid_descriptor->dwFeatures & CCID_CLASS_EXCHANGE_MASK)))
+ {
+ ct_buf_t sbuf;
+ unsigned char sdata[T1_BUFFER_SIZE];
+
+ /* Initialize send buffer with the APDU */
+ ct_buf_set(&sbuf,
+ (void *)(TxBuffer + offsetof(PIN_VERIFY_STRUCTURE, abData)),
+ TxLength - offsetof(PIN_VERIFY_STRUCTURE, abData));
+
+ /* Create T=1 block */
+ ret = t1_build(&((get_ccid_slot(reader_index))->t1),
+ sdata, 0, T1_I_BLOCK, &sbuf, NULL);
+
+ /* Increment the sequence numbers */
+ get_ccid_slot(reader_index)->t1.ns ^= 1;
+ get_ccid_slot(reader_index)->t1.nr ^= 1;
+
+ /* Copy the generated T=1 block prologue into the teoprologue
+ * of the CCID command */
+ memcpy(TxBuffer + offsetof(PIN_VERIFY_STRUCTURE, bTeoPrologue),
+ sdata, 3);
+ }
+
/* Build a CCID block from a PC/SC V2.1.2 Part 10 block */
for (a = 11, b = 0; b < TxLength; b++)
{
@@ -246,31 +272,6 @@
}
}
- /* T=1 Protocol Management for a TPDU reader */
- if ((SCARD_PROTOCOL_T1 == ccid_descriptor->cardProtocol)
- && (CCID_CLASS_TPDU == (ccid_descriptor->dwFeatures & CCID_CLASS_EXCHANGE_MASK)))
- {
- ct_buf_t sbuf;
- unsigned char sdata[T1_BUFFER_SIZE];
-
- /* Initialize send buffer with the APDU */
- ct_buf_set(&sbuf,
- (void *)(TxBuffer + offsetof(PIN_VERIFY_STRUCTURE, abData)),
- TxLength - offsetof(PIN_VERIFY_STRUCTURE, abData));
-
- /* Create T=1 block */
- ret = t1_build(&((get_ccid_slot(reader_index))->t1),
- sdata, 0, T1_I_BLOCK, &sbuf, NULL);
-
- /* Increment the sequence numbers */
- get_ccid_slot(reader_index)->t1.ns ^= 1;
- get_ccid_slot(reader_index)->t1.nr ^= 1;
-
- /* Copy the generated T=1 block prologue into the teoprologue
- * of the CCID command */
- memcpy(cmd+22, sdata, 3);
- }
-
i2dw(a - 10, cmd + 1); /* CCID message length */
old_read_timeout = ccid_descriptor -> readTimeout;
More information about the Pcsclite-cvs-commit
mailing list