1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

SCD: Add option enable-keypad-varlen and support for GEMPC_PINPAD.

* scd/scdaemon.h (opt): Add enable_keypad_varlen.
* scd/scdaemon.c (cmd_and_opt_values): Add oEnableKeypadVarlen.
(opts, main): Add oEnableKeypadVarlen.
* scd/ccid-driver.c (GEMPC_PINPAD): New.
(ccid_transceive_secure): Add enable_varlen handling.
Enable GEMPC_PINPAD.
--
Note that GEMPC_PINPAD doesn't support variable length keypad input.
The feature of fixed length keypad input will be added soon.
This commit is contained in:
NIIBE Yutaka 2013-01-09 13:24:57 +09:00
parent 65eb98966a
commit d9f6cc7502
3 changed files with 16 additions and 0 deletions

View File

@ -220,6 +220,7 @@ enum {
#define SCM_SPR532 0xe003 #define SCM_SPR532 0xe003
#define CHERRY_ST2000 0x003e #define CHERRY_ST2000 0x003e
#define VASCO_920 0x0920 #define VASCO_920 0x0920
#define GEMPC_PINPAD 0x3478
/* A list and a table with special transport descriptions. */ /* A list and a table with special transport descriptions. */
enum { enum {
@ -3307,6 +3308,7 @@ ccid_transceive_secure (ccid_driver_t handle,
size_t dummy_nresp; size_t dummy_nresp;
int testmode; int testmode;
int cherry_mode = 0; int cherry_mode = 0;
int enable_varlen = opt.enable_keypad_varlen;
testmode = !resp && !nresp; testmode = !resp && !nresp;
@ -3345,11 +3347,14 @@ ccid_transceive_secure (ccid_driver_t handle,
case VENDOR_SCM: /* Tested with SPR 532. */ case VENDOR_SCM: /* Tested with SPR 532. */
case VENDOR_KAAN: /* Tested with KAAN Advanced (1.02). */ case VENDOR_KAAN: /* Tested with KAAN Advanced (1.02). */
case VENDOR_FSIJ: /* Tested with the gnuk code (2011-01-05). */ case VENDOR_FSIJ: /* Tested with the gnuk code (2011-01-05). */
enable_varlen = 1;
break; break;
case VENDOR_VASCO: /* Tested with DIGIPASS 920 */ case VENDOR_VASCO: /* Tested with DIGIPASS 920 */
enable_varlen = 1;
pinlen_max = 15; pinlen_max = 15;
break; break;
case VENDOR_CHERRY: case VENDOR_CHERRY:
enable_varlen = 1;
/* The CHERRY XX44 keyboard echos an asterisk for each entered /* The CHERRY XX44 keyboard echos an asterisk for each entered
character on the keyboard channel. We use a special variant character on the keyboard channel. We use a special variant
of PC_to_RDR_Secure which directs these characters to the of PC_to_RDR_Secure which directs these characters to the
@ -3360,6 +3365,11 @@ ccid_transceive_secure (ccid_driver_t handle,
if (handle->id_product != CHERRY_ST2000) if (handle->id_product != CHERRY_ST2000)
cherry_mode = 1; cherry_mode = 1;
break; break;
case VENDOR_GEMPC:
enable_varlen = 0;
if (handle->id_product == GEMPC_PINPAD)
break;
/* fall through */
default: default:
return CCID_DRIVER_ERR_NOT_SUPPORTED; return CCID_DRIVER_ERR_NOT_SUPPORTED;
} }

View File

@ -95,6 +95,7 @@ enum cmd_and_opt_values
oAllowAdmin, oAllowAdmin,
oDenyAdmin, oDenyAdmin,
oDisableApplication, oDisableApplication,
oEnableKeypadVarlen,
oDebugDisableTicker oDebugDisableTicker
}; };
@ -148,6 +149,8 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oDenyAdmin, "deny-admin", ARGPARSE_s_n (oDenyAdmin, "deny-admin",
N_("deny the use of admin card commands")), N_("deny the use of admin card commands")),
ARGPARSE_s_s (oDisableApplication, "disable-application", "@"), ARGPARSE_s_s (oDisableApplication, "disable-application", "@"),
ARGPARSE_s_n (oEnableKeypadVarlen, "enable-keypad-varlen",
N_("use variable length input for keypad")),
ARGPARSE_end () ARGPARSE_end ()
}; };
@ -587,6 +590,8 @@ main (int argc, char **argv )
add_to_strlist (&opt.disabled_applications, pargs.r.ret_str); add_to_strlist (&opt.disabled_applications, pargs.r.ret_str);
break; break;
case oEnableKeypadVarlen: opt.enable_keypad_varlen = 1; break;
default: default:
pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR; pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
break; break;

View File

@ -57,6 +57,7 @@ struct
const char *reader_port; /* NULL or reder port to use. */ const char *reader_port; /* NULL or reder port to use. */
int disable_ccid; /* Disable the use of the internal CCID driver. */ int disable_ccid; /* Disable the use of the internal CCID driver. */
int disable_keypad; /* Do not use a keypad. */ int disable_keypad; /* Do not use a keypad. */
int enable_keypad_varlen; /* Use variable length input for keypad. */
int allow_admin; /* Allow the use of admin commands for certain int allow_admin; /* Allow the use of admin commands for certain
cards. */ cards. */
strlist_t disabled_applications; /* Card applications we do not strlist_t disabled_applications; /* Card applications we do not