The function sc_prkey_op_init (in scard-opensc.c) requires for every private key a PKCS#15 AuthenticationObject object, but the this object is optional => sc_prkey_op_init fails if the key is not protected by a PIN. If sc_pkcs15_find_pin_by_auth_id retuns SC_ERROR_OBJECT_NOT_FOUND then (most likely) a PIN is not required to use the key => sc_prkey_op_init should simply copy the private key and return 0 (== no error). Regards, Nils
Created attachment 318 [details] proposed patch
Fix applied, thanks.
Created attachment 322 [details] fixed proposed patch Sorry Damien, but I overlooked that sc_prkey_op_init is expected to lock the card. With this patch (and with #577) I can use a PKCS#15 smart card with OpenSSH (v1,v2) via OpenSC under Linux and Windows (+Cygwin) (using ssh-agent or 'ssh -I ...' if the key is not protected by a PIN). Thanks, Nils
Sorry, but I overlooked a missing sc_lock.
Applied too, thanks.
Mass change of VERIFIED bugs to CLOSED