Are you using the reader that can only  do 255 bytes?

   card.c:399:sc_read_binary: called; 256 bytes at index 0

   reader-openct.c:339:openct_reader_transmit: unable to transmit


Can you run the command that is listed in the new opensc.conf:

        # This sets the maximum send and receive sizes.
        # Some reader drivers have limitations, so you need
        # to set these values. For usb devices check the
        # properties with lsusb -vv for dwMaxIFSD

(Although I tried this on my GemPC Twin, and it says 254
 but works with the 256.)


Can you try adding
max_send_size = 255;
max_recv_size = 255;
to the reader openct section in opensc.conf?

Then try 252, and 248 if 255 does not work.

Developers:
As Nils and Andreas feared, there may be cards or readers that can
not handle the increase of the default send/receive size.

I think it is a good idea to have the default set large and let
the card or reader drivers lower it. But if it is going to cause
to many problems with 0.11.2 I would suggest we back off this
change for 0.11.2. One can still set the defaults in the
opensc.conf as with 0.11.1.




Simon Eisenmann wrote:
Hi,

while testing i noticed that the my cryptoflex 32k e-gate cards stopped
working when using trunk.

pkcs15.c:755:sc_pkcs15_bind: returning with: Unsupported card
PKCS#15 initialization failed: Unsupported card

Works fine when using opensc 0.11.1.

See both log output for pkcs15-tool -c at the end of this email.

Best regards,
Simon


Debug log for opensc trunk (r3133):
$ pkcs15-tool -c
ctx.c:705:sc_context_create: ===================================
ctx.c:706:sc_context_create: opensc version: 0.11.1-svn
reader-openct.c:89:openct_reader_init: called
sc.c:196:sc_detect_card_presence: called
reader-openct.c:207:openct_reader_detect_card_presence: called
sc.c:201:sc_detect_card_presence: returning with: 1
card.c:110:sc_connect_card: called
reader-openct.c:231:openct_reader_connect: called
card.c:140:sc_connect_card: matching configured ATRs
card.c:182:sc_connect_card: matching built-in ATRs
card.c:188:sc_connect_card: trying driver: cardos
card.c:746:match_atr_table: ATR     : 3b:95:18:40:ff:62:01:02:01:04
card.c:754:match_atr_table: ATR try :
3b:e2:00:ff:c1:10:31:fe:55:c8:02:9c
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:98:00:ff:c1:10:31:fe:55:c8:03:15
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:98:00:ff:c1:10:31:fe:55:c8:04:12
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:ff:c1:0a:31:fe:55:c8:06:8a
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:ff:c1:0a:31:fe:55:c8:06:75
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:02:c1:0a:31:fe:55:c8:07:76
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:02:c1:0a:31:fe:58:c8:08:74
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:e9:00:ff:c1:10:31:fe:55:00:64:05:00:c8:02:31:80:00:47
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:fb:98:00:ff:c1:10:31:fe:55:00:64:05:20:47:03:31:80:00:90:00:f3
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:fc:98:00:ff:c1:10:31:fe:55:c8:03:49:6e:66:6f:63:61:6d:65:72:65:28
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f4:98:00:ff:c1:10:31:fe:55:4d:34:63:76:b4
card.c:758:match_atr_table: ignored - wrong length
card.c:188:sc_connect_card: trying driver: cardos
card.c:746:match_atr_table: ATR     : 3b:95:18:40:ff:62:01:02:01:04
card.c:754:match_atr_table: ATR try :
3b:e2:00:ff:c1:10:31:fe:55:c8:02:9c
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:98:00:ff:c1:10:31:fe:55:c8:03:15
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:98:00:ff:c1:10:31:fe:55:c8:04:12
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:ff:c1:0a:31:fe:55:c8:06:8a
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:ff:c1:0a:31:fe:55:c8:06:75
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:02:c1:0a:31:fe:55:c8:07:76
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f2:18:00:02:c1:0a:31:fe:58:c8:08:74
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:e9:00:ff:c1:10:31:fe:55:00:64:05:00:c8:02:31:80:00:47
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:fb:98:00:ff:c1:10:31:fe:55:00:64:05:20:47:03:31:80:00:90:00:f3
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:fc:98:00:ff:c1:10:31:fe:55:c8:03:49:6e:66:6f:63:61:6d:65:72:65:28
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try :
3b:f4:98:00:ff:c1:10:31:fe:55:4d:34:63:76:b4
card.c:758:match_atr_table: ignored - wrong length
card.c:188:sc_connect_card: trying driver: flex
card.c:746:match_atr_table: ATR     : 3b:95:18:40:ff:62:01:02:01:04
card.c:754:match_atr_table: ATR try : 3b:95:15:40:20:68:01:02:00:00
card.c:754:match_atr_table: ATR try : 3B:95:15:40:FF:68:01:02:02:01
card.c:754:match_atr_table: ATR try : 3B:95:15:40:FF:68:01:02:02:04
card.c:754:match_atr_table: ATR try : 3B:85:40:20:68:01:01:05:01
card.c:758:match_atr_table: ignored - wrong length
card.c:754:match_atr_table: ATR try : 3B:95:94:40:FF:63:01:01:02:01
card.c:754:match_atr_table: ATR try : 3B:95:15:40:FF:63:01:01:02:01
card.c:766:match_atr_table: ATR mask: FF:FF:FF:FF:FF:FF:FF:FF:00:00
card.c:754:match_atr_table: ATR try : 3B:95:18:40:FF:64:02:01:01:02
card.c:766:match_atr_table: ATR mask: FF:FF:FF:FF:FF:FF:FF:FF:00:00
card.c:754:match_atr_table: ATR try : 3B:95:18:40:FF:62:01:01:00:00
card.c:766:match_atr_table: ATR mask: FF:FF:FF:FF:FF:FF:FF:FF:00:00
card.c:754:match_atr_table: ATR try : 3B:95:18:40:FF:62:01:02:01:04
card.c:196:sc_connect_card: matched: Schlumberger Multiflex/Cryptoflex
card.c:221:sc_connect_card: card info: Cryptoflex 32K e-gate, 2002, 0x1
card.c:222:sc_connect_card: returning with: 0
card.c:285:sc_lock: called
reader-openct.c:431:openct_reader_lock: called
pkcs15.c:700:sc_pkcs15_bind: called
card.c:285:sc_lock: called
pkcs15.c:526:sc_pkcs15_bind_internal: trying normal pkcs15 processing
card.c:532:sc_select_file: called; type=2, path=3f002f00
card-flex.c:608:flex_select_file: called, cached path=
card.c:285:sc_lock: called
card-flex.c:547:select_file_id: called, p1=0, path=3f00
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 7 bytes] =====================================
C0 A4 00 00 02 3F 00 .....?.
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 2 bytes] =====================================
61 14 a.
======================================================================
card.c:312:sc_unlock: called
card-flex.c:547:select_file_id: called, p1=0, path=2f00
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 8 bytes] =====================================
C0 A4 00 00 02 2F 00 FC ...../..
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 2 bytes] =====================================
61 0F a.
======================================================================
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 5 bytes] =====================================
C0 C0 00 00 0F .....
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 17 bytes] =====================================
00 00 00 80 2F 00 01 FC 00 00 00 01 01 00 00 90 ..../...........
00                                              .
======================================================================
card.c:312:sc_unlock: called
card.c:312:sc_unlock: called
card.c:312:sc_unlock: called
card-flex.c:650:flex_select_file: returning with: 0
card.c:554:sc_select_file: returning with: 0
card.c:399:sc_read_binary: called; 128 bytes at index 0
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 5 bytes] =====================================
C0 B0 00 00 80 .....
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 130 bytes] =====================================
61 21 4F 0C A0 00 00 00 63 50 4B 43 53 2D 31 35 a!O.....cPKCS-15
50 0B 4F 70 65 6E 53 43 20 43 61 72 64 51 04 3F P.OpenSC CardQ.?
00 50 15 00 00 00 00 00 00 00 00 00 00 00 00 00 .P..............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90 00                                           ..
======================================================================
card.c:312:sc_unlock: called
iso7816.c:132:iso7816_read_binary: returning with: 128
card.c:430:sc_read_binary: returning with: 128
asn1.c:1123:asn1_decode: called, left=128, depth 0
asn1.c:1148:asn1_decode: Looking for 'dirRecord', tag 0x11000001
asn1.c:944:asn1_decode_entry: decoding 'dirRecord'
asn1.c:1123:asn1_decode:  called, left=33, depth 1
asn1.c:1148:asn1_decode: Looking for 'aid', tag 0x1000000f
asn1.c:944:asn1_decode_entry:  decoding 'aid'
asn1.c:1148:asn1_decode: Looking for 'label', tag 0x10000010, OPTIONAL
asn1.c:944:asn1_decode_entry:  decoding 'label'
asn1.c:1148:asn1_decode: Looking for 'path', tag 0x10000011, OPTIONAL
asn1.c:944:asn1_decode_entry:  decoding 'path'
asn1.c:1148:asn1_decode: Looking for 'ddo', tag 0x11000013, OPTIONAL
asn1.c:1164:asn1_decode: not present
asn1.c:1199:asn1_decode: returning with: 0
asn1.c:1199:asn1_decode: returning with: 0
asn1.c:1123:asn1_decode: called, left=93, depth 0
card.c:532:sc_select_file: called; type=2, path=3f005015
card-flex.c:608:flex_select_file: called, cached path=3f002f00
card.c:285:sc_lock: called
card-flex.c:547:select_file_id: called, p1=0, path=3f00
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 7 bytes] =====================================
C0 A4 00 00 02 3F 00 .....?.
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 2 bytes] =====================================
61 14 a.
======================================================================
card.c:312:sc_unlock: called
card-flex.c:547:select_file_id: called, p1=0, path=5015
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 7 bytes] =====================================
C0 A4 00 00 02 50 15 .....P.
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 2 bytes] =====================================
61 14 a.
======================================================================
card.c:312:sc_unlock: called
card.c:312:sc_unlock: called
card-flex.c:650:flex_select_file: returning with: 0
card.c:554:sc_select_file: returning with: 0
card.c:532:sc_select_file: called; type=2, path=3f0050155031
card-flex.c:608:flex_select_file: called, cached path=3f005015
card.c:285:sc_lock: called
card-flex.c:547:select_file_id: called, p1=0, path=5031
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 8 bytes] =====================================
C0 A4 00 00 02 50 31 FC .....P1.
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 2 bytes] =====================================
61 0F a.
======================================================================
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 5 bytes] =====================================
C0 C0 00 00 0F .....
======================================================================
apdu.c:184:sc_apdu_log: Incoming APDU data [ 17 bytes] =====================================
00 00 01 00 50 31 01 FC 00 00 00 01 01 00 00 90 ....P1..........
00                                              .
======================================================================
card.c:312:sc_unlock: called
card.c:312:sc_unlock: called
card.c:312:sc_unlock: called
card-flex.c:650:flex_select_file: returning with: 0
card.c:554:sc_select_file: returning with: 0

Trying to read 256 bytes:

card.c:399:sc_read_binary: called; 256 bytes at index 0
apdu.c:516:sc_transmit_apdu: called
card.c:285:sc_lock: called
apdu.c:184:sc_apdu_log: Outgoing APDU data [ 5 bytes] =====================================
C0 B0 00 00 00 .....
======================================================================

OpenCT can't handle it:

reader-openct.c:339:openct_reader_transmit: unable to transmit
apdu.c:394:do_single_transmit: unable to transmit APDU
card.c:312:sc_unlock: called
iso7816.c:127:iso7816_read_binary: APDU transmit failed: Generic reader
error
card.c:430:sc_read_binary: returning with: Generic reader error
pkcs15-syn.c:98:sc_pkcs15_bind_synthetic: called
pkcs15-syn.c:128:sc_pkcs15_bind_synthetic: use builtin drivers
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying esteid
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying openpgp
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying tcos
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying starcert
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying infocamere
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying postecert
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying actalis
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying atrust-acosi
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying gemsafe
pkcs15-gemsafe.c:515:sc_pkcs15emu_gemsafe_init_ex: Entering
sc_pkcs15emu_gemsafe_init_ex
pkcs15-gemsafe.c:163:gemsafe_detect_card: called
pkcs15-syn.c:134:sc_pkcs15_bind_synthetic: trying tccardos
pkcs15-syn.c:145:sc_pkcs15_bind_synthetic: searching for 'emulate foo
{ ... }' blocks
card.c:312:sc_unlock: called
pkcs15.c:755:sc_pkcs15_bind: returning with: Unsupported card
PKCS#15 initialization failed: Unsupported card
card.c:312:sc_unlock: called
reader-openct.c:458:openct_reader_unlock: called
card.c:236:sc_disconnect_card: called
reader-openct.c:280:openct_reader_disconnect: called
card.c:251:sc_disconnect_card: returning with: 0
ctx.c:738:sc_release_context: called
reader-openct.c:180:openct_reader_release: called
reader-openct.c:180:openct_reader_release: called
reader-openct.c:180:openct_reader_release: called
reader-openct.c:180:openct_reader_release: called
reader-openct.c:180:openct_reader_release: called
reader-openct.c:165:openct_reader_finish: called







------------------------------------------------------------------------

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

--

 Douglas E. Engert  <[EMAIL PROTECTED]>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439
 (630) 252-5444
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to