libopensc: Reveal another Belpic hack introduced in r2117.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5561 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
andre 2011-06-08 07:35:03 +00:00
parent 7cc559ec39
commit a28bacf02c
3 changed files with 6 additions and 11 deletions

View File

@ -410,11 +410,12 @@ static int do_single_transmit(sc_card_t *card, sc_apdu_t *apdu)
/* set the new expected length */
apdu->resplen = olen;
apdu->le = nlen;
/* as some reader/smartcards can't handle an immediate
* re-transmit so we optionally need to sleep for
* a while */
if (card->wait_resend_apdu != 0)
msleep(card->wait_resend_apdu);
/* Belpic V1 applets have a problem: if the card sends a 6C XX
* (only XX bytes available), and we resend the command too soon
* (i.e. the reader is too fast), the card doesn't respond. So
* we build in a delay. */
if (card->type == SC_CARD_TYPE_BELPIC_EID)
msleep(40);
/* re-transmit the APDU with new Le length */
r = card->reader->ops->transmit(card->reader, apdu);
if (r != SC_SUCCESS) {

View File

@ -931,11 +931,6 @@ static int belpic_init(sc_card_t *card)
SC_ALGORITHM_RSA_PAD_PKCS1 | SC_ALGORITHM_RSA_HASH_NONE, 0);
}
/* V1 applets have a problem: if the card sends a 6C XX (only XX bytes available),
* and we resend the command too soon (i.e. the reader is too fast), the card
* doesn't respond. So we build in a delay. */
card->wait_resend_apdu = 40;
/* State that we have an RNG */
card->caps |= SC_CARD_CAP_RNG;

View File

@ -422,7 +422,6 @@ typedef struct sc_card {
int type; /* Card type, for card driver internal use */
unsigned long caps, flags;
unsigned int wait_resend_apdu; /* Delay (msec) before responding to an SW = 6CXX */
int cla;
size_t max_send_size; /* Max Lc supported by the card */
size_t max_recv_size; /* Max Le supported by the card */