aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-01-09 04:24:57 +0000
committerNIIBE Yutaka <[email protected]>2013-02-05 05:05:07 +0000
commit7c110e997adda6252dbc7c2ff3fce1db3edaff94 (patch)
treec8da76238b5f1f360072937375d71e95a1b5aae5
parentSCD: Support not-so-smart card readers. (diff)
downloadgnupg-7c110e997adda6252dbc7c2ff3fce1db3edaff94.tar.gz
gnupg-7c110e997adda6252dbc7c2ff3fce1db3edaff94.zip
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.
-rw-r--r--scd/ccid-driver.c10
-rw-r--r--scd/scdaemon.c5
-rw-r--r--scd/scdaemon.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index dc50d479c..6d135e017 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -222,6 +222,7 @@ enum {
#define SCM_SPR532 0xe003
#define CHERRY_ST2000 0x003e
#define VASCO_920 0x0920
+#define GEMPC_PINPAD 0x3478
/* A list and a table with special transport descriptions. */
enum {
@@ -3308,6 +3309,7 @@ ccid_transceive_secure (ccid_driver_t handle,
size_t dummy_nresp;
int testmode;
int cherry_mode = 0;
+ int enable_varlen = opt.enable_keypad_varlen;
testmode = !resp && !nresp;
@@ -3346,11 +3348,14 @@ ccid_transceive_secure (ccid_driver_t handle,
case VENDOR_SCM: /* Tested with SPR 532. */
case VENDOR_KAAN: /* Tested with KAAN Advanced (1.02). */
case VENDOR_FSIJ: /* Tested with Gnuk (0.21). */
+ enable_varlen = 1;
break;
case VENDOR_VASCO: /* Tested with DIGIPASS 920 */
+ enable_varlen = 1;
pinlen_max = 15;
break;
case VENDOR_CHERRY:
+ enable_varlen = 1;
/* The CHERRY XX44 keyboard echos an asterisk for each entered
character on the keyboard channel. We use a special variant
of PC_to_RDR_Secure which directs these characters to the
@@ -3361,6 +3366,11 @@ ccid_transceive_secure (ccid_driver_t handle,
if (handle->id_product != CHERRY_ST2000)
cherry_mode = 1;
break;
+ case VENDOR_GEMPC:
+ enable_varlen = 0;
+ if (handle->id_product == GEMPC_PINPAD)
+ break;
+ /* fall through */
default:
return CCID_DRIVER_ERR_NOT_SUPPORTED;
}
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index defd03910..98f037f30 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -91,6 +91,7 @@ enum cmd_and_opt_values
oAllowAdmin,
oDenyAdmin,
oDisableApplication,
+ oEnableKeypadVarlen,
oDebugDisableTicker
};
@@ -143,6 +144,8 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oDenyAdmin, "deny-admin",
N_("deny the use of admin card commands")),
ARGPARSE_s_s (oDisableApplication, "disable-application", "@"),
+ ARGPARSE_s_n (oEnableKeypadVarlen, "enable-keypad-varlen",
+ N_("use variable length input for keypad")),
ARGPARSE_end ()
};
@@ -594,6 +597,8 @@ main (int argc, char **argv )
add_to_strlist (&opt.disabled_applications, pargs.r.ret_str);
break;
+ case oEnableKeypadVarlen: opt.enable_keypad_varlen = 1; break;
+
default:
pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
break;
diff --git a/scd/scdaemon.h b/scd/scdaemon.h
index c42939643..3eb0fe82a 100644
--- a/scd/scdaemon.h
+++ b/scd/scdaemon.h
@@ -57,6 +57,7 @@ struct
const char *reader_port; /* NULL or reder port to use. */
int disable_ccid; /* Disable the use of the internal CCID driver. */
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
cards. */
strlist_t disabled_applications; /* Card applications we do not