diff options
author | Werner Koch <[email protected]> | 2003-04-29 19:08:35 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-04-29 19:08:35 +0000 |
commit | 9e6c5f9a617088b3930cbd5953a2fc6acaa92833 (patch) | |
tree | e47eea249f946d49ca29f4d20199d11d3f2c0934 /scd/scdaemon.c | |
parent | * Makefile.am: Use libassuan. Don't override LDFLAGS anymore. (diff) | |
download | gnupg-9e6c5f9a617088b3930cbd5953a2fc6acaa92833.tar.gz gnupg-9e6c5f9a617088b3930cbd5953a2fc6acaa92833.zip |
* scdaemon.c: New options --print-atr and --reader-port
* apdu.c, apdu.h: New
* card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
Diffstat (limited to '')
-rw-r--r-- | scd/scdaemon.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/scd/scdaemon.c b/scd/scdaemon.c index b63b59c5b..902324ad7 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -38,8 +38,8 @@ #include <gcrypt.h> #define JNLIB_NEED_LOG_LOGV +#include <assuan.h> /* malloc hooks */ #include "scdaemon.h" -#include "../assuan/assuan.h" /* malloc hooks */ #include "i18n.h" #include "sysutils.h" @@ -68,6 +68,8 @@ enum cmd_and_opt_values oServer, oDaemon, oBatch, + oReaderPort, + oPrintATR, aTest }; @@ -90,7 +92,8 @@ static ARGPARSE_OPTS opts[] = { { oDebugSC, "debug-sc", 1, N_("|N|set OpenSC debug level to N")}, { 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", 1, N_("|N|connect to reader at port N")}, + { oPrintATR, "print-atr", 0, N_("print ATR and exit")}, {0} }; @@ -229,6 +232,10 @@ main (int argc, char **argv ) int csh_style = 0; char *logfile = NULL; int debug_wait = 0; + int reader_port = 32768; /* First USB reader. */ + int print_atr = 0; + + set_strusage (my_strusage); gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN); @@ -363,6 +370,9 @@ main (int argc, char **argv ) case oServer: pipe_server = 1; break; case oDaemon: is_daemon = 1; break; + case oReaderPort: reader_port = pargs.r.ret_int; break; + case oPrintATR: print_atr = 1; break; + default : pargs.err = configfp? 1:2; break; } } @@ -399,6 +409,13 @@ main (int argc, char **argv ) exit (1); } + + if (print_atr) + { + apdu_open_reader (reader_port); + scd_exit (0); + } + if (debug_wait && pipe_server) { log_debug ("waiting for debugger - my pid is %u .....\n", |