gpgme (7 files)
cvs user marcus
cvs at cvs.gnupg.org
Thu Apr 28 17:53:54 CEST 2005
Date: Thursday, April 28, 2005 @ 18:11:34
Author: marcus
Path: /cvs/gpgme/gpgme
Modified: NEWS doc/ChangeLog doc/gpgme.texi gpgme/ChangeLog
gpgme/engine-gpgsm.c gpgme/gpgme.c gpgme/gpgme.h
doc/
2005-04-28 Marcus Brinkmann <marcus at g10code.de>
* gpgme.texi (Included Certificates): Document
GPGME_INCLUDE_CERTS_DEFAULT.
gpgme/
2005-04-28 Marcus Brinkmann <marcus at g10code.de>
* gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
* engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
the reset, just for cleanliness, and do not sent it at all if the
default is requested.
* gpgme.c (gpgme_set_include_certs): Allow to use
GPGME_INCLUDE_CERTS_DEFAULT.
----------------------+
NEWS | 11 +++++++++++
doc/ChangeLog | 5 +++++
doc/gpgme.texi | 3 +++
gpgme/ChangeLog | 9 +++++++++
gpgme/engine-gpgsm.c | 22 +++++++++++++++-------
gpgme/gpgme.c | 8 +++++---
gpgme/gpgme.h | 3 +++
7 files changed, 51 insertions(+), 10 deletions(-)
Index: gpgme/NEWS
diff -u gpgme/NEWS:1.139 gpgme/NEWS:1.140
--- gpgme/NEWS:1.139 Wed Jan 12 11:28:42 2005
+++ gpgme/NEWS Thu Apr 28 18:11:34 2005
@@ -4,10 +4,21 @@
* You can now configure the backend engine file name and home
directory to be used, as default and per context.
+ * Previousy, GPGME would use a default "include certs" of 1. This
+ has been changed. Now GPGME will use the crypto backend engines
+ default unless you set the value with gpgme_set_include_certs()
+ explicitely. A new macro GPGME_INCLUDE_CERTS_DEFAULT can be used
+ as a value to explicitely request the new default behaviour.
+
+ Because the default changes, this is a slight change of the API
+ semantics. We consider it to be a bug fix.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_set_engine_info NEW
gpgme_ctx_get_engine_info NEW
gpgme_ctx_set_engine_info NEW
+gpgme_set_include_certs CHANGED DEFAULT
+GPGME_INCLUDE_CERTS_DEFAULT NEW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: gpgme/doc/ChangeLog
diff -u gpgme/doc/ChangeLog:1.135 gpgme/doc/ChangeLog:1.136
--- gpgme/doc/ChangeLog:1.135 Wed Jan 12 12:13:17 2005
+++ gpgme/doc/ChangeLog Thu Apr 28 18:11:34 2005
@@ -1,3 +1,8 @@
+2005-04-28 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgme.texi (Included Certificates): Document
+ GPGME_INCLUDE_CERTS_DEFAULT.
+
2005-01-12 Marcus Brinkmann <marcus at g10code.de>
* gpgme.texi (Engine Configuration): New section.
Index: gpgme/doc/gpgme.texi
diff -u gpgme/doc/gpgme.texi:1.137 gpgme/doc/gpgme.texi:1.138
--- gpgme/doc/gpgme.texi:1.137 Wed Jan 12 12:13:17 2005
+++ gpgme/doc/gpgme.texi Thu Apr 28 18:11:34 2005
@@ -2028,6 +2028,9 @@
values of @var{nr_of_certs} are:
@table @code
+ at item GPGME_INCLUDE_CERTS_DEFAULT
+Fall back to the default of the crypto backend. This is the default
+for GPGME.
@item -2
Include all certificates except the root certificate.
@item -1
Index: gpgme/gpgme/ChangeLog
diff -u gpgme/gpgme/ChangeLog:1.397 gpgme/gpgme/ChangeLog:1.398
--- gpgme/gpgme/ChangeLog:1.397 Thu Apr 21 09:13:41 2005
+++ gpgme/gpgme/ChangeLog Thu Apr 28 18:11:33 2005
@@ -1,3 +1,12 @@
+2005-04-28 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
+ * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
+ the reset, just for cleanliness, and do not sent it at all if the
+ default is requested.
+ * gpgme.c (gpgme_set_include_certs): Allow to use
+ GPGME_INCLUDE_CERTS_DEFAULT.
+
2005-04-21 Werner Koch <wk at g10code.com>
* verify.c (calc_sig_summary): Set the key revoked bit.
Index: gpgme/gpgme/engine-gpgsm.c
diff -u gpgme/gpgme/engine-gpgsm.c:1.105 gpgme/gpgme/engine-gpgsm.c:1.106
--- gpgme/gpgme/engine-gpgsm.c:1.105 Thu Mar 24 14:05:12 2005
+++ gpgme/gpgme/engine-gpgsm.c Thu Apr 28 18:11:33 2005
@@ -1437,19 +1437,27 @@
if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE);
- if (asprintf (&assuan_cmd, "OPTION include-certs %i", include_certs) < 0)
- return gpg_error_from_errno (errno);
- err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, assuan_cmd, NULL,NULL);
- free (assuan_cmd);
- if (err)
- return err;
-
/* We must send a reset because we need to reset the list of
signers. Note that RESET does not reset OPTION commands. */
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, "RESET", NULL, NULL);
if (err)
return err;
+ if (include_certs != GPGME_INCLUDE_CERTS_DEFAULT)
+ {
+ /* FIXME: Make sure that if we run multiple operations, that we
+ can reset any previously set value in case the default is
+ requested. */
+
+ if (asprintf (&assuan_cmd, "OPTION include-certs %i", include_certs) < 0)
+ return gpg_error_from_errno (errno);
+ err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, assuan_cmd,
+ NULL, NULL);
+ free (assuan_cmd);
+ if (err)
+ return err;
+ }
+
for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++)
{
const char *s = key->subkeys ? key->subkeys->fpr : NULL;
Index: gpgme/gpgme/gpgme.c
diff -u gpgme/gpgme/gpgme.c:1.80 gpgme/gpgme/gpgme.c:1.81
--- gpgme/gpgme/gpgme.c:1.80 Wed Mar 9 17:03:04 2005
+++ gpgme/gpgme/gpgme.c Thu Apr 28 18:11:33 2005
@@ -222,12 +222,14 @@
/* Set the number of certifications to include in an S/MIME message.
- The default is 1 (only the cert of the sender). -1 means all
- certs, and -2 means all certs except the root cert. */
+ The default is GPGME_INCLUDE_CERTS_DEFAULT. -1 means all certs,
+ and -2 means all certs except the root cert. */
void
gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs)
{
- if (nr_of_certs < -2)
+ if (nr_of_certs == GPGME_INCLUDE_CERTS_DEFAULT)
+ ctx->include_certs = GPGME_INCLUDE_CERTS_DEFAULT;
+ else if (nr_of_certs < -2)
ctx->include_certs = -2;
else
ctx->include_certs = nr_of_certs;
Index: gpgme/gpgme/gpgme.h
diff -u gpgme/gpgme/gpgme.h:1.153 gpgme/gpgme/gpgme.h:1.154
--- gpgme/gpgme/gpgme.h:1.153 Wed Mar 9 17:03:04 2005
+++ gpgme/gpgme/gpgme.h Thu Apr 28 18:11:33 2005
@@ -706,6 +706,9 @@
/* Return non-zero if text mode is set in CTX. */
int gpgme_get_textmode (gpgme_ctx_t ctx);
+/* Use whatever the default of the backend crypto engine is. */
+#define GPGME_INCLUDE_CERTS_DEFAULT -256
+
/* Include up to NR_OF_CERTS certificates in an S/MIME message. */
void gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs);
More information about the Gnupg-commits
mailing list