* scdaemon.c, scdaemon.h: New option --pcsc-driver.

* apdu.c (apdu_open_reader): Use that option here instead of a
hardcoded one.
This commit is contained in:
Werner Koch 2003-08-19 09:36:48 +00:00
parent 5e380eb635
commit e3cdba8386
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-08-19 Werner Koch <wk@gnupg.org>
* scdaemon.c, scdaemon.h: New option --pcsc-driver.
* apdu.c (apdu_open_reader): Use that option here instead of a
hardcoded one.
2003-08-18 Werner Koch <wk@gnupg.org>
* Makefile.am: Add OPENSC_LIBS to all programs.

View File

@ -798,6 +798,12 @@ apdu_open_reader (const char *portstr)
{
void *handle;
if (!opt.pcsc_driver || !*opt.pcsc_driver)
{
log_error ("no PC/SC driver has been specified\n");
return -1;
}
handle = dlopen ("libpcsclite.so", RTLD_LAZY);
if (!handle)
{

View File

@ -70,6 +70,7 @@ enum cmd_and_opt_values
oBatch,
oReaderPort,
octapiDriver,
opcscDriver,
oDisableOpenSC,
aTest };
@ -94,7 +95,8 @@ static ARGPARSE_OPTS opts[] = {
{ oNoDetach, "no-detach" ,0, N_("do not detach from the console")},
{ oLogFile, "log-file" ,2, N_("use a log file for the server")},
{ oReaderPort, "reader-port", 2, N_("|N|connect to reader at port N")},
{ octapiDriver, "ctapi-driver", 2, N_("NAME|use NAME as ctAPI driver")},
{ octapiDriver, "ctapi-driver", 2, N_("NAME|use NAME as ct-API driver")},
{ opcscDriver, "pcsc-driver", 2, N_("NAME|use NAME as PC/SC driver")},
{ oDisableOpenSC, "disable-opensc", 0,
#ifdef HAVE_OPENSC
N_("Do not use the OpenSC layer")
@ -266,6 +268,11 @@ main (int argc, char **argv )
may_coredump = disable_core_dumps ();
/* Set default options. */
opt.pcsc_driver = NULL; /* We can't use libpcsclite due to license
conflicts. */
shell = getenv ("SHELL");
if (shell && strlen (shell) >= 3 && !strcmp (shell+strlen (shell)-3, "csh") )
csh_style = 1;
@ -379,6 +386,7 @@ main (int argc, char **argv )
case oReaderPort: app_set_default_reader_port (pargs.r.ret_str); break;
case octapiDriver: opt.ctapi_driver = pargs.r.ret_str; break;
case opcscDriver: opt.pcsc_driver = pargs.r.ret_str; break;
case oDisableOpenSC: opt.disable_opensc = 1; break;
default : pargs.err = configfp? 1:2; break;

View File

@ -54,6 +54,7 @@ struct {
int batch; /* batch mode */
const char *homedir; /* configuration directory name */
const char *ctapi_driver; /* Library to access the ctAPI. */
const char *pcsc_driver; /* Library to access the PC/SC system. */
int disable_opensc; /* Disable the sue of the OpenSC framework. */
} opt;