There's a small bug in scard-opensc.c. The OpenSC function sc_pkcs15_decipher is called with the wrong flag. Currently sc_private_decrypt set the flag to 0 and hence OpenSC uses RSA raw to decipher the cryptogram => the Smartcard (or OpenSC) does not remove the PKCS#1 padding => v1 authentication fails because the returned data has the wrong length. To fix this problem simply replace: r = sc_pkcs15_decipher(p15card, key_obj, 0, from, flen, to, flen); with r = sc_pkcs15_decipher(p15card, key_obj, SC_ALGORITHM_RSA_PAD_PKCS1, from, flen, to, flen); Nils
Created attachment 312 [details] patch to fix the issue with the wrong sc_pkcs15_decrypt flag
Fix applied, thanks.
Mass change of VERIFIED bugs to CLOSED