mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-11 21:48:50 +01:00
* options.h (ctrl): New for member IN_AUTO_KEY_RETRIEVE.
* mainproc.c (check_sig_and_print): track whether we are retrieving a key. * status.c (status_currently_allowed): New. (write_status_text, write_status_text_and_buffer): Use it here. * g10.c: New command --gpgconf-list. (gpgconf_list): New. From Werner on stable branch.
This commit is contained in:
parent
c19c728afa
commit
cc383b6432
@ -1,5 +1,13 @@
|
|||||||
2004-05-20 David Shaw <dshaw@jabberwocky.com>
|
2004-05-20 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* options.h (ctrl): New for member IN_AUTO_KEY_RETRIEVE.
|
||||||
|
|
||||||
|
* mainproc.c (check_sig_and_print): track whether we are
|
||||||
|
retrieving a key.
|
||||||
|
|
||||||
|
* status.c (status_currently_allowed): New.
|
||||||
|
(write_status_text, write_status_text_and_buffer): Use it here.
|
||||||
|
|
||||||
* g10.c: New command --gpgconf-list.
|
* g10.c: New command --gpgconf-list.
|
||||||
(gpgconf_list): New. From Werner on stable branch.
|
(gpgconf_list): New. From Werner on stable branch.
|
||||||
|
|
||||||
|
@ -1348,7 +1348,12 @@ check_sig_and_print( CTX c, KBNODE node )
|
|||||||
if( rc == G10ERR_NO_PUBKEY && opt.keyserver
|
if( rc == G10ERR_NO_PUBKEY && opt.keyserver
|
||||||
&& (opt.keyserver_options.options&KEYSERVER_AUTO_KEY_RETRIEVE))
|
&& (opt.keyserver_options.options&KEYSERVER_AUTO_KEY_RETRIEVE))
|
||||||
{
|
{
|
||||||
if( keyserver_import_keyid ( sig->keyid )==0 )
|
int res;
|
||||||
|
|
||||||
|
ctrl.in_auto_key_retrieve++;
|
||||||
|
res=keyserver_import_keyid ( sig->keyid );
|
||||||
|
ctrl.in_auto_key_retrieve--;
|
||||||
|
if(!res)
|
||||||
rc = do_check_sig(c, node, NULL, &is_expkey, &is_revkey );
|
rc = do_check_sig(c, node, NULL, &is_expkey, &is_revkey );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +201,15 @@ struct
|
|||||||
|
|
||||||
} opt;
|
} opt;
|
||||||
|
|
||||||
|
/* CTRL is used to keep some global variables we currently can't
|
||||||
|
avoid. Future concurrent versions of gpg will put it into a per
|
||||||
|
request structure CTRL. */
|
||||||
|
EXTERN_UNLESS_MAIN_MODULE
|
||||||
|
struct {
|
||||||
|
int in_auto_key_retrieve; /* True if we are doing an
|
||||||
|
auto_key_retrieve. */
|
||||||
|
} ctrl;
|
||||||
|
|
||||||
#define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
|
#define DBG_PACKET_VALUE 1 /* debug packet reading/writing */
|
||||||
#define DBG_MPI_VALUE 2 /* debug mpi details */
|
#define DBG_MPI_VALUE 2 /* debug mpi details */
|
||||||
#define DBG_CIPHER_VALUE 4 /* debug cipher handling */
|
#define DBG_CIPHER_VALUE 4 /* debug cipher handling */
|
||||||
|
44
g10/status.c
44
g10/status.c
@ -1,5 +1,6 @@
|
|||||||
/* status.c
|
/* status.c
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
* Copyright (C) 1998, 1999, 2000, 2001, 2002,
|
||||||
|
* 2004 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of GnuPG.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -157,6 +158,39 @@ get_status_string ( int no )
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Return true if the status message NO may currently be issued. We
|
||||||
|
need this to avoid syncronisation problem while auto retrieving a
|
||||||
|
key. There it may happen that a status NODATA is issued for a non
|
||||||
|
available key and the user may falsely interpret this has a missing
|
||||||
|
signature. */
|
||||||
|
static int
|
||||||
|
status_currently_allowed (int no)
|
||||||
|
{
|
||||||
|
if (!ctrl.in_auto_key_retrieve)
|
||||||
|
return 1; /* Yes. */
|
||||||
|
|
||||||
|
/* We allow some statis anyway, so that import statistics are
|
||||||
|
correct and to avoid problems if the retriebval subsystem will
|
||||||
|
prompt the user. */
|
||||||
|
switch (no)
|
||||||
|
{
|
||||||
|
case STATUS_GET_BOOL:
|
||||||
|
case STATUS_GET_LINE:
|
||||||
|
case STATUS_GET_HIDDEN:
|
||||||
|
case STATUS_GOT_IT:
|
||||||
|
case STATUS_IMPORTED:
|
||||||
|
case STATUS_IMPORT_OK:
|
||||||
|
case STATUS_IMPORT_CHECK:
|
||||||
|
case STATUS_IMPORT_RES:
|
||||||
|
return 1; /* Yes. */
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0; /* No. */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
set_status_fd ( int fd )
|
set_status_fd ( int fd )
|
||||||
{
|
{
|
||||||
@ -202,8 +236,8 @@ write_status ( int no )
|
|||||||
void
|
void
|
||||||
write_status_text ( int no, const char *text)
|
write_status_text ( int no, const char *text)
|
||||||
{
|
{
|
||||||
if( !statusfp )
|
if( !statusfp || !status_currently_allowed (no) )
|
||||||
return; /* not enabled */
|
return; /* Not enabled or allowed. */
|
||||||
|
|
||||||
fputs ( "[GNUPG:] ", statusfp );
|
fputs ( "[GNUPG:] ", statusfp );
|
||||||
fputs ( get_status_string (no), statusfp );
|
fputs ( get_status_string (no), statusfp );
|
||||||
@ -238,8 +272,8 @@ write_status_text_and_buffer ( int no, const char *string,
|
|||||||
int lower_limit = ' ';
|
int lower_limit = ' ';
|
||||||
size_t n, count, dowrap;
|
size_t n, count, dowrap;
|
||||||
|
|
||||||
if( !statusfp )
|
if( !statusfp || !status_currently_allowed (no) )
|
||||||
return; /* not enabled */
|
return; /* Not enabled or allowed. */
|
||||||
|
|
||||||
if (wrap == -1) {
|
if (wrap == -1) {
|
||||||
lower_limit--;
|
lower_limit--;
|
||||||
|
Loading…
Reference in New Issue
Block a user