mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
SCD: Support fixed length PIN input for keypad.
* scd/iso7816.h (struct pininfo_s): Remove MODE and add FIXEDLEN. * scd/app-dinsig.c (verify_pin): Initialize FIXEDLEN to unknown. * scd/app-nks.c (verify_pin): Likewise. * scd/app-openpgp.c (verify_a_chv, verify_chv3, do_change_pin): Likewise. * scd/apdu.c (check_pcsc_keypad): Add comment. (pcsc_keypad_verify, pcsc_keypad_modify): PC/SC driver only support readers with the feature of variable length input (yet). (apdu_check_keypad): Set FIXEDLEN. * scd/ccid-driver.c (ccid_transceive_secure): Add GEMPC_PINPAD specific settings. Support fixed length PIN input for keypad.
This commit is contained in:
parent
b526f6e223
commit
40a914a2e3
6 changed files with 52 additions and 21 deletions
|
@ -1986,7 +1986,7 @@ check_pcsc_keypad (int slot, int command, pininfo_t *pininfo)
|
|||
size_t len = 256;
|
||||
int sw;
|
||||
|
||||
(void)pininfo;
|
||||
(void)pininfo; /* XXX: Identify reader and set pininfo->fixedlen. */
|
||||
|
||||
check_again:
|
||||
if (command == ISO7816_VERIFY)
|
||||
|
@ -2050,7 +2050,7 @@ pcsc_keypad_verify (int slot, int class, int ins, int p0, int p1,
|
|||
&& (sw = reset_pcsc_reader (slot)))
|
||||
return sw;
|
||||
|
||||
if (pininfo->mode != 1)
|
||||
if (pininfo->fixedlen != 0)
|
||||
return SW_NOT_SUPPORTED;
|
||||
|
||||
if (!pininfo->minlen)
|
||||
|
@ -2131,7 +2131,7 @@ pcsc_keypad_modify (int slot, int class, int ins, int p0, int p1,
|
|||
&& (sw = reset_pcsc_reader (slot)))
|
||||
return sw;
|
||||
|
||||
if (pininfo->mode != 1)
|
||||
if (pininfo->fixedlen != 0)
|
||||
return SW_NOT_SUPPORTED;
|
||||
|
||||
if (!pininfo->minlen)
|
||||
|
@ -3397,7 +3397,7 @@ apdu_check_keypad (int slot, int command, pininfo_t *pininfo)
|
|||
return SW_HOST_NO_DRIVER;
|
||||
|
||||
if (opt.enable_keypad_varlen)
|
||||
pininfo->mode = 0;
|
||||
pininfo->fixedlen = 0;
|
||||
|
||||
if (reader_table[slot].check_keypad)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue