From 39f3c2b7c68eee3b4f14e153a6512e03a2749dea Mon Sep 17 00:00:00 2001 From: vtarasov Date: Mon, 14 Mar 2011 18:19:07 +0000 Subject: [PATCH] rtecp: in non-extended APDUs the 'Le' value cannot be more then 256 bytes ... after r5186 the SC_MAX_APDU_BUFFER_SIZE has been increased and so existing defintion of Le value became invalid. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5233 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/libopensc/card-rtecp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libopensc/card-rtecp.c b/src/libopensc/card-rtecp.c index 49077517..283d4d07 100644 --- a/src/libopensc/card-rtecp.c +++ b/src/libopensc/card-rtecp.c @@ -524,7 +524,7 @@ static int rtecp_list_files(sc_card_t *card, u8 *buf, size_t buflen) { apdu.resp = rbuf; apdu.resplen = sizeof(rbuf); - apdu.le = sizeof(rbuf) - 2; + apdu.le = 256; r = sc_transmit_apdu(card, &apdu); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "APDU transmit failed"); if (apdu.sw1 == 0x6A && apdu.sw2 == 0x82) @@ -595,7 +595,7 @@ static int rtecp_card_ctl(sc_card_t *card, unsigned long request, void *data) sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xCA, 0x01, 0x81); apdu.resp = buf; apdu.resplen = sizeof(buf); - apdu.le = sizeof(buf) - 2; + apdu.le = 256; serial->len = sizeof(serial->value); break; case SC_CARDCTL_RTECP_GENERATE_KEY: @@ -605,7 +605,7 @@ static int rtecp_card_ctl(sc_card_t *card, unsigned long request, void *data) genkey_data->key_id); apdu.resp = buf; apdu.resplen = sizeof(buf); - apdu.le = sizeof(buf) - 2; + apdu.le = 256; break; case SC_CARDCTL_LIFECYCLE_SET: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "%s\n",