1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

* command.c (register_commands): Adjusted for new Assuan semantics.

* Makefile.am: Don't override LDFLAGS.
This commit is contained in:
Werner Koch 2003-04-29 10:38:49 +00:00
parent fd959cdb59
commit ca4df4b123
3 changed files with 34 additions and 30 deletions

View File

@ -1,3 +1,9 @@
2003-04-29 Werner Koch <wk@gnupg.org>
* command.c (register_commands): Adjusted for new Assuan semantics.
* Makefile.am: Don't override LDFLAGS.
2002-12-04 Werner Koch <wk@gnupg.org> 2002-12-04 Werner Koch <wk@gnupg.org>
* gpg-agent.c: New variable config_filename. * gpg-agent.c: New variable config_filename.
@ -8,7 +14,8 @@
2002-12-03 Werner Koch <wk@gnupg.org> 2002-12-03 Werner Koch <wk@gnupg.org>
* protect-tool.c (read_key): Don't run make_canonical on a NULL buffer. * protect-tool.c (read_key): Don't run make_canonical on a NULL
buffer.
* command.c (parse_hexstring): New. * command.c (parse_hexstring): New.
(cmd_sethash): Use it. (cmd_sethash): Use it.

View File

@ -24,8 +24,8 @@ INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
bin_PROGRAMS = gpg-agent bin_PROGRAMS = gpg-agent
pkglib_PROGRAMS = gpg-protect-tool pkglib_PROGRAMS = gpg-protect-tool
AM_CPPFLAGS = -I$(top_srcdir)/common $(LIBGCRYPT_CFLAGS) $(PTH_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/common $(LIBGCRYPT_CFLAGS) \
LDFLAGS = @LDFLAGS@ $(LIBASSUAN_CFLAGS) $(PTH_CFLAGS)
gpg_agent_SOURCES = \ gpg_agent_SOURCES = \
gpg-agent.c agent.h \ gpg-agent.c agent.h \
@ -45,8 +45,8 @@ gpg_agent_SOURCES = \
sexp-parse.h sexp-parse.h
gpg_agent_LDADD = ../jnlib/libjnlib.a ../assuan/libassuan.a \ gpg_agent_LDADD = ../jnlib/libjnlib.a ../common/libcommon.a \
../common/libcommon.a $(LIBGCRYPT_LIBS) $(PTH_LIBS) $(LIBGCRYPT_LIBS) $(PTH_LIBS) $(LIBASSUAN_LIBS)
gpg_protect_tool_SOURCES = \ gpg_protect_tool_SOURCES = \
protect-tool.c \ protect-tool.c \

View File

@ -1,5 +1,5 @@
/* command.c - gpg-agent command handler /* command.c - gpg-agent 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.
* *
@ -29,8 +29,9 @@
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include <assuan.h>
#include "agent.h" #include "agent.h"
#include "../assuan/assuan.h"
/* maximum allowed size of the inquired ciphertext */ /* maximum allowed size of the inquired ciphertext */
#define MAXLEN_CIPHERTEXT 4096 #define MAXLEN_CIPHERTEXT 4096
@ -642,35 +643,31 @@ 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[] = {
{ "ISTRUSTED", 0, cmd_istrusted }, { "ISTRUSTED", cmd_istrusted },
{ "HAVEKEY", 0, cmd_havekey }, { "HAVEKEY", cmd_havekey },
{ "SIGKEY", 0, cmd_sigkey }, { "SIGKEY", cmd_sigkey },
{ "SETKEY", 0, cmd_sigkey }, { "SETKEY", cmd_sigkey },
{ "SETHASH", 0, cmd_sethash }, { "SETHASH", cmd_sethash },
{ "PKSIGN", 0, cmd_pksign }, { "PKSIGN", cmd_pksign },
{ "PKDECRYPT", 0, cmd_pkdecrypt }, { "PKDECRYPT", cmd_pkdecrypt },
{ "GENKEY", 0, cmd_genkey }, { "GENKEY", cmd_genkey },
{ "GET_PASSPHRASE",0, cmd_get_passphrase }, { "GET_PASSPHRASE", cmd_get_passphrase },
{ "CLEAR_PASSPHRASE",0, cmd_clear_passphrase }, { "CLEAR_PASSPHRASE", cmd_clear_passphrase },
{ "LISTTRUSTED", 0, cmd_listtrusted }, { "LISTTRUSTED", cmd_listtrusted },
{ "MARKTRUSTED", 0, cmd_marktrusted }, { "MARKTRUSTED", cmd_marktrusted },
{ "LEARN", 0, cmd_learn }, { "LEARN", cmd_learn },
{ "PASSWD", 0, cmd_passwd }, { "PASSWD", cmd_passwd },
{ "", 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;
} }