frankmorgner / vsmartcard

umbrella project for emulation of smart card readers or smart cards
http://frankmorgner.github.io/vsmartcard/
704 stars 201 forks source link

How can I test PACE with nPa type using npa-tool? #173

Closed xaqfan closed 4 years ago

xaqfan commented 4 years ago

My opensc.conf is :

app default {

debug = 3;

# debug_file = opensc-debug.txt;
framework pkcs15 {
    # use_file_caching = true;
}
reader_driver pcsc {
    enable_escape = true;
}

}

And run command "npa-tool --pin=111111", verified successfully. But i can't find apdus (0xFF | 0x9A | 0x04 | 0x01 in BSI TR-03119 )

My log is here and have some of my custom , alex@Alex:~$ npa-tool --pin=111111 sc context create ..............========= P:11031; T:0x140026026382720 17:48:38.247 [npa-tool] ctx.c:724:process_config_file: Used configuration file '/usr/local/etc/opensc.conf'

key = default data= default P:11031; T:0x140026026382720 17:48:38.247 [npa-tool] ctx.c:855:sc_context_create: =================================== P:11031; T:0x140026026382720 17:48:38.247 [npa-tool] ctx.c:856:sc_context_create: opensc version: 0.20.0 pcsc init============== pcsc init====================================2

key = pcsc data= pcsc pcsc init====================================3 pcsc init====================================4 pcsc init====================================6 P:11031; T:0x140026026382720 17:48:38.247 [npa-tool] reader-pcsc.c:898:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1 pcsc init==================================== library = libpcsclite.so.1 P:11031; T:0x140026026382720 17:48:38.247 [npa-tool] reader-pcsc.c:1381:pcsc_detect_readers: called P:11031; T:0x140026026382720 17:48:38.248 [npa-tool] reader-pcsc.c:1394:pcsc_detect_readers: Probing PC/SC readers P:11031; T:0x140026026382720 17:48:38.248 [npa-tool] reader-pcsc.c:1447:pcsc_detect_readers: Establish PC/SC context P:11031; T:0x140026026382720 17:48:38.248 [npa-tool] reader-pcsc.c:1330:pcsc_add_reader: Adding new PC/SC reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.248 [npa-tool] reader-pcsc.c:360:refresh_attributes: Virtual PCD 00 00 check P:11031; T:0x140026026382720 17:48:38.249 [npa-tool] reader-pcsc.c:407:refresh_attributes: current state: 0x00010022 P:11031; T:0x140026026382720 17:48:38.249 [npa-tool] reader-pcsc.c:408:refresh_attributes: previous state: 0x00000000 P:11031; T:0x140026026382720 17:48:38.249 [npa-tool] reader-pcsc.c:464:refresh_attributes: card present, changed P:11031; T:0x140026026382720 17:48:38.334 [npa-tool] reader-pcsc.c:1546:pcsc_detect_readers: Virtual PCD 00 00:SCardConnect(SHARED): 0x00000000 P:11031; T:0x140026026382720 17:48:38.334 [npa-tool] reader-pcsc.c:1148:detect_reader_features: called P:11031; T:0x140026026382720 17:48:38.334 [npa-tool] reader-pcsc.c:1150:detect_reader_features: Requesting reader features ... P:11031; T:0x140026026382720 17:48:38.334 [npa-tool] reader-pcsc.c:1157:detect_reader_features: Virtual PCD 00 00:SCardControl failed: 0x8010001f P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:1330:pcsc_add_reader: Adding new PC/SC reader 'Virtual PCD 00 01' P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:360:refresh_attributes: Virtual PCD 00 01 check P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:407:refresh_attributes: current state: 0x00000012 P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:408:refresh_attributes: previous state: 0x00000000 P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:464:refresh_attributes: card absent P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:1537:pcsc_detect_readers: Virtual PCD 00 01:SCardConnect(DIRECT): 0x00000000 P:11031; T:0x140026026382720 17:48:38.335 [npa-tool] reader-pcsc.c:1148:detect_reader_features: called P:11031; T:0x140026026382720 17:48:38.336 [npa-tool] reader-pcsc.c:1150:detect_reader_features: Requesting reader features ... P:11031; T:0x140026026382720 17:48:38.336 [npa-tool] reader-pcsc.c:1157:detect_reader_features: Virtual PCD 00 01:SCardControl failed: 0x8010001f P:11031; T:0x140026026382720 17:48:38.336 [npa-tool] reader-pcsc.c:1561:pcsc_detect_readers: returning with: 0 (Success) sc set card driver ............========= util connect card ex. ............========= P:11031; T:0x140026026382720 17:48:38.336 [npa-tool] sc.c:325:sc_detect_card_presence: called P:11031; T:0x140026026382720 17:48:38.336 [npa-tool] reader-pcsc.c:472:pcsc_detect_card_presence: called P:11031; T:0x140026026382720 17:48:38.336 [npa-tool] reader-pcsc.c:360:refresh_attributes: Virtual PCD 00 00 check P:11031; T:0x140026026382720 17:48:38.337 [npa-tool] reader-pcsc.c:385:refresh_attributes: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.337 [npa-tool] reader-pcsc.c:477:pcsc_detect_card_presence: returning with: 1 P:11031; T:0x140026026382720 17:48:38.337 [npa-tool] sc.c:330:sc_detect_card_presence: returning with: 1 Using reader with a card: Virtual PCD 00 00 P:11031; T:0x140026026382720 17:48:38.337 [npa-tool] sc.c:325:sc_detect_card_presence: called P:11031; T:0x140026026382720 17:48:38.337 [npa-tool] reader-pcsc.c:472:pcsc_detect_card_presence: called P:11031; T:0x140026026382720 17:48:38.337 [npa-tool] reader-pcsc.c:360:refresh_attributes: Virtual PCD 00 00 check P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] reader-pcsc.c:385:refresh_attributes: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] reader-pcsc.c:477:pcsc_detect_card_presence: returning with: 1 P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] sc.c:330:sc_detect_card_presence: returning with: 1 P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] card.c:254:sc_connect_card: called P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] reader-pcsc.c:605:pcsc_connect: called P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] reader-pcsc.c:360:refresh_attributes: Virtual PCD 00 00 check P:11031; T:0x140026026382720 17:48:38.338 [npa-tool] reader-pcsc.c:385:refresh_attributes: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] reader-pcsc.c:637:pcsc_connect: Initial protocol: T=1 P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1188:match_atr_table: ATR : 3b:8a:80:01:80:31:f8:73:f7:41:e0:82:90:00:75 P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18 P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:DE:18:FF:81:91:FE:1F:C3:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:1C P:11031; T:0x140026026382720 17:48:38.339 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:DE:96:FF:81:91:FE:1F:C3:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:92 P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:80:80:01:01 P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:84:80:01:47:6f:49:44:00 P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:85:80:01:47:6f:49:44:00:00 P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:86:80:01:47:6f:49:44:00:00:00 P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.340 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:87:80:01:47:6f:49:44:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:88:80:01:47:6f:49:44:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:89:80:01:47:6f:49:44:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8a:80:01:47:6f:49:44:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1206:match_atr_table: ATR mask: FF:FF:FF:FF:FF:FF:FF:FF:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8b:80:01:47:6f:49:44:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8c:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8d:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.341 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8e:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8f:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card-default.c:47:default_init: called P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card-default.c:52:default_init: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:385:sc_connect_card: card info name:'Unsupported card', type:-1, flags:0x0, max_send/recv_size:255/256 P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:1562:sc_card_sm_check: called P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:1567:sc_card_sm_check: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:397:sc_connect_card: returning with: 0 (Success) =============eac_init ======= =============eac_init over======= =============by cmdline config ======= cmdline.break_flag = 0 =============by cmdline config ======= cmdline.resume_flag = 0 =============by cmdline config ======= cmdline.block flag = 0 =============by cmdline config ======= cmdline.newpin_given= 0 cmdline translate given ------------- per------------form_pace============== sm-eac --------- perfrom_pace ------- P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] apdu.c:546:sc_transmit_apdu: called P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] card.c:473:sc_lock: called P:11031; T:0x140026026382720 17:48:38.342 [npa-tool] reader-pcsc.c:684:pcsc_lock: called P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] card.c:513:sc_lock: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] apdu.c:513:sc_transmit: called P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] apdu.c:363:sc_single_transmit: called P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] apdu.c:370:sc_single_transmit: CLA:0, INS:B0, P1:9C, P2:0, data(0) (nil) P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] reader-pcsc.c:323:pcsc_transmit: reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] reader-pcsc.c:324:pcsc_transmit: Outgoing APDU (5 bytes): 00 B0 9C 00 DF ..... P:11031; T:0x140026026382720 17:48:38.343 [npa-tool] reader-pcsc.c:242:pcsc_internal_transmit: called P:11031; T:0x140026026382720 17:48:38.392 [npa-tool] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (184 bytes): 31 81 B3 30 0D 06 08 04 00 7F 00 07 02 02 02 02 1..0............ 01 02 30 12 06 0A 04 00 7F 00 07 02 02 03 02 02 ..0............. 02 01 02 02 01 41 30 12 06 0A 04 00 7F 00 07 02 .....A0......... 02 03 02 02 02 01 02 02 01 45 30 12 06 0A 04 00 .........E0..... 7F 00 07 02 02 04 02 02 02 01 02 02 01 0D 30 1C ..............0. 06 09 04 00 7F 00 07 02 02 03 02 30 0C 06 07 04 ...........0.... 00 7F 00 07 01 02 02 01 0D 02 01 41 30 1C 06 09 ...........A0... 04 00 7F 00 07 02 02 03 02 30 0C 06 07 04 00 7F .........0...... 00 07 01 02 02 01 0D 02 01 45 30 2A 06 08 04 00 .........E0.... 7F 00 07 02 02 06 16 1E 68 74 74 70 3A 2F 2F 62 ........http://b 73 69 2E 62 75 6E 64 2E 64 65 2F 63 69 66 2F 6E si.bund.de/cif/n 70 61 2E 78 6D 6C 62 82 pa.xmlb. P:11031; T:0x140026026382720 17:48:38.392 [npa-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.392 [npa-tool] apdu.c:535:sc_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.392 [npa-tool] card.c:523:sc_unlock: called P:11031; T:0x140026026382720 17:48:38.392 [npa-tool] reader-pcsc.c:736:pcsc_unlock: called P:11031; T:0x140026026382720 17:48:38.401 [npa-tool] iso7816.c:128:iso7816_check_sw: End of file/record reached before reading Le bytes P:11031; T:0x140026026382720 17:48:38.401 [npa-tool] sm-eac.c:1138:perform_pace: EF.CardAccess (182 bytes): 31 81 B3 30 0D 06 08 04 00 7F 00 07 02 02 02 02 1..0............ 01 02 30 12 06 0A 04 00 7F 00 07 02 02 03 02 02 ..0............. 02 01 02 02 01 41 30 12 06 0A 04 00 7F 00 07 02 .....A0......... 02 03 02 02 02 01 02 02 01 45 30 12 06 0A 04 00 .........E0..... 7F 00 07 02 02 04 02 02 02 01 02 02 01 0D 30 1C ..............0. 06 09 04 00 7F 00 07 02 02 03 02 30 0C 06 07 04 ...........0.... 00 7F 00 07 01 02 02 01 0D 02 01 41 30 1C 06 09 ...........A0... 04 00 7F 00 07 02 02 03 02 30 0C 06 07 04 00 7F .........0...... 00 07 01 02 02 01 0D 02 01 45 30 2A 06 08 04 00 .........E0.... 7F 00 07 02 02 06 16 1E 68 74 74 70 3A 2F 2F 62 ........http://b 73 69 2E 62 75 6E 64 2E 64 65 2F 63 69 66 2F 6E si.bund.de/cif/n 70 61 2E 78 6D 6C pa.xml P:11031; T:0x140026026382720 17:48:38.402 [npa-tool] sm-eac.c:483:format_mse_cdata: MSE command data (15 bytes): 80 0A 04 00 7F 00 07 02 02 04 02 02 83 01 03 ............... P:11031; T:0x140026026382720 17:48:38.402 [npa-tool] apdu.c:546:sc_transmit_apdu: called P:11031; T:0x140026026382720 17:48:38.402 [npa-tool] card.c:473:sc_lock: called P:11031; T:0x140026026382720 17:48:38.402 [npa-tool] reader-pcsc.c:684:pcsc_lock: called P:11031; T:0x140026026382720 17:48:38.402 [npa-tool] card.c:513:sc_lock: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.403 [npa-tool] apdu.c:513:sc_transmit: called P:11031; T:0x140026026382720 17:48:38.403 [npa-tool] apdu.c:363:sc_single_transmit: called P:11031; T:0x140026026382720 17:48:38.403 [npa-tool] apdu.c:370:sc_single_transmit: CLA:0, INS:22, P1:C1, P2:A4, data(15) 0x5639a864c7f0 P:11031; T:0x140026026382720 17:48:38.403 [npa-tool] reader-pcsc.c:323:pcsc_transmit: reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.403 [npa-tool] reader-pcsc.c:324:pcsc_transmit: Outgoing APDU (20 bytes): 00 22 C1 A4 0F 80 0A 04 00 7F 00 07 02 02 04 02 .".............. 02 83 01 03 .... P:11031; T:0x140026026382720 17:48:38.403 [npa-tool] reader-pcsc.c:242:pcsc_internal_transmit: called P:11031; T:0x140026026382720 17:48:38.446 [npa-tool] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (2 bytes): 90 00 .. P:11031; T:0x140026026382720 17:48:38.446 [npa-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.446 [npa-tool] apdu.c:535:sc_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.446 [npa-tool] card.c:523:sc_unlock: called P:11031; T:0x140026026382720 17:48:38.446 [npa-tool] reader-pcsc.c:736:pcsc_unlock: called P:11031; T:0x140026026382720 17:48:38.454 [npa-tool] sm-eac.c:633:eac_gen_auth_1_encrypted_nonce: General authenticate (Encrypted Nonce) command data (2 bytes): 7C 00 |. P:11031; T:0x140026026382720 17:48:38.454 [npa-tool] apdu.c:546:sc_transmit_apdu: called P:11031; T:0x140026026382720 17:48:38.454 [npa-tool] card.c:473:sc_lock: called P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] reader-pcsc.c:684:pcsc_lock: called P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] card.c:513:sc_lock: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] apdu.c:513:sc_transmit: called P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] apdu.c:363:sc_single_transmit: called P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] apdu.c:370:sc_single_transmit: CLA:10, INS:86, P1:0, P2:0, data(2) 0x5639a864da80 P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] reader-pcsc.c:323:pcsc_transmit: reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.455 [npa-tool] reader-pcsc.c:324:pcsc_transmit: Outgoing APDU (8 bytes): 10 86 00 00 02 7C 00 00 .....|.. P:11031; T:0x140026026382720 17:48:38.456 [npa-tool] reader-pcsc.c:242:pcsc_internal_transmit: called P:11031; T:0x140026026382720 17:48:38.498 [npa-tool] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (22 bytes): 7C 12 80 10 26 90 65 E3 CC 9A 59 20 C2 C4 2A 0D |...&.e...Y ... 5A 8A 22 2B 90 00 Z."+.. P:11031; T:0x140026026382720 17:48:38.499 [npa-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.499 [npa-tool] apdu.c:535:sc_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.499 [npa-tool] card.c:523:sc_unlock: called P:11031; T:0x140026026382720 17:48:38.499 [npa-tool] reader-pcsc.c:736:pcsc_unlock: called P:11031; T:0x140026026382720 17:48:38.503 [npa-tool] sm-eac.c:643:eac_gen_auth_1_encrypted_nonce: General authenticate (Encrypted Nonce) response data (20 bytes): 7C 12 80 10 26 90 65 E3 CC 9A 59 20 C2 C4 2A 0D |...&.e...Y ... 5A 8A 22 2B Z."+ P:11031; T:0x140026026382720 17:48:38.503 [npa-tool] sm-eac.c:1175:perform_pace: Encrypted nonce from MRTD (16 bytes): 26 90 65 E3 CC 9A 59 20 C2 C4 2A 0D 5A 8A 22 2B &.e...Y ..*.Z."+ P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] sm-eac.c:719:eac_gen_auth_2_mapnonce: General authenticate (Map Nonce) command data (69 bytes): 7C 43 81 41 04 3E 7D FB 67 7C DB 15 5C 76 01 6D |C.A.>}.g|..\v.m C4 43 78 4F A4 49 0D 7B BF 7E 5D 55 7A B5 E5 5F .CxO.I.{.~]Uz.. D2 D7 25 74 1D 6A 58 E1 4D A7 72 4F 94 66 E3 1C ..%t.jX.M.rO.f.. 74 CE 69 F8 FE 27 A9 82 68 59 33 0D AC 98 84 18 t.i..'..hY3..... 5C 0A B6 50 6B ..Pk P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] apdu.c:546:sc_transmit_apdu: called P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] card.c:473:sc_lock: called P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] reader-pcsc.c:684:pcsc_lock: called P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] card.c:513:sc_lock: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] apdu.c:513:sc_transmit: called P:11031; T:0x140026026382720 17:48:38.506 [npa-tool] apdu.c:363:sc_single_transmit: called P:11031; T:0x140026026382720 17:48:38.507 [npa-tool] apdu.c:370:sc_single_transmit: CLA:10, INS:86, P1:0, P2:0, data(69) 0x5639a864d340 P:11031; T:0x140026026382720 17:48:38.507 [npa-tool] reader-pcsc.c:323:pcsc_transmit: reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.507 [npa-tool] reader-pcsc.c:324:pcsctransmit: Outgoing APDU (75 bytes): 10 86 00 00 45 7C 43 81 41 04 3E 7D FB 67 7C DB ....E|C.A.>}.g|. 15 5C 76 01 6D C4 43 78 4F A4 49 0D 7B BF 7E 5D .\v.m.CxO.I.{.~] 55 7A B5 E5 5F D2 D7 25 74 1D 6A 58 E1 4D A7 72 Uz....%t.jX.M.r 4F 94 66 E3 1C 74 CE 69 F8 FE 27 A9 82 68 59 33 O.f..t.i..'..hY3 0D AC 98 84 18 5C 0A B6 50 6B 00 .......Pk. P:11031; T:0x140026026382720 17:48:38.507 [npa-tool] reader-pcsc.c:242:pcsc_internal_transmit: called P:11031; T:0x140026026382720 17:48:38.562 [npa-tool] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (71 bytes): 7C 43 82 41 04 36 84 29 67 52 9C 59 CD AB A4 99 |C.A.6.)gR.Y.... 51 39 A1 D4 8C D2 56 B4 34 23 29 D7 F4 60 98 AF Q9....V.4#).... EA F5 2F A9 CC 8B 26 43 76 D3 F3 BA 6B DF FE 0E ../...&Cv...k... E6 AF 97 9E 9D CF 46 8F FE 9D 4F D4 B1 6D 83 71 ......F...O..m.q 1F 8B B3 F4 57 90 00 ....W.. P:11031; T:0x140026026382720 17:48:38.562 [npa-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.562 [npa-tool] apdu.c:535:sc_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.562 [npa-tool] card.c:523:sc_unlock: called P:11031; T:0x140026026382720 17:48:38.562 [npa-tool] reader-pcsc.c:736:pcsc_unlock: called P:11031; T:0x140026026382720 17:48:38.567 [npa-tool] sm-eac.c:729:eac_gen_auth_2_map_nonce: General authenticate (Map Nonce) response data (69 bytes): 7C 43 82 41 04 36 84 29 67 52 9C 59 CD AB A4 99 |C.A.6.)gR.Y.... 51 39 A1 D4 8C D2 56 B4 34 23 29 D7 F4 60 98 AF Q9....V.4#).... EA F5 2F A9 CC 8B 26 43 76 D3 F3 BA 6B DF FE 0E ../...&Cv...k... E6 AF 97 9E 9D CF 46 8F FE 9D 4F D4 B1 6D 83 71 ......F...O..m.q 1F 8B B3 F4 57 ....W P:11031; T:0x140026026382720 17:48:38.567 [npa-tool] sm-eac.c:1210:perform_pace: Mapping data from MRTD (65 bytes): 04 36 84 29 67 52 9C 59 CD AB A4 99 51 39 A1 D4 .6.)gR.Y....Q9.. 8C D2 56 B4 34 23 29 D7 F4 60 98 AF EA F5 2F A9 ..V.4#)..`..../. CC 8B 26 43 76 D3 F3 BA 6B DF FE 0E E6 AF 97 9E ..&Cv...k....... 9D CF 46 8F FE 9D 4F D4 B1 6D 83 71 1F 8B B3 F4 ..F...O..m.q.... 57 W P:11031; T:0x140026026382720 17:48:38.571 [npa-tool] sm-eac.c:805:eac_gen_auth_3_perform_key_agreement: General authenticate (Perform Key Agreement) command data (69 bytes): 7C 43 83 41 04 8A 4B E2 86 9B 3A B4 F1 5C 49 7E |C.A..K...:..\I~ 07 49 FD F0 03 6F D1 3A D5 6F C1 F7 9A 6C 8E 58 .I...o.:.o...l.X 53 14 74 15 B1 5F 6B 58 47 D7 A1 E8 E6 EF C9 30 S.t.._kXG......0 B4 1E DE 6E 29 0C 6E 87 31 5C 5C 4B A1 F0 12 3C ...n).n.1\K...< DE 7D 78 99 72 .}x.r P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] apdu.c:546:sc_transmit_apdu: called P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] card.c:473:sc_lock: called P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] reader-pcsc.c:684:pcsc_lock: called P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] card.c:513:sc_lock: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] apdu.c:513:sc_transmit: called P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] apdu.c:363:sc_single_transmit: called P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] apdu.c:370:sc_single_transmit: CLA:10, INS:86, P1:0, P2:0, data(69) 0x5639a864fce0 P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] reader-pcsc.c:323:pcsc_transmit: reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] reader-pcsc.c:324:pcsc_transmit: Outgoing APDU (75 bytes): 10 86 00 00 45 7C 43 83 41 04 8A 4B E2 86 9B 3A ....E|C.A..K...: B4 F1 5C 49 7E 07 49 FD F0 03 6F D1 3A D5 6F C1 ..\I~.I...o.:.o. F7 9A 6C 8E 58 53 14 74 15 B1 5F 6B 58 47 D7 A1 ..l.XS.t.._kXG.. E8 E6 EF C9 30 B4 1E DE 6E 29 0C 6E 87 31 5C 5C ....0...n).n.1\ 4B A1 F0 12 3C DE 7D 78 99 72 00 K...<.}x.r. P:11031; T:0x140026026382720 17:48:38.572 [npa-tool] reader-pcsc.c:242:pcsc_internal_transmit: called P:11031; T:0x140026026382720 17:48:38.623 [npa-tool] reader-pcsc.c:333:pcsctransmit: Incoming APDU (71 bytes): 7C 43 84 41 04 42 A0 41 8F C6 E8 91 93 26 BE 04 |C.A.B.A.....&.. FA AF EE FE BF B5 1D 4F BC 5E 4C DA B0 49 6E 72 .......O.^L..Inr E2 81 45 0B 39 99 FB 8E 18 D2 BC F6 02 69 6E D0 ..E.9........in. 2E 15 C5 9C 75 21 DB F2 33 0A CD DF E2 EE 1A AC ....u!..3....... 91 9D 35 8A 5F 90 00 ..5... P:11031; T:0x140026026382720 17:48:38.623 [npa-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.623 [npa-tool] apdu.c:535:sc_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.623 [npa-tool] card.c:523:sc_unlock: called P:11031; T:0x140026026382720 17:48:38.623 [npa-tool] reader-pcsc.c:736:pcsc_unlock: called P:11031; T:0x140026026382720 17:48:38.627 [npa-tool] sm-eac.c:815:eac_gen_auth_3_perform_keyagreement: General authenticate (Perform Key Agreement) response data (69 bytes): 7C 43 84 41 04 42 A0 41 8F C6 E8 91 93 26 BE 04 |C.A.B.A.....&.. FA AF EE FE BF B5 1D 4F BC 5E 4C DA B0 49 6E 72 .......O.^L..Inr E2 81 45 0B 39 99 FB 8E 18 D2 BC F6 02 69 6E D0 ..E.9........in. 2E 15 C5 9C 75 21 DB F2 33 0A CD DF E2 EE 1A AC ....u!..3....... 91 9D 35 8A 5F ..5. P:11031; T:0x140026026382720 17:48:38.627 [npa-tool] sm-eac.c:1236:performpace: Ephemeral public key from MRTD (65 bytes): 04 42 A0 41 8F C6 E8 91 93 26 BE 04 FA AF EE FE .B.A.....&...... BF B5 1D 4F BC 5E 4C DA B0 49 6E 72 E2 81 45 0B ...O.^L..Inr..E. 39 99 FB 8E 18 D2 BC F6 02 69 6E D0 2E 15 C5 9C 9........in..... 75 21 DB F2 33 0A CD DF E2 EE 1A AC 91 9D 35 8A u!..3.........5. 5F P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] sm-eac.c:893:eac_gen_auth_4_mutual_authentication: General authenticate (Perform Key Agreement) command data (12 bytes): 7C 0A 85 08 1D 23 8C 7D D5 9B A9 58 |....#.}...X P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] apdu.c:546:sc_transmit_apdu: called P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] card.c:473:sc_lock: called P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] reader-pcsc.c:684:pcsc_lock: called P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] card.c:513:sc_lock: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] apdu.c:513:sc_transmit: called P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] apdu.c:363:sc_single_transmit: called P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] apdu.c:370:sc_single_transmit: CLA:0, INS:86, P1:0, P2:0, data(12) 0x5639a864bfe0 P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] reader-pcsc.c:323:pcsc_transmit: reader 'Virtual PCD 00 00' P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] reader-pcsc.c:324:pcsc_transmit: Outgoing APDU (18 bytes): 00 86 00 00 0C 7C 0A 85 08 1D 23 8C 7D D5 9B A9 .....|....#.}... 58 00 X. P:11031; T:0x140026026382720 17:48:38.629 [npa-tool] reader-pcsc.c:242:pcsc_internal_transmit: called P:11031; T:0x140026026382720 17:48:38.711 [npa-tool] reader-pcsc.c:333:pcsc_transmit: Incoming APDU (14 bytes): 7C 0A 86 08 3E 31 0A D8 B3 00 CB EC 90 00 |...>1........ P:11031; T:0x140026026382720 17:48:38.711 [npa-tool] apdu.c:382:sc_single_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.711 [npa-tool] apdu.c:535:sc_transmit: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.711 [npa-tool] card.c:523:sc_unlock: called P:11031; T:0x140026026382720 17:48:38.711 [npa-tool] reader-pcsc.c:736:pcsc_unlock: called P:11031; T:0x140026026382720 17:48:38.714 [npa-tool] sm-eac.c:903:eac_gen_auth_4_mutual_authentication: General authenticate (Perform Key Agreement) response data (12 bytes): 7C 0A 86 08 3E 31 0A D8 B3 00 CB EC |...>1...... P:11031; T:0x140026026382720 17:48:38.715 [npa-tool] sm-eac.c:1306:perform_pace: ID ICC (32 bytes): 42 A0 41 8F C6 E8 91 93 26 BE 04 FA AF EE FE BF B.A.....&....... B5 1D 4F BC 5E 4C DA B0 49 6E 72 E2 81 45 0B 39 ..O.^L..Inr..E.9 P:11031; T:0x140026026382720 17:48:38.715 [npa-tool] sm-eac.c:1322:perform_pace: ID PCD (32 bytes): 8A 4B E2 86 9B 3A B4 F1 5C 49 7E 07 49 FD F0 03 .K...:..\I~.I... 6F D1 3A D5 6F C1 F7 9A 6C 8E 58 53 14 74 15 B1 o.:.o...l.XS.t.. P:11031; T:0x140026026382720 17:48:38.715 [npa-tool] sm-eac.c:1359:perform_pace: returning with: 0 (Success) per------------form_pace=========over===== Established PACE channel with eID PIN. P:11031; T:0x140026026382720 17:48:38.715 [npa-tool] reader-pcsc.c:534:pcsc_reconnect: Reconnecting to the card... P:11031; T:0x140026026382720 17:48:38.715 [npa-tool] reader-pcsc.c:360:refresh_attributes: Virtual PCD 00 00 check P:11031; T:0x140026026382720 17:48:38.715 [npa-tool] reader-pcsc.c:385:refresh_attributes: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1188:match_atr_table: ATR : 3b:8a:80:01:80:31:f8:73:f7:41:e0:82:90:00:75 P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:FE:18:00:00:81:31:FE:45:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:FA P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8E:80:01:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:18 P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:DE:18:FF:81:91:FE:1F:C3:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:1C P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:DE:96:FF:81:91:FE:1F:C3:80:31:81:54:48:53:4D:31:73:80:21:40:81:07:92 P:11031; T:0x140026026382720 17:48:38.716 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:80:80:01:01 P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:84:80:01:47:6f:49:44:00 P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:85:80:01:47:6f:49:44:00:00 P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:86:80:01:47:6f:49:44:00:00:00 P:11031; T:0x140026026382720 17:48:38.717 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:87:80:01:47:6f:49:44:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:88:80:01:47:6f:49:44:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:89:80:01:47:6f:49:44:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8a:80:01:47:6f:49:44:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.718 [npa-tool] card.c:1206:match_atr_table: ATR mask: FF:FF:FF:FF:FF:FF:FF:FF:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8b:80:01:47:6f:49:44:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8c:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8d:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8e:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.719 [npa-tool] card.c:1199:match_atr_table: ATR try : 3B:8f:80:01:47:6f:49:44:00:00:00:00:00:00:00:00:00:00:00:00 P:11031; T:0x140026026382720 17:48:38.720 [npa-tool] card.c:1202:match_atr_table: ignored - wrong length P:11031; T:0x140026026382720 17:48:38.850 [npa-tool] reader-pcsc.c:557:pcsc_reconnect: Virtual PCD 00 00:SCardReconnect returned: 0x00000000 P:11031; T:0x140026026382720 17:48:38.850 [npa-tool] card.c:414:sc_disconnect_card: called P:11031; T:0x140026026382720 17:48:38.850 [npa-tool] reader-pcsc.c:669:pcsc_disconnect: Virtual PCD 00 00:SCardDisconnect returned: 0x00000000 P:11031; T:0x140026026382720 17:48:38.850 [npa-tool] card.c:436:sc_disconnect_card: returning with: 0 (Success) P:11031; T:0x140026026382720 17:48:38.850 [npa-tool] ctx.c:931:sc_release_context: called P:11031; T:0x140026026382720 17:48:38.850 [npa-tool] reader-pcsc.c:980:pcsc_finish: called

And I have checked opensc code, found pcsc reader no load enable_escape

src/libopensc/reader-pcsc.c conf_block = sc_get_conf_block(ctx, "reader_driver", "pcsc", 1); if (conf_block) { printf("pcsc init====================================3\n"); gpriv->provider_library = scconf_get_str(conf_block, "provider_library", gpriv->provider_library); gpriv->connect_exclusive = scconf_get_bool(conf_block, "connect_exclusive", gpriv->connect_exclusive); gpriv->disconnect_action = pcsc_reset_action(scconf_get_str(conf_block, "disconnect_action", "leave")); gpriv->transaction_end_action = pcsc_reset_action(scconf_get_str(conf_block, "transaction_end_action", "leave")); gpriv->reconnect_action = pcsc_reset_action(scconf_get_str(conf_block, "reconnect_action", "leave")); gpriv->enable_pinpad = scconf_get_bool(conf_block, "enable_pinpad", gpriv->enable_pinpad); gpriv->fixed_pinlength = scconf_get_bool(conf_block, "fixed_pinlength", gpriv->fixed_pinlength); gpriv->enable_pace = scconf_get_bool(conf_block, "enable_pace", gpriv->enable_pace); gpriv->force_max_send_size = scconf_get_int(conf_block, "max_send_size", gpriv->force_max_send_size); gpriv->force_max_recv_size = scconf_get_int(conf_block, "max_recv_size", gpriv->force_max_recv_size); }

Is my opensc version wrong? my opensc version is 0.20.0.

xaqfan commented 4 years ago

Any one could help me ? Thanks !

frankmorgner commented 4 years ago

duplicate of #172