From 858909168298e8c6fb6f9f9009be2ee2d0d9f0ec Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 15 Jul 2020 16:34:24 +0200 Subject: core: Deprecate the non-working trustlist functions. * src/gpgme.h.in: Clarify that the trustlist function should not be used. * src/engine.c (_gpgme_engine_op_trustlist): Always return an error. * src/engine-backend.h (struct engine_ops): Remove trustlist member. * src/engine-gpg.c (gpg_trustlist): Remove. (struct engine_ops): Remove that member. Also in all other engines. * tests/gpg/t-trustlist.c: Remove. * lang/python/tests/t-trustlist.py: Remove. -- This never worked in reality because the required feature has been removed from GnuPG version 1.3.2 soon after introduction of this feature in gpgme - 17 years ago. It was anyway marked as experimental. We keep the API and ABI, though. GnuPG-bug-id: 4834 Signed-off-by: Werner Koch --- src/gpgme.h.in | 57 ++++++++++----------------------------------------------- 1 file changed, 10 insertions(+), 47 deletions(-) (limited to 'src/gpgme.h.in') diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 4efa325d..2decc551 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -313,7 +313,7 @@ typedef enum gpgme_sig_mode_t; -/* The available validities for a trust item or key. */ +/* The available validities for a key. */ typedef enum { GPGME_VALIDITY_UNKNOWN = 0, @@ -1054,7 +1054,7 @@ typedef enum GPGME_EVENT_START, GPGME_EVENT_DONE, GPGME_EVENT_NEXT_KEY, - GPGME_EVENT_NEXT_TRUSTITEM + GPGME_EVENT_NEXT_TRUSTITEM /* NOT USED. */ } gpgme_event_io_t; @@ -2002,63 +2002,32 @@ gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key, /* - * Trust items and operations. + * 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 */ - -/* An object to hold data of a trust item. - * This structure shall be considered read-only and an application - * must not allocate such a structure on its own. */ struct _gpgme_trust_item { - /* Internal to GPGME, do not use. */ unsigned int _refs; - - /* The key ID to which the trust item belongs. */ char *keyid; - - /* Internal to GPGME, do not use. */ char _keyid[16 + 1]; - - /* The type of the trust item, 1 refers to a key, 2 to a user ID. */ int type; - - /* The trust level. */ int level; - - /* The owner trust if TYPE is 1. */ char *owner_trust; - - /* Internal to GPGME, do not use. */ char _owner_trust[2]; - - /* The calculated validity. */ char *validity; - - /* Internal to GPGME, do not use. */ char _validity[2]; - - /* The user name if TYPE is 2. */ char *name; }; typedef struct _gpgme_trust_item *gpgme_trust_item_t; - -/* Start a trustlist operation within CTX, searching for trust items - which match PATTERN. */ gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level); - -/* Return the next trust item from the trustlist in R_ITEM. */ gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item); - -/* Terminate a pending trustlist operation within CTX. */ gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx); - -/* Acquire a reference to ITEM. */ void gpgme_trust_item_ref (gpgme_trust_item_t item); - -/* Release a reference to ITEM. If this was the last one the trust - * item is destroyed. */ void gpgme_trust_item_unref (gpgme_trust_item_t item); @@ -2740,22 +2709,16 @@ unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx, gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, int *nr) _GPGME_DEPRECATED(0,4); -/* Release the trust item ITEM. Deprecated, use - * gpgme_trust_item_unref. */ +/* DO NOT USE. */ void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED(0,4); -/* Return the value of the attribute WHAT of ITEM, which has to be - * representable by a string. Deprecated, use trust item structure - * directly. */ +/* DO NOT USE. */ const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item, _gpgme_attr_t what, const void *reserved, int idx) _GPGME_DEPRECATED(0,4); -/* Return the value of the attribute WHAT of KEY, which has to be - * representable by an integer. IDX specifies a running index if the - * attribute appears more than once in the key. Deprecated, use trust - * item structure directly. */ +/* DO NOT USE. */ int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what, const void *reserved, int idx) _GPGME_DEPRECATED(0,4); -- cgit v1.2.3