Hi Jean-Michel,
Pragmatic response:
if the patch work for you, you should use it.
Wordy response:
I don't know who is responsible for approval to any change on libccid.
Either this mailing list would endorse it and the leak of replies is
puzzling or you are posting at the wrong place.
Some years ago, working with (contact) cards slower than 115 kpbs was
yet a bad idea, nowadays I'll hardly imagine to work with (contact) card
slower than 307 (or 614) kbps; so obviously working at 10752bps shall
not exist, if the fault comes from too cheap readers throw them, if
libccid missed an obvious test, patch it as it is required for your
needs ... at least until a collective consciousness is emerging.
Rgds,
Sylvain.
Le 06/05/2011 10:32, Jean-Michel Pouré - GOOZE a écrit :
Le mercredi 04 mai 2011 à 11:13 +0200, Jean-Michel Pouré - GOOZE a
écrit :
Any comments on this patch?
Let us discuss this patch (and maybe find a better one):
1) What happens in current libccid
ifhandler.c, lines 807 and further
*************************
/* if the card does not try to lower the default speed */
if ((card_baudrate> default_baudrate)
/* and the reader is fast enough */
&& (card_baudrate<= ccid_desc->dwMaxDataRate))
{
/* the reader has no baud rates table */
if ((NULL == ccid_desc->arrayOfSupportedDataRates)
/* or explicitely support it */
|| find_baud_rate(card_baudrate,
ccid_desc->arrayOfSupportedDataRates)
*************************
When connecting to smartcard, libccid will compare:
* card_baudrate the speed of card.
* ccid_desc->dwMaxDataRate the maximum speed of smartcard.
If card_baudrate is inferior to ccid_desc->dwMaxDataRate, libccid will
look for a rate matrix and use the best speed. If there is no speed
matrix, it will assume that smartcard reader can connect at
card_baudrate.
Some readers announce to be able to set speed automatically:
dwFeatures: 20 Automatic baud rate change according to frequency and Fi,
Di
But ccid_desc->arrayOfSupportedDataRates is not null
Example:
http://pcsclite.alioth.debian.org/ccid/readers/Feitian_SCR310.txt
****
dwDataRate: 10752 bps
dwMaxDataRate: 600000 bps
bNumDataRatesSupported: 0 (will use whatever is returned)
Support 10752 bps
*****
Is this case, the reader speed is limited to 10752 bps.
2) A possible solution
We added a test on ccid_desc->dwFeatures& CCID_CLASS_AUTO_BAUD
/* sartcard reader supports auto baud */
|| (ccid_desc->dwFeatures& CCID_CLASS_AUTO_BAUD))
If a reader is able to set baud rate automatically,
we assume it can connect at card speed.
3) A better patch
My knowledge in libccid is small.
Please help if you know a better patch.
Kind regards,
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle