mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
scd: more pinpad input fix for PC/SC.
* scd/apdu.c (check_pcsc_pinpad): Set default values here. (pcsc_pinpad_verify, pcsc_pinpad_modify): Remove setting default values, as it's too late. -- cherry picked from master.
This commit is contained in:
parent
07d7015e4d
commit
f72d9a5cf6
15
scd/apdu.c
15
scd/apdu.c
@ -2212,6 +2212,11 @@ check_pcsc_pinpad (int slot, int command, pininfo_t *pininfo)
|
||||
if (reader_table[slot].pcsc.pinmax >= 0)
|
||||
pininfo->maxlen = reader_table[slot].pcsc.pinmax;
|
||||
|
||||
if (!pininfo->minlen)
|
||||
pininfo->minlen = 1;
|
||||
if (!pininfo->maxlen)
|
||||
pininfo->maxlen = 15;
|
||||
|
||||
if ((command == ISO7816_VERIFY && reader_table[slot].pcsc.verify_ioctl != 0)
|
||||
|| (command == ISO7816_CHANGE_REFERENCE_DATA
|
||||
&& reader_table[slot].pcsc.modify_ioctl != 0))
|
||||
@ -2248,11 +2253,6 @@ pcsc_pinpad_verify (int slot, int class, int ins, int p0, int p1,
|
||||
if (pininfo->fixedlen < 0 || pininfo->fixedlen >= 16)
|
||||
return SW_NOT_SUPPORTED;
|
||||
|
||||
if (!pininfo->minlen)
|
||||
pininfo->minlen = 1;
|
||||
if (!pininfo->maxlen)
|
||||
pininfo->maxlen = 15;
|
||||
|
||||
pin_verify = xtrymalloc (len);
|
||||
if (!pin_verify)
|
||||
return SW_HOST_OUT_OF_CORE;
|
||||
@ -2328,11 +2328,6 @@ pcsc_pinpad_modify (int slot, int class, int ins, int p0, int p1,
|
||||
if (pininfo->fixedlen < 0 || pininfo->fixedlen >= 16)
|
||||
return SW_NOT_SUPPORTED;
|
||||
|
||||
if (!pininfo->minlen)
|
||||
pininfo->minlen = 1;
|
||||
if (!pininfo->maxlen)
|
||||
pininfo->maxlen = 15;
|
||||
|
||||
pin_modify = xtrymalloc (len);
|
||||
if (!pin_modify)
|
||||
return SW_HOST_OUT_OF_CORE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user