1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-06-14 18:31:03 +02:00

Untested fix for TPDU level exchange of large data (command chaining)

This commit is contained in:
Werner Koch 2008-09-23 10:36:09 +00:00
parent f899b9683b
commit 2693db33d0
2 changed files with 9 additions and 4 deletions

View File

@ -9,6 +9,7 @@
(send_le): Implement command chaining. (send_le): Implement command chaining.
* ccid-driver.c (ccid_transceive_apdu_level): Increase allowed * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
APDU size. APDU size.
(ccid_transceive): Alow for APDUS of up to 259 bytes.
* apdu.h: Add new SW_ codes. * apdu.h: Add new SW_ codes.
2008-09-16 Werner Koch <wk@g10code.com> 2008-09-16 Werner Koch <wk@g10code.com>

View File

@ -1971,8 +1971,9 @@ ccid_transceive_apdu_level (ccid_driver_t handle,
apdulen = apdu_buflen; apdulen = apdu_buflen;
assert (apdulen); assert (apdulen);
/* The maximum length for a short APDU T=1 block is 261, for an /* The maximum length for a short APDU T=1 block is 261. For an
extra APDU T=1 block is 65544. */ extended APDU T=1 block the maximum length 65544; however
extended APDU exchange levele is not yet supported. */
if (apdulen > 261) if (apdulen > 261)
return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */ return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */
@ -2119,8 +2120,11 @@ ccid_transceive (ccid_driver_t handle,
assert (apdulen); assert (apdulen);
/* Construct an I-Block. */ /* Construct an I-Block. */
#warning fixme: APDULEN may be larger /* Fixme: I am not sure whether limiting the length to 259
if (apdulen > 254) as per CCID spec is required. The code blow chops the
APDU anyway into 128 byte blocks. Needs to be addressed
when supporting extended length APDUs. */
if (apdulen > 259)
return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */ return CCID_DRIVER_ERR_INV_VALUE; /* Invalid length. */
tpdu = msg+10; tpdu = msg+10;