* Makefile.am: Use libassuan. Don't override LDFLAGS anymore.

* server.c (register_commands): Adjust for new Assuan semantics.
This commit is contained in:
Werner Koch 2003-04-29 10:42:42 +00:00
parent ff272a6ed3
commit 735c284e73
4 changed files with 33 additions and 32 deletions

View File

@ -1,3 +1,8 @@
2003-04-29 Werner Koch <wk@gnupg.org>
* Makefile.am: Use libassuan. Don't override LDFLAGS anymore.
* server.c (register_commands): Adjust for new Assuan semantics.
2002-12-03 Werner Koch <wk@gnupg.org> 2002-12-03 Werner Koch <wk@gnupg.org>
* call-agent.c (gpgsm_agent_passwd): New. * call-agent.c (gpgsm_agent_passwd): New.
@ -762,7 +767,7 @@
* server.c (rc_to_assuan_status): New. Use it for all commands. * server.c (rc_to_assuan_status): New. Use it for all commands.
Copyright 2001, 2002 Free Software Foundation, Inc. Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This file is free software; as a special exception the author gives This file is free software; as a special exception the author gives
unlimited permission to copy and/or distribute it, with or without unlimited permission to copy and/or distribute it, with or without

View File

@ -1,4 +1,4 @@
# 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.
# #
@ -24,8 +24,7 @@ INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
bin_PROGRAMS = gpgsm bin_PROGRAMS = gpgsm
AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/intl \ AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/intl \
$(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(KSBA_CFLAGS)
LDFLAGS = @LDFLAGS@
gpgsm_SOURCES = \ gpgsm_SOURCES = \
gpgsm.c gpgsm.h \ gpgsm.c gpgsm.h \
@ -51,7 +50,7 @@ gpgsm_SOURCES = \
certreqgen.c certreqgen.c
gpgsm_LDADD = ../jnlib/libjnlib.a ../assuan/libassuan.a ../kbx/libkeybox.a \ gpgsm_LDADD = ../jnlib/libjnlib.a ../kbx/libkeybox.a ../common/libcommon.a \
../common/libcommon.a $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(KSBA_LIBS)

View File

@ -1,5 +1,5 @@
/* server.c - Server mode and main entry point /* server.c - Server mode and main entry point
* 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 <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include <assuan.h>
#include "gpgsm.h" #include "gpgsm.h"
#include "../assuan/assuan.h"
#define set_error(e,t) assuan_set_error (ctx, ASSUAN_ ## e, (t)) #define set_error(e,t) assuan_set_error (ctx, ASSUAN_ ## e, (t))
@ -719,34 +720,30 @@ 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[] = {
{ "RECIPIENT", 0, cmd_recipient }, { "RECIPIENT", cmd_recipient },
{ "SIGNER", 0, cmd_signer }, { "SIGNER", cmd_signer },
{ "ENCRYPT", 0, cmd_encrypt }, { "ENCRYPT", cmd_encrypt },
{ "DECRYPT", 0, cmd_decrypt }, { "DECRYPT", cmd_decrypt },
{ "VERIFY", 0, cmd_verify }, { "VERIFY", cmd_verify },
{ "SIGN", 0, cmd_sign }, { "SIGN", cmd_sign },
{ "IMPORT", 0, cmd_import }, { "IMPORT", cmd_import },
{ "EXPORT", 0, cmd_export }, { "EXPORT", cmd_export },
{ "", ASSUAN_CMD_INPUT, NULL }, { "INPUT", NULL },
{ "", ASSUAN_CMD_OUTPUT, NULL }, { "OUTPUT", NULL },
{ "MESSAGE", 0, cmd_message }, { "MESSAGE", cmd_message },
{ "LISTKEYS", 0, cmd_listkeys }, { "LISTKEYS", cmd_listkeys },
{ "LISTSECRETKEYS", 0, cmd_listsecretkeys }, { "LISTSECRETKEYS",cmd_listsecretkeys },
{ "GENKEY", 0, cmd_genkey }, { "GENKEY", cmd_genkey },
{ "DELKEYS", 0, cmd_delkeys }, { "DELKEYS", cmd_delkeys },
{ 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;
} }

View File

@ -101,8 +101,8 @@ hash_and_copy_data (int fd, GCRY_MD_HD md, KsbaWriter writer)
fclose (fp); fclose (fp);
if (!any) if (!any)
{ {
/* We can't allow to sign an empty message becuase it does not /* We can't allow to sign an empty message because it does not
make mnuch sense and more seriously, ksba-cms_build has make much sense and more seriously, ksba-cms_build has
already written the tag for data and now expects an octet already written the tag for data and now expects an octet
string but an octet string of zeize 0 is illegal. */ string but an octet string of zeize 0 is illegal. */
log_error ("cannot sign an empty message\n"); log_error ("cannot sign an empty message\n");