Bug 577 - bug (wrong flag) in sc_private_decrypt (scard-opensc.c)
Summary: bug (wrong flag) in sc_private_decrypt (scard-opensc.c)
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Smartcard (show other bugs)
Version: -current
Hardware: All Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-27 22:28 AEST by Nils Larsch
Modified: 2004-04-14 12:31 AEST (History)
0 users

See Also:


Attachments
patch to fix the issue with the wrong sc_pkcs15_decrypt flag (476 bytes, patch)
2003-05-27 22:51 AEST, Nils Larsch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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