diff options
-rw-r--r-- | NEWS | 19 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/gpgme.def | 4 | ||||
-rw-r--r-- | src/gpgme.h.in | 40 | ||||
-rw-r--r-- | src/libgpgme.vers | 4 | ||||
-rw-r--r-- | src/ops.h | 11 | ||||
-rw-r--r-- | src/trust-item.c | 101 | ||||
-rw-r--r-- | src/trustlist.c | 279 | ||||
-rw-r--r-- | src/wait-global.c | 4 | ||||
-rw-r--r-- | src/wait-private.c | 4 |
10 files changed, 19 insertions, 449 deletions
@@ -1,9 +1,14 @@ Noteworthy changes in version 2.0.0 (unreleased) ------------------------------------------------ - * Removed types and functions deprecated since 2003 or which had only - experimental use. + * Removed the gpgme_attr_t enums and their functions which were + deprecated since 2003. [rMd54d6eaa64] + * Removed the never implemented or announced GPGME_EXPORT_MODE_NOUID + flags. [rMd54d6eaa64] + + * Removed the entire trustlist feature which worked anyway only for a + short period in 2003. [T4834] * Interface changes relative to the 1.24 branch: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -17,7 +22,15 @@ Noteworthy changes in version 2.0.0 (unreleased) gpgme_trust_item_get_string_attr REMOVED. gpgme_trust_item_get_int_attr REMOVED. GPGME_EXPORT_MODE_NOUID REMOVED. - + GPGME_EVENT_NEXT_TRUSTITEM REMOVED. + gpgme_trust_item_t REMOVED. + GpgmeTrustItem REMOVED. + gpgme_op_trustlist_start REMOVED. + gpgme_op_trustlist_next REMOVED. + gpgme_op_trustlist_end REMOVED. + gpgme_trust_item_ref REMOVED. + gpgme_trust_item_unref REMOVED. + gpgme_trust_item_release REMOVED. Noteworthy changes in version 1.24.1 (2024-12-04) diff --git a/src/Makefile.am b/src/Makefile.am index 03708620..93de55b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -82,7 +82,7 @@ main_sources = \ op-support.c \ encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c \ sign.c passphrase.c progress.c \ - key.c keylist.c keysign.c trust-item.c trustlist.c tofupolicy.c \ + key.c keylist.c keysign.c tofupolicy.c \ revsig.c \ import.c export.c genkey.c delete.c edit.c getauditlog.c \ setexpire.c setownertrust.c \ diff --git a/src/gpgme.def b/src/gpgme.def index 7303fb86..a952daf1 100644 --- a/src/gpgme.def +++ b/src/gpgme.def @@ -77,9 +77,6 @@ EXPORTS gpgme_key_unref @51 gpgme_key_release @52 - gpgme_trust_item_ref @53 - gpgme_trust_item_unref @54 - gpgme_cancel @55 gpgme_op_card_edit @56 gpgme_op_card_edit_start @57 @@ -129,7 +126,6 @@ EXPORTS gpgme_get_sig_status @100 gpgme_get_sig_key @103 gpgme_op_import_ext @108 - gpgme_trust_item_release @111 gpgme_set_engine_info @112 diff --git a/src/gpgme.h.in b/src/gpgme.h.in index ab97fd79..52b15971 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -1,6 +1,6 @@ /* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*- * Copyright (C) 2000 Werner Koch (dd9jn) - * Copyright (C) 2001-2018 g10 Code GmbH + * Copyright (C) 2001-2025 g10 Code GmbH * * This file is part of GPGME. * @@ -1125,8 +1125,7 @@ typedef enum { GPGME_EVENT_START, GPGME_EVENT_DONE, - GPGME_EVENT_NEXT_KEY, - GPGME_EVENT_NEXT_TRUSTITEM /* NOT USED. */ + GPGME_EVENT_NEXT_KEY } gpgme_event_io_t; @@ -2137,37 +2136,6 @@ gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key, /* - * Trust items and operations. DO NOT USE. - * Note: This does not work because the experimental support in the - * GnuPG engine has been removed a very long time; for API and ABI - * compatibilty we keep the functions but let them return an error. - * See https://dev.gnupg.org/T4834 - */ -struct _gpgme_trust_item -{ - unsigned int _refs; - char *keyid; - char _keyid[16 + 1]; - int type; - int level; - char *owner_trust; - char _owner_trust[2]; - char *validity; - char _validity[2]; - char *name; -}; -typedef struct _gpgme_trust_item *gpgme_trust_item_t; -gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx, - const char *pattern, int max_level); -gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx, - gpgme_trust_item_t *r_item); -gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx); -void gpgme_trust_item_ref (gpgme_trust_item_t item); -void gpgme_trust_item_unref (gpgme_trust_item_t item); - - - -/* * Audit log */ @@ -2762,9 +2730,6 @@ gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh, gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, int *nr) _GPGME_DEPRECATED(0,4); -/* DO NOT USE. */ -void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED(0,4); - /* Compat. * This structure shall be considered read-only and an application @@ -2829,7 +2794,6 @@ typedef gpgme_verify_result_t GpgmeVerifyResult _GPGME_DEPRECATED(0,4); typedef gpgme_import_status_t GpgmeImportStatus _GPGME_DEPRECATED(0,4); typedef gpgme_import_result_t GpgmeImportResult _GPGME_DEPRECATED(0,4); typedef gpgme_genkey_result_t GpgmeGenKeyResult _GPGME_DEPRECATED(0,4); -typedef gpgme_trust_item_t GpgmeTrustItem _GPGME_DEPRECATED(0,4); typedef gpgme_status_code_t GpgmeStatusCode _GPGME_DEPRECATED(0,4); #ifdef __cplusplus diff --git a/src/libgpgme.vers b/src/libgpgme.vers index 9a34c680..e6091ec4 100644 --- a/src/libgpgme.vers +++ b/src/libgpgme.vers @@ -200,9 +200,6 @@ GPGME_1.0 { gpgme_key_unref; gpgme_key_release; - gpgme_trust_item_ref; - gpgme_trust_item_unref; - gpgme_cancel; gpgme_op_card_edit; gpgme_op_card_edit_start; @@ -260,7 +257,6 @@ GPGME_1.0 { gpgme_get_sig_status; gpgme_get_sig_key; gpgme_op_import_ext; - gpgme_trust_item_release; gpgme_err_code_from_syserror; gpgme_err_set_errno; @@ -156,17 +156,6 @@ void _gpgme_op_keylist_event_cb (void *data, gpgme_event_io_t type, void *type_data); -/* From trust-item.c. */ - -/* Create a new trust item. */ -gpgme_error_t _gpgme_trust_item_new (gpgme_trust_item_t *r_item); - - -/* From trustlist.c. */ -void _gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type, - void *type_data); - - /* From version.c. */ /* Return true if MY_VERSION is at least REQ_VERSION, and false diff --git a/src/trust-item.c b/src/trust-item.c deleted file mode 100644 index c9eea03c..00000000 --- a/src/trust-item.c +++ /dev/null @@ -1,101 +0,0 @@ -/* trust-item.c - Trust item objects. - * Copyright (C) 2000 Werner Koch (dd9jn) - * Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH - * - * This file is part of GPGME. - * - * GPGME is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * GPGME is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see <https://gnu.org/licenses/>. - * SPDX-License-Identifier: LGPL-2.1-or-later - */ - -#if HAVE_CONFIG_H -#include <config.h> -#endif -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <errno.h> - -#include "util.h" -#include "ops.h" -#include "sema.h" -#include "debug.h" - - -/* Protects all reference counters in trust items. All other accesses - to a trust item are either read only or happen before the trust - item is available to the user. */ -DEFINE_STATIC_LOCK (trust_item_ref_lock); - - -/* Create a new trust item. */ -gpgme_error_t -_gpgme_trust_item_new (gpgme_trust_item_t *r_item) -{ - gpgme_trust_item_t item; - - item = calloc (1, sizeof *item); - if (!item) - return gpg_error_from_syserror (); - item->_refs = 1; - item->keyid = item->_keyid; - item->_keyid[16] = '\0'; - item->owner_trust = item->_owner_trust; - item->_owner_trust[1] = '\0'; - item->validity = item->_validity; - item->_validity[1] = '\0'; - *r_item = item; - return 0; -} - - -/* Acquire a reference to ITEM. */ -void -gpgme_trust_item_ref (gpgme_trust_item_t item) -{ - LOCK (trust_item_ref_lock); - item->_refs++; - UNLOCK (trust_item_ref_lock); -} - - -/* gpgme_trust_item_unref releases the trust item object. Note that - this function may not do an actual release if there are other - shallow copies of the object. You have to call this function for - every newly created trust item object as well as for every - gpgme_trust_item_ref() done on the trust item object. */ -void -gpgme_trust_item_unref (gpgme_trust_item_t item) -{ - LOCK (trust_item_ref_lock); - assert (item->_refs > 0); - if (--item->_refs) - { - UNLOCK (trust_item_ref_lock); - return; - } - UNLOCK (trust_item_ref_lock); - - if (item->name) - free (item->name); - free (item); -} - - -/* Compatibility interfaces. */ -void -gpgme_trust_item_release (gpgme_trust_item_t item) -{ - gpgme_trust_item_unref (item); -} diff --git a/src/trustlist.c b/src/trustlist.c deleted file mode 100644 index e31c2456..00000000 --- a/src/trustlist.c +++ /dev/null @@ -1,279 +0,0 @@ -/* trustlist.c - Trust item listing. - * Copyright (C) 2000 Werner Koch (dd9jn) - * Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH - * - * This file is part of GPGME. - * - * GPGME is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * GPGME is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see <https://gnu.org/licenses/>. - * SPDX-License-Identifier: LGPL-2.1-or-later - */ - -#if HAVE_CONFIG_H -#include <config.h> -#endif -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <errno.h> - -#include "gpgme.h" -#include "debug.h" -#include "util.h" -#include "context.h" -#include "ops.h" - - -struct trust_queue_item_s -{ - struct trust_queue_item_s *next; - gpgme_trust_item_t item; -}; - -typedef struct -{ - /* Something new is available. */ - int trust_cond; - struct trust_queue_item_s *trust_queue; -} *op_data_t; - - - -static gpgme_error_t -trustlist_status_handler (void *priv, gpgme_status_code_t code, char *args) -{ - (void)priv; - (void)code; - (void)args; - return 0; -} - - -/* This handler is used to parse the output of --list-trust-path: - Format: - level:keyid:type:recno:ot:val:mc:cc:name: - With TYPE = U for a user ID - K for a key - The RECNO is either the one of the dir record or the one of the uid - record. OT is the usual trust letter and only available on K - lines. VAL is the calculated validity MC is the marginal trust - counter and only available on U lines CC is the same for the - complete count NAME ist the username and only printed on U - lines. */ -static gpgme_error_t -trustlist_colon_handler (void *priv, char *line) -{ - gpgme_ctx_t ctx = (gpgme_ctx_t) priv; - gpgme_error_t err; - char *p, *pend; - int field = 0; - gpgme_trust_item_t item = NULL; - - if (!line) - return 0; /* EOF */ - - for (p = line; p; p = pend) - { - field++; - pend = strchr (p, ':'); - if (pend) - *pend++ = 0; - - switch (field) - { - case 1: /* level */ - err = _gpgme_trust_item_new (&item); - if (err) - return err; - item->level = atoi (p); - break; - case 2: /* long keyid */ - if (strlen (p) == DIM(item->keyid) - 1) - strcpy (item->keyid, p); - break; - case 3: /* type */ - item->type = *p == 'K'? 1 : *p == 'U'? 2 : 0; - break; - case 5: /* owner trust */ - item->_owner_trust[0] = *p; - break; - case 6: /* validity */ - item->_validity[0] = *p; - break; - case 9: /* user ID */ - item->name = strdup (p); - if (!item->name) - { - int saved_err = gpg_error_from_syserror (); - gpgme_trust_item_unref (item); - return saved_err; - } - break; - } - } - - if (item) - _gpgme_engine_io_event (ctx->engine, GPGME_EVENT_NEXT_TRUSTITEM, item); - return 0; -} - - -void -_gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type, - void *type_data) -{ - gpgme_ctx_t ctx = (gpgme_ctx_t) data; - gpgme_error_t err; - void *hook; - op_data_t opd; - gpgme_trust_item_t item = (gpgme_trust_item_t) type_data; - struct trust_queue_item_s *q, *q2; - - assert (type == GPGME_EVENT_NEXT_TRUSTITEM); - - err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, -1, NULL); - opd = hook; - if (err) - return; - - q = malloc (sizeof *q); - if (!q) - { - gpgme_trust_item_unref (item); - /* FIXME: GPGME_Out_Of_Core; */ - return; - } - q->item = item; - q->next = NULL; - /* FIXME: Use a tail pointer */ - q2 = opd->trust_queue; - if (!q2) - opd->trust_queue = q; - else - { - while (q2->next) - q2 = q2->next; - q2->next = q; - } - /* FIXME: unlock queue */ - opd->trust_cond = 1; -} - - -gpgme_error_t -gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level) -{ - gpgme_error_t err = 0; - void *hook; - op_data_t opd; - - TRACE_BEG (DEBUG_CTX, "gpgme_op_trustlist_start", ctx, - "pattern=%s, max_level=%i", pattern, max_level); - - if (!ctx || !pattern || !*pattern) - return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - - err = _gpgme_op_reset (ctx, 2); - if (err) - return TRACE_ERR (err); - - err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, - sizeof (*opd), NULL); - opd = hook; - if (err) - return TRACE_ERR (err); - - _gpgme_engine_set_status_handler (ctx->engine, - trustlist_status_handler, ctx); - err = _gpgme_engine_set_colon_line_handler (ctx->engine, - trustlist_colon_handler, ctx); - if (err) - return TRACE_ERR (err); - - err = _gpgme_engine_op_trustlist (ctx->engine, pattern); - return TRACE_ERR (err); -} - - -gpgme_error_t -gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item) -{ - gpgme_error_t err; - void *hook; - op_data_t opd; - struct trust_queue_item_s *q; - - TRACE_BEG (DEBUG_CTX, "gpgme_op_trustlist_next", ctx, ""); - - if (!ctx || !r_item) - return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - *r_item = NULL; - if (!ctx) - return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - - err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, -1, NULL); - opd = hook; - if (err) - return TRACE_ERR (err); - if (opd == NULL) - return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - - if (!opd->trust_queue) - { - err = _gpgme_wait_on_condition (ctx, &opd->trust_cond, NULL); - if (err) - return TRACE_ERR (err); - if (!opd->trust_cond) - return TRACE_ERR (gpg_error (GPG_ERR_EOF)); - opd->trust_cond = 0; - assert (opd->trust_queue); - } - q = opd->trust_queue; - opd->trust_queue = q->next; - - *r_item = q->item; - free (q); - if ((*r_item)->type == 1) - { - TRACE_SUC ("trust_item=%p: %s: owner trust %s with level %i " - "and validity %s", *r_item, (*r_item)->keyid, - (*r_item)->owner_trust, (*r_item)->level, - (*r_item)->validity); - } - else if ((*r_item)->type == 2) - { - TRACE_SUC ("trust_item=%p: %s: UID %s with level %i " - "and validity %s", *r_item, (*r_item)->keyid, - (*r_item)->name, (*r_item)->level, (*r_item)->validity); - } - else - { - TRACE_SUC ("trust_item=%p: %s: unknown type %i with level %i " - "and validity %s", *r_item, (*r_item)->keyid, - (*r_item)->type, (*r_item)->level, (*r_item)->validity); - } - return 0; -} - - -/* Terminate a pending trustlist operation within CTX. */ -gpgme_error_t -gpgme_op_trustlist_end (gpgme_ctx_t ctx) -{ - TRACE (DEBUG_CTX, "gpgme_op_trustlist_end", ctx, ""); - - if (!ctx) - return gpg_error (GPG_ERR_INV_VALUE); - - return 0; -} diff --git a/src/wait-global.c b/src/wait-global.c index e88962e0..d72dbb2b 100644 --- a/src/wait-global.c +++ b/src/wait-global.c @@ -225,10 +225,6 @@ _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type, assert (!"Unexpected event GPGME_EVENT_NEXT_KEY"); break; - case GPGME_EVENT_NEXT_TRUSTITEM: - assert (!"Unexpected event GPGME_EVENT_NEXT_TRUSTITEM"); - break; - default: assert (!"Unexpected event"); break; diff --git a/src/wait-private.c b/src/wait-private.c index 417cb2b3..703ee557 100644 --- a/src/wait-private.c +++ b/src/wait-private.c @@ -61,10 +61,6 @@ _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type, case GPGME_EVENT_NEXT_KEY: _gpgme_op_keylist_event_cb (data, type, type_data); break; - - case GPGME_EVENT_NEXT_TRUSTITEM: - _gpgme_op_trustlist_event_cb (data, type, type_data); - break; } } |