mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
* Makefile.am (LDFLAGS): Removed.
* command.c (register_commands): Adjusted for new Assuan semantics.
This commit is contained in:
parent
84a9ac9572
commit
ff272a6ed3
@ -1,3 +1,9 @@
|
|||||||
|
2003-04-29 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* Makefile.am (LDFLAGS): Removed.
|
||||||
|
|
||||||
|
* command.c (register_commands): Adjusted for new Assuan semantics.
|
||||||
|
|
||||||
2002-08-21 Werner Koch <wk@gnupg.org>
|
2002-08-21 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* scdaemon.c (main): New option --daemon so that the program is
|
* scdaemon.c (main): New option --daemon so that the program is
|
||||||
|
@ -25,7 +25,6 @@ bin_PROGRAMS = scdaemon
|
|||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/common $(OPENSC_CFLAGS) $(LIBGCRYPT_CFLAGS) \
|
AM_CPPFLAGS = -I$(top_srcdir)/common $(OPENSC_CFLAGS) $(LIBGCRYPT_CFLAGS) \
|
||||||
$(KSBA_CFLAGS)
|
$(KSBA_CFLAGS)
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
|
|
||||||
scdaemon_SOURCES = \
|
scdaemon_SOURCES = \
|
||||||
scdaemon.c scdaemon.h \
|
scdaemon.c scdaemon.h \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* command.c - SCdaemon command handler
|
/* command.c - SCdaemon command handler
|
||||||
* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -27,8 +27,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ksba.h>
|
#include <ksba.h>
|
||||||
|
|
||||||
|
#include <assuan.h>
|
||||||
|
|
||||||
#include "scdaemon.h"
|
#include "scdaemon.h"
|
||||||
#include "../assuan/assuan.h"
|
|
||||||
|
|
||||||
/* maximum length aloowed as a PIN; used for INQUIRE NEEDPIN */
|
/* maximum length aloowed as a PIN; used for INQUIRE NEEDPIN */
|
||||||
#define MAXLEN_PIN 100
|
#define MAXLEN_PIN 100
|
||||||
@ -548,28 +549,24 @@ register_commands (ASSUAN_CONTEXT ctx)
|
|||||||
{
|
{
|
||||||
static struct {
|
static struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
int cmd_id;
|
|
||||||
int (*handler)(ASSUAN_CONTEXT, char *line);
|
int (*handler)(ASSUAN_CONTEXT, char *line);
|
||||||
} table[] = {
|
} table[] = {
|
||||||
{ "SERIALNO", 0, cmd_serialno },
|
{ "SERIALNO", cmd_serialno },
|
||||||
{ "LEARN", 0, cmd_learn },
|
{ "LEARN", cmd_learn },
|
||||||
{ "READCERT", 0, cmd_readcert },
|
{ "READCERT", cmd_readcert },
|
||||||
{ "READKEY", 0, cmd_readkey },
|
{ "READKEY", cmd_readkey },
|
||||||
{ "SETDATA", 0, cmd_setdata },
|
{ "SETDATA", cmd_setdata },
|
||||||
{ "PKSIGN", 0, cmd_pksign },
|
{ "PKSIGN", cmd_pksign },
|
||||||
{ "PKDECRYPT", 0,cmd_pkdecrypt },
|
{ "PKDECRYPT", cmd_pkdecrypt },
|
||||||
{ "", ASSUAN_CMD_INPUT, NULL },
|
{ "INPUT", NULL },
|
||||||
{ "", ASSUAN_CMD_OUTPUT, NULL },
|
{ "OUTPUT", NULL },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
int i, j, rc;
|
int i, rc;
|
||||||
|
|
||||||
for (i=j=0; table[i].name; i++)
|
for (i=0; table[i].name; i++)
|
||||||
{
|
{
|
||||||
rc = assuan_register_command (ctx,
|
rc = assuan_register_command (ctx, table[i].name, table[i].handler);
|
||||||
table[i].cmd_id? table[i].cmd_id
|
|
||||||
: (ASSUAN_CMD_USER + j++),
|
|
||||||
table[i].name, table[i].handler);
|
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user