diff options
author | Werner Koch <[email protected]> | 2013-08-21 13:44:52 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2013-08-21 14:47:34 +0000 |
commit | 43e85d7bee4644ca84ef0ab0c3b08b2d02e4a699 (patch) | |
tree | aefdb2f0b237ce6f2182c9d3533069a25235d6f3 | |
parent | Post release updates. (diff) | |
download | gnupg-43e85d7bee4644ca84ef0ab0c3b08b2d02e4a699.tar.gz gnupg-43e85d7bee4644ca84ef0ab0c3b08b2d02e4a699.zip |
scd: Improve --enable-pinpad-varlen.
* tools/gpgconf-comp.c (gc_options_scdaemon): Add
enable-pinpad-varlen.
* scd/apdu.c (check_pcsc_pinpad): Detect SPRx32 reader.
Signed-off-by: Werner Koch <[email protected]>
(cherry picked from commit 7bde2bf3b0ddb5d3515a44879e1a7ddb581a5c0b)
-rw-r--r-- | doc/scdaemon.texi | 8 | ||||
-rw-r--r-- | scd/apdu.c | 8 | ||||
-rw-r--r-- | tools/gpgconf-comp.c | 4 |
3 files changed, 15 insertions, 5 deletions
diff --git a/doc/scdaemon.texi b/doc/scdaemon.texi index ed2cc5129..f454f1428 100644 --- a/doc/scdaemon.texi +++ b/doc/scdaemon.texi @@ -290,10 +290,10 @@ than 0. @item --enable-pinpad-varlen @opindex enable-pinpad-varlen Please specify this option when the card reader supports variable -length input for pinpad (default is no). For known readers listed in -ccid-driver, this option is not needed. Note that if your card reader -doesn't supports variable length input but you want to use it, you -need to specify your pinpad request on your card. +length input for pinpad (default is no). For known readers (listed in +ccid-driver.c and apdu.c), this option is not needed. Note that if +your card reader doesn't supports variable length input but you want +to use it, you need to specify your pinpad request on your card. @item --disable-pinpad diff --git a/scd/apdu.c b/scd/apdu.c index 372932aee..4b3509e72 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -2032,7 +2032,13 @@ check_pcsc_pinpad (int slot, int command, pininfo_t *pininfo) pcsc_dword_t len = 256; int sw; - (void)pininfo; /* XXX: Identify reader and set pininfo->fixedlen. */ + /* Hack to identify the SCM SPR532 and SPR332 readers which support + variable length PIN input. + FIXME: Figure out whether there is a feature attribute for this. + Alternatively use the USB ids to detect known readers. */ + if (reader_table[slot].rdrname + && strstr (reader_table[slot].rdrname, "SPRx32")) + pininfo->fixedlen = 0; check_again: if (command == ISO7816_VERIFY) diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 078dceadb..c43e87a00 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -612,6 +612,10 @@ static gc_option_t gc_options_scdaemon[] = { "disable-pinpad", GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME, GC_LEVEL_BASIC, "gnupg", "do not use a reader's pinpad", GC_ARG_TYPE_NONE, GC_BACKEND_SCDAEMON }, + { "enable-pinpad-varlen", + GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME, GC_LEVEL_BASIC, + "gnupg", "use variable length input for pinpad", + GC_ARG_TYPE_NONE, GC_BACKEND_SCDAEMON }, { "card-timeout", GC_OPT_FLAG_NONE|GC_OPT_FLAG_RUNTIME, GC_LEVEL_BASIC, "gnupg", "|N|disconnect the card after N seconds of inactivity", GC_ARG_TYPE_UINT32, GC_BACKEND_SCDAEMON }, |