(2011-09-02 01:00:06 отредактировано metawishmaster)

rutoken ECP + linux (архитектура arm)

Здравствуйте, у меня не получается проинициализировать токен. pkcs15-init --erase-card отрабаетывает нормально (как и pkcs11-data --add-provider=/usr/lib/opensc-pkcs11.so --prompt-prog /tmp/prompt.sh --cmd=import/export --file=$key_file --token=$id --application=DISK --label=N900 ), но pkcs15-init --create-pkcs15 --so-pin "87654321" --so-puk "" выдает такой лог:

[pkcs15-init] ctx.c:735:sc_context_create: ===================================
[pkcs15-init] ctx.c:736:sc_context_create: opensc version: 0.11.13                                                                                              
[pkcs15-init] reader-pcsc.c:879:pcsc_detect_readers: Probing pcsc readers                                                                                       
[pkcs15-init] reader-pcsc.c:901:pcsc_detect_readers: Establish pcsc context
[pkcs15-init] reader-pcsc.c:951:pcsc_detect_readers: Found new pcsc reader 'Aktiv Rutoken ECP 00 00'
[pkcs15-init] sc.c:196:sc_detect_card_presence: called
[pkcs15-init] sc.c:201:sc_detect_card_presence: returning with: 1                                                                                               
Using reader with a card: Aktiv Rutoken ECP 00 00                                                                                                               
[pkcs15-init] sc.c:196:sc_detect_card_presence: called
[pkcs15-init] sc.c:201:sc_detect_card_presence: returning with: 1                                                                                               
[pkcs15-init] card.c:110:sc_connect_card: called                                                                                                                
[pkcs15-init] reader-pcsc.c:532:pcsc_connect: After connect protocol = 2                                                                                        
[pkcs15-init] reader-pcsc.c:551:pcsc_connect: Requesting reader features ... 
[pkcs15-init] reader-pcsc.c:621:pcsc_connect: Returned PIN properties structure has bad length (8)
[pkcs15-init] card-gemsafeV1.c:120:gemsafe_match_card: called
[pkcs15-init] card-piv.c:1761:piv_match_card: called                                                                                                            
[pkcs15-init] card-piv.c:493:piv_find_aid: called                                                                                                               
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Function not supported                                                                                             
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Function not supported                                                                                             
[pkcs15-init] card-piv.c:576:piv_find_aid: returning with: -1208                                                                                                
[pkcs15-init] card-entersafe.c:101:entersafe_match_card: called                                                                                                 
[pkcs15-init] card-rutoken.c:120:rutoken_match_card: called                                                                                                     
[pkcs15-init] card-rutoken.c:126:rutoken_match_card: returning with: 0                                                                                          
[pkcs15-init] card-rtecp.c:53:rtecp_match_card: returning with: 1                                                                                               
[pkcs15-init] card.c:221:sc_connect_card: card info: Rutoken ECP card, 0, 0x0                                                                                   
[pkcs15-init] card.c:222:sc_connect_card: returning with: 0                                                                                                     
[pkcs15-init] card.c:675:sc_card_ctl: card_ctl(4) not supported                                                                                                 
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0050154946                                                                                      
[pkcs15-init] iso7816.c:99:iso7816_check_sw: File not found                                                                                                     
[pkcs15-init] card-rtecp.c:306:rtecp_select_file: : File not found                                                                                              
[pkcs15-init] card.c:554:sc_select_file: returning with: -1201                                                                                                  
[pkcs15-init] profile.c:306:sc_profile_load: Using profile directory '/usr/share/opensc'.                                                                       
[pkcs15-init] profile.c:306:sc_profile_load: Using profile directory '/usr/share/opensc'.
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f002f00, size=128                                                                                
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f00                                                                                              
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f001000, size=0                                                                                  
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f001000                                                                                          
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f0010001000, size=0                                                                              
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000                                                                                      
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006001, size=0                                                                          
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000                                                                                      
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006002, size=0                                                                          
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000                                                                                      
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006003, size=0                                                                          
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000                                                                                      
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006004, size=0                                                                          
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000                                                                                      
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006005, size=0                                                                          
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f00                                                                                              
[pkcs15-init] card.c:554:sc_select_file: returning with: 0                                                                                                      
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f005000, size=5000                                                                               
[pkcs15-init] card.c:367:sc_create_file: returning with: 0                                                                                                      
[pkcs15-init] pkcs15-rtecp.c:171:rtecp_create_pin: called                                                                                                       
[pkcs15-init] card.c:362:sc_create_file: called; type=0, path=, size=8                                                                                          
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Incorrect parameters in the data field                                                                             
[pkcs15-init] card-rtecp.c:564:rtecp_create_file: returning with: Incorrect parameters in APDU                                                                  
[pkcs15-init] card.c:367:sc_create_file: returning with: Incorrect parameters in APDU                                                                           
[pkcs15-init] pkcs15-rtecp.c:209:rtecp_create_pin: returning with: Incorrect parameters in APDU                                                                 
Failed to create PKCS #15 meta structure: Incorrect parameters in APDU                                                                                          
[pkcs15-init] card.c:236:sc_disconnect_card: called
[pkcs15-init] card.c:251:sc_disconnect_card: returning with: 0                                                                                                  
[pkcs15-init] ctx.c:765:sc_release_context: called

У меня в pkcs11-data на arm уже вылезала ошибка в ихнем враппере fork'а, я в ней еще детально не разбирался. Просто временный workaround, но грешу на их обветку мютексов...
подскажите, пожалуйста, в какую сторону копать?

Re: rutoken ECP + linux (архитектура arm)

Установите пожалуйста значение debug = 6 в файле opensc.conf для получения более подробной информации.

(2011-09-06 09:45:26 отредактировано metawishmaster)

Re: rutoken ECP + linux (архитектура arm)

Кирилл Мещеряков пишет:

Установите пожалуйста значение debug = 6 в файле opensc.conf для получения более подробной информации.

Здравствуйте Кирилл, форум мне не разрешил выкладывать тут 120К текста, поэтому вывод тут:  http://pastebin.com/raw.php?i=kwiAv5qx

[upd] если pastebin не работает, то вот еще: http://paste.pocoo.org/show/471178/

Re: rutoken ECP + linux (архитектура arm)

хмм.. а, какая у Вас версия OpenCT?

(2011-09-06 15:09:10 отредактировано metawishmaster)

Re: rutoken ECP + linux (архитектура arm)

Кирилл Мещеряков пишет:

хмм.. а, какая у Вас версия OpenCT?

а я оставил только pcsc...
и в конфиге, и при сборке пакета opensc

[upd] а pcsc-1.5.5

(2011-09-07 01:43:43 отредактировано metawishmaster)

Re: rutoken ECP + linux (архитектура arm)

Кирилл, прошу прощения!
у меня на х86 стояла версия opensc-0.12.1 (я ее из debian sid вытягивал и забыл про это), когда только что поставил 0.13.11, то ошибки были те же, но 0.12.1 форматирует все нормально и на x86, и на arm :)
спасибо, и еще раз извините за то, что не заметил ранее.

Re: rutoken ECP + linux (архитектура arm)

Извините, что долго соображал, только сейчас до меня дошло в чем дело.

Да, в 0.11.13 тоже будет работать.

Нужно только поменять в файле rutoken_ecp.profile два значения attempts на 10.

Если будет непонятно, смотрите здесь: http://www.opensc-project.org/opensc/ch … cp.profile

Re: rutoken ECP + linux (архитектура arm)

Кирилл Мещеряков пишет:

Извините, что долго соображал, только сейчас до меня дошло в чем дело.

Да, в 0.11.13 тоже будет работать.

Нужно только поменять в файле rutoken_ecp.profile два значения attempts на 10.

Если будет непонятно, смотрите здесь: http://www.opensc-project.org/opensc/ch … cp.profile

понял, спасибо :)