mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-24 20:11:06 +01:00
* divert-scd.c (getpin_cb): Pass a more descritive text to the
pinentry. * Makefile.am: Renamed the binary protect-tool to gpg-protect-tool. * protect-tool.c: Removed the note about internal use only. * gpg-agent.c (main): New option --daemon so that the program is not accidently started in the background.
This commit is contained in:
parent
1cc0480be4
commit
a71981bace
@ -1,3 +1,14 @@
|
|||||||
|
2002-08-21 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* divert-scd.c (getpin_cb): Pass a more descritive text to the
|
||||||
|
pinentry.
|
||||||
|
|
||||||
|
* Makefile.am: Renamed the binary protect-tool to gpg-protect-tool.
|
||||||
|
* protect-tool.c: Removed the note about internal use only.
|
||||||
|
|
||||||
|
* gpg-agent.c (main): New option --daemon so that the program is
|
||||||
|
not accidently started in the background.
|
||||||
|
|
||||||
2002-08-16 Werner Koch <wk@gnupg.org>
|
2002-08-16 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* call-scd.c (learn_status_cb): Handle CERTINFO status.
|
* call-scd.c (learn_status_cb): Handle CERTINFO status.
|
||||||
|
@ -22,7 +22,7 @@ localedir = $(datadir)/locale
|
|||||||
INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
|
INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
|
||||||
|
|
||||||
bin_PROGRAMS = gpg-agent
|
bin_PROGRAMS = gpg-agent
|
||||||
pkglib_PROGRAMS = 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) $(PTH_CFLAGS)
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
@ -48,13 +48,13 @@ gpg_agent_SOURCES = \
|
|||||||
gpg_agent_LDADD = ../jnlib/libjnlib.a ../assuan/libassuan.a \
|
gpg_agent_LDADD = ../jnlib/libjnlib.a ../assuan/libassuan.a \
|
||||||
../common/libcommon.a $(LIBGCRYPT_LIBS) $(PTH_LIBS)
|
../common/libcommon.a $(LIBGCRYPT_LIBS) $(PTH_LIBS)
|
||||||
|
|
||||||
protect_tool_SOURCES = \
|
gpg_protect_tool_SOURCES = \
|
||||||
protect-tool.c \
|
protect-tool.c \
|
||||||
protect.c \
|
protect.c \
|
||||||
minip12.c minip12.h \
|
minip12.c minip12.h \
|
||||||
simple-pwquery.c simple-pwquery.h
|
simple-pwquery.c simple-pwquery.h
|
||||||
|
|
||||||
protect_tool_LDADD = ../jnlib/libjnlib.a \
|
gpg_protect_tool_LDADD = ../jnlib/libjnlib.a \
|
||||||
../common/libcommon.a $(LIBGCRYPT_LIBS)
|
../common/libcommon.a $(LIBGCRYPT_LIBS)
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "agent.h"
|
#include "agent.h"
|
||||||
#include "sexp-parse.h"
|
#include "sexp-parse.h"
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -173,14 +173,16 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
|
|||||||
{
|
{
|
||||||
struct pin_entry_info_s *pi;
|
struct pin_entry_info_s *pi;
|
||||||
int rc;
|
int rc;
|
||||||
|
char *desc;
|
||||||
|
|
||||||
assert (!opaque);
|
assert (!opaque);
|
||||||
|
|
||||||
if (maxbuf < 2)
|
if (maxbuf < 2)
|
||||||
return GNUPG_Invalid_Value;
|
return GNUPG_Invalid_Value;
|
||||||
|
|
||||||
/* FIXME: keep PI and TRIES in OPAQUE. Actually this is a whole
|
|
||||||
mess becuase we should call the card's verify function from the
|
/* FIXME: keep PI and TRIES in OPAQUE. Frankly this is a whole
|
||||||
|
mess because we should call the card's verify function from the
|
||||||
pinentry check pin CB. */
|
pinentry check pin CB. */
|
||||||
pi = gcry_calloc_secure (1, sizeof (*pi) + 100);
|
pi = gcry_calloc_secure (1, sizeof (*pi) + 100);
|
||||||
pi->max_length = maxbuf-1;
|
pi->max_length = maxbuf-1;
|
||||||
@ -188,7 +190,13 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
|
|||||||
pi->max_digits = 8;
|
pi->max_digits = 8;
|
||||||
pi->max_tries = 3;
|
pi->max_tries = 3;
|
||||||
|
|
||||||
rc = agent_askpin (info, pi);
|
if ( asprintf (&desc, _("Please enter the PIN%s%s%s to unlock the card"),
|
||||||
|
info? " (`":"",
|
||||||
|
info? info:"",
|
||||||
|
info? "')":"") < 0)
|
||||||
|
desc = NULL;
|
||||||
|
rc = agent_askpin (desc?desc:info, pi);
|
||||||
|
free (desc);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
{
|
{
|
||||||
strncpy (buf, pi->pin, maxbuf-1);
|
strncpy (buf, pi->pin, maxbuf-1);
|
||||||
|
@ -66,6 +66,7 @@ enum cmd_and_opt_values
|
|||||||
oNoGrab,
|
oNoGrab,
|
||||||
oLogFile,
|
oLogFile,
|
||||||
oServer,
|
oServer,
|
||||||
|
oDaemon,
|
||||||
oBatch,
|
oBatch,
|
||||||
|
|
||||||
oPinentryProgram,
|
oPinentryProgram,
|
||||||
@ -88,8 +89,9 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
|
|
||||||
{ 301, NULL, 0, N_("@Options:\n ") },
|
{ 301, NULL, 0, N_("@Options:\n ") },
|
||||||
|
|
||||||
{ oServer, "server", 0, N_("run in server mode") },
|
{ oServer, "server", 0, N_("run in server mode (foreground)") },
|
||||||
{ oVerbose, "verbose", 0, N_("verbose") },
|
{ oDaemon, "daemon", 0, N_("run in daemon mode (background)") },
|
||||||
|
{ oVerbose, "verbose", 0, N_("verbose") },
|
||||||
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
|
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
|
||||||
{ oSh, "sh", 0, N_("sh-style command output") },
|
{ oSh, "sh", 0, N_("sh-style command output") },
|
||||||
{ oCsh, "csh", 0, N_("csh-style command output") },
|
{ oCsh, "csh", 0, N_("csh-style command output") },
|
||||||
@ -258,6 +260,7 @@ main (int argc, char **argv )
|
|||||||
int greeting = 0;
|
int greeting = 0;
|
||||||
int nogreeting = 0;
|
int nogreeting = 0;
|
||||||
int pipe_server = 0;
|
int pipe_server = 0;
|
||||||
|
int is_daemon = 0;
|
||||||
int nodetach = 0;
|
int nodetach = 0;
|
||||||
int csh_style = 0;
|
int csh_style = 0;
|
||||||
char *logfile = NULL;
|
char *logfile = NULL;
|
||||||
@ -274,15 +277,15 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
/* check that the libraries are suitable. Do it here because
|
/* check that the libraries are suitable. Do it here because
|
||||||
the option parsing may need services of the library */
|
the option parsing may need services of the library */
|
||||||
if (!gcry_check_version ( "1.1.5" ) )
|
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
|
||||||
{
|
{
|
||||||
log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
|
log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
|
||||||
"1.1.5", gcry_check_version (NULL) );
|
NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
|
||||||
}
|
}
|
||||||
|
|
||||||
assuan_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
assuan_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
||||||
#ifdef USE_GNU_PTH
|
#ifdef USE_GNU_PTH
|
||||||
assuan_set_io_func (pth_read, pth_write);
|
assuan_set_io_func (pth_read, pth_write);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gcry_set_log_handler (my_gcry_logger, NULL);
|
gcry_set_log_handler (my_gcry_logger, NULL);
|
||||||
@ -397,6 +400,7 @@ main (int argc, char **argv )
|
|||||||
case oCsh: csh_style = 1; break;
|
case oCsh: csh_style = 1; break;
|
||||||
case oSh: csh_style = 0; break;
|
case oSh: csh_style = 0; break;
|
||||||
case oServer: pipe_server = 1; break;
|
case oServer: pipe_server = 1; break;
|
||||||
|
case oDaemon: is_daemon = 1; break;
|
||||||
case oDisablePth: disable_pth = 1; break;
|
case oDisablePth: disable_pth = 1; break;
|
||||||
|
|
||||||
case oPinentryProgram: opt.pinentry_program = pargs.r.ret_str; break;
|
case oPinentryProgram: opt.pinentry_program = pargs.r.ret_str; break;
|
||||||
@ -466,6 +470,11 @@ main (int argc, char **argv )
|
|||||||
{ /* this is the simple pipe based server */
|
{ /* this is the simple pipe based server */
|
||||||
start_command_handler (-1, -1);
|
start_command_handler (-1, -1);
|
||||||
}
|
}
|
||||||
|
else if (!is_daemon)
|
||||||
|
{
|
||||||
|
log_info (_("please use the option `--daemon'"
|
||||||
|
" to run the program in the background\n"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{ /* regular server mode */
|
{ /* regular server mode */
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -106,17 +106,17 @@ my_strusage (int level)
|
|||||||
const char *p;
|
const char *p;
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
case 11: p = "protect-tool (GnuPG)";
|
case 11: p = "gpg-protect-tool (GnuPG)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <" PACKAGE_BUGREPORT ">.\n");
|
case 19: p = _("Please report bugs to <" PACKAGE_BUGREPORT ">.\n");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 40: p = _("Usage: protect-tool [options] (-h for help)\n");
|
case 40: p = _("Usage: gpg-protect-tool [options] (-h for help)\n");
|
||||||
break;
|
break;
|
||||||
case 41: p = _("Syntax: protect-tool [options] [args]]\n"
|
case 41: p = _("Syntax: gpg-protect-tool [options] [args]]\n"
|
||||||
"INTERNAL USE ONLY!\n");
|
"Secret key maintenance tool\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: p = NULL;
|
default: p = NULL;
|
||||||
@ -812,13 +812,13 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
set_strusage (my_strusage);
|
set_strusage (my_strusage);
|
||||||
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
||||||
log_set_prefix ("protect-tool", 1);
|
log_set_prefix ("gpg-protect-tool", 1);
|
||||||
i18n_init ();
|
i18n_init ();
|
||||||
|
|
||||||
if (!gcry_check_version ( "1.1.5" ) )
|
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
|
||||||
{
|
{
|
||||||
log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
|
log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
|
||||||
"1.1.5", gcry_check_version (NULL) );
|
NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
|
||||||
}
|
}
|
||||||
|
|
||||||
gcry_set_log_handler (my_gcry_logger, NULL);
|
gcry_set_log_handler (my_gcry_logger, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user