Bug 577

Summary: bug (wrong flag) in sc_private_decrypt (scard-opensc.c)
Product: Portable OpenSSH Reporter: Nils Larsch <larsch>
Component: SmartcardAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: -current   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
patch to fix the issue with the wrong sc_pkcs15_decrypt flag none

Description Nils Larsch 2003-05-27 22:28:01 AEST
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
Comment 1 Nils Larsch 2003-05-27 22:51:19 AEST
Created attachment 312 [details]
patch to fix the issue with the wrong sc_pkcs15_decrypt flag
Comment 2 Damien Miller 2003-06-04 21:53:27 AEST
Fix applied, thanks.
Comment 3 Damien Miller 2004-04-14 12:31:27 AEST
Mass change of VERIFIED bugs to CLOSED