I've got the latest code and it compiles fine for me on windows. I've created a pull request on github for what looks to be a bug in the pkcs15-init.c get_pin where it compares the pin auth_type.
I'll keep tracking through the code, but please let me know if anyone has any tips for running opensc pkcs15-init with MuscleApplet. I'm still stuck with the following log output: 2011-12-04 14:17:17.224 [pkcs15-init] pkcs15-lib.c:706:sc_pkcs15init_add_app: called 2011-12-04 14:17:17.224 Add virtual SO_PIN('User PIN',flags:1A,reference:1,path:'3f005015') 2011-12-04 14:17:17.225 called; type=2, path=3f00 2011-12-04 14:17:17.225 [pkcs15-init] apdu.c:525:sc_transmit_apdu: called 2011-12-04 14:17:17.225 [pkcs15-init] card.c:292:sc_lock: called 2011-12-04 14:17:17.226 reader 'Gemplus USB Smart Card Reader 0' 2011-12-04 14:17:17.226 Outgoing APDU data [ 5 bytes] ===================================== B0 58 00 00 0E .X... ====================================================================== 2011-12-04 14:17:17.227 [pkcs15-init] reader-pcsc.c:176:pcsc_internal_transmit: called 2011-12-04 14:17:17.235 Incoming APDU data [ 2 bytes] ===================================== 9C 12 .. ====================================================================== 2011-12-04 14:17:17.236 [pkcs15-init] card.c:330:sc_unlock: called 2011-12-04 14:17:17.236 [pkcs15-init] apdu.c:525:sc_transmit_apdu: called 2011-12-04 14:17:17.237 [pkcs15-init] card.c:292:sc_lock: called 2011-12-04 14:17:17.237 reader 'Gemplus USB Smart Card Reader 0' 2011-12-04 14:17:17.238 Outgoing APDU data [ 5 bytes] ===================================== B0 58 00 00 0E .X... ====================================================================== 2011-12-04 14:17:17.238 [pkcs15-init] reader-pcsc.c:176:pcsc_internal_transmit: called 2011-12-04 14:17:17.246 Incoming APDU data [ 2 bytes] ===================================== 9C 12 .. ====================================================================== 2011-12-04 14:17:17.246 [pkcs15-init] card.c:330:sc_unlock: called 2011-12-04 14:17:17.247 [pkcs15-init] card-muscle.c:440:muscle_select_file: returning with: 0 (Success) 2011-12-04 14:17:17.247 [pkcs15-init] card.c:597:sc_select_file: returning with: 0 (Success) 2011-12-04 14:17:17.248 [pkcs15-init] pkcs15-lib.c:3158:sc_pkcs15init_authenticate: called 2011-12-04 14:17:17.248 path '3f00', op=3 2011-12-04 14:17:17.248 acl 01327B58 2011-12-04 14:17:17.249 verify acl(method:1,reference:1) 2011-12-04 14:17:17.249 [pkcs15-init] pkcs15-lib.c:3017:sc_pkcs15init_verify_secret: called 2011-12-04 14:17:17.250 get and verify PIN('PIN',type:0x1,reference:0x1) 2011-12-04 14:17:17.250 [pkcs15-init] pkcs15-lib.c:1640:sc_pkcs15init_get_pin_reference: called 2011-12-04 14:17:17.251 found 1 auth objects; looking for AUTH object(auth_method:1,reference:1) 2011-12-04 14:17:17.251 check PIN(User PIN,auth_method:1,type:1,reference:1,flags:1A) 2011-12-04 14:17:17.252 [pkcs15-init] pkcs15-lib.c:1660:sc_pkcs15init_get_pin_reference: returning with: 1 2011-12-04 14:17:17.252 found PIN reference 1 2011-12-04 14:17:17.252 found PIN object 'User PIN' 2011-12-04 14:17:17.253 PIN object 'User PIN'; pin_obj->content.len:0 2011-12-04 14:17:17.253 'get_pin' callback returned 0; pinsize:8 2011-12-04 14:17:17.254 [pkcs15-init] pkcs15-pin.c:234:sc_pkcs15_verify_pin: called 2011-12-04 14:17:17.254 PIN(0012F56C;len:8) 2011-12-04 14:17:17.255 [pkcs15-init] card.c:292:sc_lock: called 2011-12-04 14:17:17.255 called; type=2, path=3f005015 2011-12-04 14:17:17.256 [pkcs15-init] apdu.c:525:sc_transmit_apdu: called 2011-12-04 14:17:17.256 [pkcs15-init] card.c:292:sc_lock: called 2011-12-04 14:17:17.256 reader 'Gemplus USB Smart Card Reader 0' 2011-12-04 14:17:17.257 Outgoing APDU data [ 5 bytes] ===================================== B0 58 00 00 0E .X... ====================================================================== 2011-12-04 14:17:17.258 [pkcs15-init] reader-pcsc.c:176:pcsc_internal_transmit: called 2011-12-04 14:17:17.264 Incoming APDU data [ 2 bytes] ===================================== 9C 12 .. ====================================================================== 2011-12-04 14:17:17.265 [pkcs15-init] card.c:330:sc_unlock: called 2011-12-04 14:17:17.265 [pkcs15-init] apdu.c:525:sc_transmit_apdu: called 2011-12-04 14:17:17.266 [pkcs15-init] card.c:292:sc_lock: called 2011-12-04 14:17:17.266 reader 'Gemplus USB Smart Card Reader 0' 2011-12-04 14:17:17.267 Outgoing APDU data [ 5 bytes] ===================================== B0 58 00 00 0E .X... ====================================================================== 2011-12-04 14:17:17.267 [pkcs15-init] reader-pcsc.c:176:pcsc_internal_transmit: called 2011-12-04 14:17:17.274 Incoming APDU data [ 2 bytes] ===================================== 9C 12 .. ====================================================================== 2011-12-04 14:17:17.275 [pkcs15-init] card.c:330:sc_unlock: called 2011-12-04 14:17:17.275 [pkcs15-init] card-muscle.c:371:select_item: returning with: -1201 (File not found) 2011-12-04 14:17:17.276 [pkcs15-init] card-muscle.c:440:muscle_select_file: returning with: -1201 (File not found) 2011-12-04 14:17:17.276 [pkcs15-init] card.c:597:sc_select_file: returning with: -1201 (File not found) 2011-12-04 14:17:17.277 [pkcs15-init] card.c:330:sc_unlock: called 2011-12-04 14:17:17.277 [pkcs15-init] pkcs15-pin.c:296:sc_pkcs15_verify_pin: returning with: -1201 (File not found) 2011-12-04 14:17:17.277 [pkcs15-init] pkcs15-lib.c:3110:sc_pkcs15init_verify_secret: Cannot validate pkcs15 PIN: -1201 ( File not found) 2011-12-04 14:17:17.278 [pkcs15-init] pkcs15-lib.c:3191:sc_pkcs15init_authenticate: returning with: -1201 (File not foun d) 2011-12-04 14:17:17.279 [pkcs15-init] pkcs15-lib.c:777:sc_pkcs15init_add_app: Create 'DIR' error: -1201 (File not found) finishing with r=-1201 Failed to create PKCS #15 meta structure: File not found 2011-12-04 14:17:17.280 [pkcs15-init] card.c:330:sc_unlock: called 2011-12-04 14:17:17.280 [pkcs15-init] reader-pcsc.c:548:pcsc_unlock: called 2011-12-04 14:17:17.281 [pkcs15-init] card.c:242:sc_disconnect_card: called 2011-12-04 14:17:17.281 [pkcs15-init] reader-pcsc.c:498:pcsc_disconnect: called 2011-12-04 14:17:17.333 [pkcs15-init] card.c:258:sc_disconnect_card: returning with: 0 (Success) 2011-12-04 14:17:17.334 [pkcs15-init] ctx.c:737:sc_release_context: called 2011-12-04 14:17:17.334 [pkcs15-init] reader-pcsc.c:736:pcsc_finish: called _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel