From df639efd89d19e1b0aa14ab8ae3548dfb91444e5 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 28 Oct 2010 13:11:13 +0000 Subject: [PATCH] EstonianEid: revert to old behavior and have the T=0 forcing. Some cards have incorrect ATR-s and can cause troubles if pcsc-lite by default tries to set T=1 by default. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4834 c6295689-39f2-0310-b995-f0e70906c6a9 --- etc/opensc.conf.in | 32 ++++++++++++++++---------------- src/libopensc/card-mcrd.c | 6 ++---- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/etc/opensc.conf.in b/etc/opensc.conf.in index 7f6a3ec6..7a4d5a4f 100644 --- a/etc/opensc.conf.in +++ b/etc/opensc.conf.in @@ -212,26 +212,26 @@ app default { # paranoid. # # Warm ATR v1 - # card_atr 3b:6e:00:ff:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { - # force_protocol = t0; - # } + card_atr 3b:6e:00:ff:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { + force_protocol = t0; + } # Cold ATR v1 - # card_atr 3b:fe:94:00:ff:80:b1:fa:45:1f:03:45:73:74:45:49:44:20:76:65:72:20:31:2e:30:43 { - # force_protocol = t0; - # } + card_atr 3b:fe:94:00:ff:80:b1:fa:45:1f:03:45:73:74:45:49:44:20:76:65:72:20:31:2e:30:43 { + force_protocol = t0; + } # Warm ATR v2 - # card_atr 3b:5e:11:ff:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { - # force_protocol = t0; - # } + card_atr 3b:5e:11:ff:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { + force_protocol = t0; + } # Cold ATR v2 - # card_atr 3b:de:18:ff:c0:80:b1:fe:45:1f:03:45:73:74:45:49:44:20:76:65:72:20:31:2e:30:2b { - # force_protocol = t0; - # } + card_atr 3b:de:18:ff:c0:80:b1:fe:45:1f:03:45:73:74:45:49:44:20:76:65:72:20:31:2e:30:2b { + force_protocol = t0; + } # Digi-ID cold ATR. The same card has the same warm ATR as "Cold ATR v1" above - # The card is claimed to only support T=0 but in fact works with T=1, even if not advertised in ATR. - # card_atr 3b:6e:00:00:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { - # force_protocol = t0; - # } + # The card is claimed to only support T=0 but in fact (sometimes) works with T=1, even if not advertised in ATR. + card_atr 3b:6e:00:00:45:73:74:45:49:44:20:76:65:72:20:31:2e:30 { + force_protocol = t0; + } # D-Trust cards are also based on micardo and need T=0 for some reason diff --git a/src/libopensc/card-mcrd.c b/src/libopensc/card-mcrd.c index 8097adce..68789a90 100644 --- a/src/libopensc/card-mcrd.c +++ b/src/libopensc/card-mcrd.c @@ -40,6 +40,8 @@ static struct sc_atr_table mcrd_atrs[] = { "D-Trust", SC_CARD_TYPE_MCRD_DTRUST, 0, NULL}, {"3b:ff:11:00:ff:80:b1:fe:45:1f:03:00:68:d2:76:00:00:28:ff:05:1e:31:80:00:90:00:a6", NULL, "D-Trust", SC_CARD_TYPE_MCRD_DTRUST, 0, NULL}, + /* Certain pcsc-lite versions (1.5.3 for example on Ubuntu 10.04) incorrectly trunkate the wram ATR to the length of the cold ATR */ + /* See opensc.conf for further information */ {"3B:FE:94:00:FF:80:B1:FA:45:1F:03:45:73:74:45:49:44:20", NULL, "Broken EstEID ATR", SC_CARD_TYPE_MCRD_ESTEID, 0, NULL}, {NULL, NULL, NULL, 0, 0, NULL} }; @@ -306,10 +308,6 @@ static int mcrd_init(sc_card_t * card) if (card->type != SC_CARD_TYPE_MCRD_ESTEID) load_special_files(card); - /* To work around broken EstEID cards that can not be identified from ATR */ - if (card->type == SC_CARD_TYPE_MCRD_ESTEID) - sc_reset(card); - return SC_SUCCESS; }