mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
scd: Fix READER-PORT option handling for PC/SC.
* scd/apdu.c (apdu_open_reader): READERNO should be -1 when READER-PORT is specified for PC/SC. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
21ef425e22
commit
ee5b6af370
14
scd/apdu.c
14
scd/apdu.c
@ -2129,12 +2129,15 @@ apdu_open_reader (struct dev_list *dl)
|
|||||||
if (!dl->table)
|
if (!dl->table)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUSB
|
||||||
/* See whether we want to use the reader ID string or a reader
|
/* See whether we want to use the reader ID string or a reader
|
||||||
number. A readerno of -1 indicates that the reader ID string is
|
number. A readerno of -1 indicates that the reader ID string is
|
||||||
to be used. */
|
to be used. */
|
||||||
if (dl->portstr && strchr (dl->portstr, ':'))
|
if (dl->portstr)
|
||||||
|
{
|
||||||
|
if (!opt.disable_ccid || strchr (dl->portstr, ':'))
|
||||||
readerno = -1; /* We want to use the readerid. */
|
readerno = -1; /* We want to use the readerid. */
|
||||||
else if (dl->portstr)
|
else
|
||||||
{
|
{
|
||||||
readerno = atoi (dl->portstr);
|
readerno = atoi (dl->portstr);
|
||||||
if (readerno < 0 || readerno >= dl->idx_max)
|
if (readerno < 0 || readerno >= dl->idx_max)
|
||||||
@ -2153,8 +2156,15 @@ apdu_open_reader (struct dev_list *dl)
|
|||||||
dl->idx = readerno;
|
dl->idx = readerno;
|
||||||
dl->portstr = NULL;
|
dl->portstr = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
readerno = 0; /* Default. */
|
readerno = 0; /* Default. */
|
||||||
|
#else
|
||||||
|
if (dl->portstr)
|
||||||
|
readerno = -1; /* We want to use the readerid. */
|
||||||
|
else
|
||||||
|
readerno = 0; /* Default. */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBUSB
|
#ifdef HAVE_LIBUSB
|
||||||
if (!opt.disable_ccid)
|
if (!opt.disable_ccid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user