From: Werner Koch Date: Tue, 17 Feb 2004 15:27:42 +0000 (+0000) Subject: * gpgme.texi (Key Listing Mode): Doc KEYLIST_MODE_VALIDATE. X-Git-Tag: gpgme-0-4-5~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=afabac4c9dbc0ee0a88ad225b27be3836509f5f9;p=gpgme.git * gpgme.texi (Key Listing Mode): Doc KEYLIST_MODE_VALIDATE. * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE. * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm. --- diff --git a/TODO b/TODO index bd2eaca..b80bef8 100644 --- a/TODO +++ b/TODO @@ -144,4 +144,9 @@ Hey Emacs, this is -*- outline -*- mode! * Build suite ** Make sure everything is cleaned correctly (esp. test area). -** Cofnigure test for gpg and gpgsm version (as a warning). +** Configure test for gpg and gpgsm version (as a warning). + + +* Error checking +** engine-gpgsm, with-validation + Add error checking some time after releasing a new gpgsm. diff --git a/doc/ChangeLog b/doc/ChangeLog index 0565d7e..809cc14 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2004-02-17 Werner Koch + + * gpgme.texi (Key Listing Mode): Doc KEYLIST_MODE_VALIDATE. + 2004-02-06 Moritz Schulte * gpgme.texi: A couple of small fixes regarding the Largfile diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 4f735c8..3e5e898 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -1983,6 +1983,14 @@ certificate server. @item GPGME_KEYLIST_MODE_SIGS The @code{GPGME_KEYLIST_MODE_SIGS} symbol specifies that the key signatures should be included in the listed keys. + +@item GPGME_KEYLIST_MODE_VALIDATE +The @code{GPGME_KEYLIST_MODE_VALIDATE} symbol specifies that the +backend should do key or certificate validation and not just get the +validity information from an interna cache. This might be an +expensive operation and is in general not usefule. Currently only +implemented for the S/MIME backend and ignored for other backends. + @end table At least one of @code{GPGME_KEYLIST_MODE_LOCAL} and @@ -2348,7 +2356,10 @@ This is true if the key is expired. This is true if the key is disabled. @item unsigned int invalid : 1 -This is true if the key is invalid. +This is true if the key is invalid. This might have several reasons, +for a example for the S/MIME backend, it will be set in during key +listsing if the key could not be validated due to a missing +certificates or unmatched policies. @item unsigned int can_encrypt : 1 This is true if the key (ie one of its subkeys) can be used for diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 065f8cd..2a3488b 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2004-02-17 Werner Koch + + * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE. + * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm. + 2004-02-15 Werner Koch * memrchr.c (memrchr): Fixed implementation. Problem pointed out diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index 486c745..46c8090 100644 --- a/gpgme/engine-gpgsm.c +++ b/gpgme/engine-gpgsm.c @@ -1,6 +1,6 @@ /* engine-gpgsm.c - GpgSM engine. Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH This file is part of GPGME. @@ -1226,6 +1226,16 @@ gpgsm_keylist (void *engine, const char *pattern, int secret_only, if (err) return err; + + /* Use the validation mode if required. We don't check for an error + yet because this is a pretty fresh gpgsm features. */ + gpgsm_assuan_simple_command (gpgsm->assuan_ctx, + (mode & GPGME_KEYLIST_MODE_VALIDATE)? + "OPTION with-validation=1": + "OPTION with-validation=0" , + NULL, NULL); + + /* Length is "LISTSECRETKEYS " + p + '\0'. */ line = malloc (15 + strlen (pattern) + 1); if (!line) diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h index 110fad0..4dd72ff 100644 --- a/gpgme/gpgme.h +++ b/gpgme/gpgme.h @@ -1,6 +1,6 @@ /* gpgme.h - Public interface to GnuPG Made Easy. Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH This file is part of GPGME. @@ -71,7 +71,7 @@ extern "C" { AM_PATH_GPGME macro) check that this header matches the installed library. Warning: Do not edit the next line. configure will do that for you! */ -#define GPGME_VERSION "0.4.4" +#define GPGME_VERSION "0.4.5-cvs" /* Some opaque data types used by GPGME. */ @@ -698,7 +698,8 @@ typedef enum { GPGME_KEYLIST_MODE_LOCAL = 1, GPGME_KEYLIST_MODE_EXTERN = 2, - GPGME_KEYLIST_MODE_SIGS = 4 + GPGME_KEYLIST_MODE_SIGS = 4, + GPGME_KEYLIST_MODE_VALIDATE = 256 } gpgme_keylist_mode_t;