aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-07-15 14:34:24 +0000
committerWerner Koch <[email protected]>2020-07-15 14:34:24 +0000
commit858909168298e8c6fb6f9f9009be2ee2d0d9f0ec (patch)
tree34ab9d02908c4255a87d6b46b128b71ec57c60c8 /src
parentcore: New keylist mode GPGME_KEYLIST_MODE_WITH_KEYGRIP. (diff)
downloadgpgme-858909168298e8c6fb6f9f9009be2ee2d0d9f0ec.tar.gz
gpgme-858909168298e8c6fb6f9f9009be2ee2d0d9f0ec.zip
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/engine-assuan.c1
-rw-r--r--src/engine-backend.h1
-rw-r--r--src/engine-g13.c1
-rw-r--r--src/engine-gpg.c24
-rw-r--r--src/engine-gpgconf.c1
-rw-r--r--src/engine-gpgsm.c1
-rw-r--r--src/engine-spawn.c1
-rw-r--r--src/engine-uiserver.c1
-rw-r--r--src/engine.c7
-rw-r--r--src/gpgme.h.in57
10 files changed, 13 insertions, 82 deletions
diff --git a/src/engine-assuan.c b/src/engine-assuan.c
index 497397db..a40328f7 100644
--- a/src/engine-assuan.c
+++ b/src/engine-assuan.c
@@ -826,7 +826,6 @@ struct engine_ops _gpgme_engine_ops_assuan =
NULL, /* keysign */
NULL, /* tofu_policy */
NULL, /* sign */
- NULL, /* trustlist */
NULL, /* verify */
NULL, /* getauditlog */
llass_transact, /* opassuan_transact */
diff --git a/src/engine-backend.h b/src/engine-backend.h
index 4f33da1c..c8bfad96 100644
--- a/src/engine-backend.h
+++ b/src/engine-backend.h
@@ -115,7 +115,6 @@ struct engine_ops
gpgme_sig_mode_t mode, int use_armor,
int use_textmode, int include_certs,
gpgme_ctx_t ctx /* FIXME */);
- gpgme_error_t (*trustlist) (void *engine, const char *pattern);
gpgme_error_t (*verify) (void *engine, gpgme_data_t sig,
gpgme_data_t signed_text, gpgme_data_t plaintext,
gpgme_ctx_t ctx);
diff --git a/src/engine-g13.c b/src/engine-g13.c
index 19dd8f47..45f6c94b 100644
--- a/src/engine-g13.c
+++ b/src/engine-g13.c
@@ -806,7 +806,6 @@ struct engine_ops _gpgme_engine_ops_g13 =
NULL, /* keysign */
NULL, /* tofu_policy */
NULL, /* sign */
- NULL, /* trustlist */
NULL, /* verify */
NULL, /* getauditlog */
g13_transact,
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index c343e80e..9362e297 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -3303,29 +3303,6 @@ gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
}
static gpgme_error_t
-gpg_trustlist (void *engine, const char *pattern)
-{
- engine_gpg_t gpg = engine;
- gpgme_error_t err;
-
- err = add_arg (gpg, "--with-colons");
- if (!err)
- err = add_arg (gpg, "--list-trust-path");
-
- /* Tell the gpg object about the data. */
- if (!err)
- err = add_arg (gpg, "--");
- if (!err)
- err = add_arg (gpg, pattern);
-
- if (!err)
- err = start (gpg);
-
- return err;
-}
-
-
-static gpgme_error_t
gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
gpgme_data_t plaintext, gpgme_ctx_t ctx)
{
@@ -3475,7 +3452,6 @@ struct engine_ops _gpgme_engine_ops_gpg =
gpg_keysign,
gpg_tofu_policy, /* tofu_policy */
gpg_sign,
- gpg_trustlist,
gpg_verify,
gpg_getauditlog,
NULL, /* opassuan_transact */
diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index 303ba640..d4465e97 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -1304,7 +1304,6 @@ struct engine_ops _gpgme_engine_ops_gpgconf =
NULL, /* keysign */
NULL, /* tofu_policy */
NULL, /* sign */
- NULL, /* trustlist */
NULL, /* verify */
NULL, /* getauditlog */
NULL, /* opassuan_transact */
diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c
index ae5d8ef1..671b3857 100644
--- a/src/engine-gpgsm.c
+++ b/src/engine-gpgsm.c
@@ -2324,7 +2324,6 @@ struct engine_ops _gpgme_engine_ops_gpgsm =
NULL, /* keysign */
NULL, /* tofu_policy */
gpgsm_sign,
- NULL, /* trustlist */
gpgsm_verify,
gpgsm_getauditlog,
NULL, /* opassuan_transact */
diff --git a/src/engine-spawn.c b/src/engine-spawn.c
index 296d7f25..0eeaeb1f 100644
--- a/src/engine-spawn.c
+++ b/src/engine-spawn.c
@@ -466,7 +466,6 @@ struct engine_ops _gpgme_engine_ops_spawn =
NULL, /* keysign */
NULL, /* tofu_policy */
NULL, /* sign */
- NULL, /* trustlist */
NULL, /* verify */
NULL, /* getauditlog */
NULL, /* opassuan_transact */
diff --git a/src/engine-uiserver.c b/src/engine-uiserver.c
index cb8e155d..c908ad7f 100644
--- a/src/engine-uiserver.c
+++ b/src/engine-uiserver.c
@@ -1437,7 +1437,6 @@ struct engine_ops _gpgme_engine_ops_uiserver =
NULL, /* keysign */
NULL, /* tofu_policy */
uiserver_sign,
- NULL, /* trustlist */
uiserver_verify,
NULL, /* getauditlog */
NULL, /* opassuan_transact */
diff --git a/src/engine.c b/src/engine.c
index 05979c15..ded2f4d1 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -917,13 +917,12 @@ _gpgme_engine_op_sign (engine_t engine, gpgme_data_t in, gpgme_data_t out,
gpgme_error_t
_gpgme_engine_op_trustlist (engine_t engine, const char *pattern)
{
+ (void)pattern;
+
if (!engine)
return gpg_error (GPG_ERR_INV_VALUE);
- if (!engine->ops->trustlist)
- return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
-
- return (*engine->ops->trustlist) (engine->engine, pattern);
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
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);