summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Noël <corentin.noel@collabora.com>2021-11-23 15:32:22 +0100
committerCorentin Noël <tintou@noel.tf>2022-04-09 00:10:38 +0200
commitc062daec42d7931f3437b64ee3f4b8dd4f76d8f0 (patch)
tree899efcc8837af26703325ca294e7e5f79562fc58
parentf6c18ca557f745515f73d184573195b8b2de0429 (diff)
downloadgcr-c062daec42d7931f3437b64ee3f4b8dd4f76d8f0.tar.gz
gck: Remove deprecated header
-rw-r--r--gck/gck-attributes.c331
-rw-r--r--gck/gck-deprecated.h130
-rw-r--r--gck/gck-misc.c7
-rw-r--r--gck/gck-module.c4
-rw-r--r--gck/gck-modules.c4
-rw-r--r--gck/gck-uri.c23
-rw-r--r--gck/gck.h2
-rw-r--r--gck/meson.build1
-rw-r--r--gck/test-gck-module.c4
-rw-r--r--gck/test-gck-modules.c4
-rw-r--r--gck/test-gck-slot.c2
-rw-r--r--gck/test-gck-uri.c2
-rw-r--r--gcr/gcr-key-mechanisms.c2
13 files changed, 11 insertions, 505 deletions
diff --git a/gck/gck-attributes.c b/gck/gck-attributes.c
index 33044a7..25e794d 100644
--- a/gck/gck-attributes.c
+++ b/gck/gck-attributes.c
@@ -2032,13 +2032,6 @@ gck_attribute_hash (gconstpointer attr)
G_DEFINE_BOXED_TYPE (GckAttributes, gck_attributes,
gck_attributes_ref, gck_attributes_unref)
-GType
-gck_attributes_get_boxed_type (void)
-{
- /* Deprecated version */
- return gck_attributes_get_type ();
-}
-
/**
* gck_attributes_new_empty:
* @first_type: the first empty attribute type
@@ -2828,327 +2821,3 @@ gck_attributes_new (gulong reserved)
GckBuilder builder = GCK_BUILDER_INIT;
return gck_builder_end (&builder);
}
-
-/**
- * gck_attributes_new_full: (skip)
- * @allocator: memory allocator for attribute data, or %NULL for default
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_all] instead.
- *
- * Returns: returns %NULL
- **/
-GckAttributes *
-gck_attributes_new_full (GckAllocator allocator)
-{
- g_warning ("gck_attributes_new_full() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add:
- * @attrs: the attributes array to add to
- * @attr: the attribute to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_all] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add (GckAttributes *attrs,
- GckAttribute *attr)
-{
- g_warning ("gck_attributes_add() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set:
- * @attrs: attributes array to add to
- * @attr: attribute to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_data] instead.
- **/
-void
-gck_attributes_set (GckAttributes *attrs,
- GckAttribute *attr)
-{
- g_warning ("gck_attributes_set() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_data:
- * @attrs: The attributes array to add to.
- * @attr_type: The type of attribute to add.
- * @value: (array length=length): the raw memory of the attribute value
- * @length: The length of the attribute value.
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_data] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_data (GckAttributes *attrs,
- gulong attr_type,
- const guchar *value,
- gsize length)
-{
- g_warning ("gck_attributes_add_data() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add_invalid:
- * @attrs: The attributes array to add to.
- * @attr_type: The type of attribute to add.
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_invalid] instead
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_invalid (GckAttributes *attrs,
- gulong attr_type)
-{
- g_warning ("gck_attributes_add_invalid() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add_empty:
- * @attrs: The attributes array to add.
- * @attr_type: The type of attribute to add.
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_empty] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_empty (GckAttributes *attrs,
- gulong attr_type)
-{
- g_warning ("gck_attributes_add_empty() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_add_boolean:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the boolean value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_boolean] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_boolean (GckAttributes *attrs,
- gulong attr_type,
- gboolean value)
-{
- g_warning ("gck_attributes_add_boolean() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_boolean:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: boolean value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_boolean] instead.
- */
-void
-gck_attributes_set_boolean (GckAttributes *attrs,
- gulong attr_type,
- gboolean value)
-{
- g_warning ("gck_attributes_set_boolean() is no no longer supported");
-
-}
-
-/**
- * gck_attributes_add_string:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the null terminated string value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_string] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_string (GckAttributes *attrs,
- gulong attr_type,
- const gchar *value)
-{
- g_warning ("gck_attributes_add_string() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_string:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: null terminated string value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_string] instead.
- */
-void
-gck_attributes_set_string (GckAttributes *attrs,
- gulong attr_type,
- const gchar *value)
-{
- g_warning ("gck_attributes_set_string() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_date:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the GDate value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_date] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_date (GckAttributes *attrs,
- gulong attr_type,
- const GDate *value)
-{
- g_warning ("gck_attributes_add_date() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_date:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: date value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_date] instead.
- */
-void
-gck_attributes_set_date (GckAttributes *attrs,
- gulong attr_type,
- const GDate *value)
-{
- g_warning ("gck_attributes_set_date() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_ulong:
- * @attrs: the attributes array to add to
- * @attr_type: the type of attribute to add
- * @value: the gulong value to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_ulong] instead.
- *
- * Returns: (transfer none): returns %NULL
- **/
-GckAttribute *
-gck_attributes_add_ulong (GckAttributes *attrs,
- gulong attr_type,
- gulong value)
-{
- g_warning ("gck_attributes_add_ulong() is no no longer supported");
- return NULL;
-}
-
-/**
- * gck_attributes_set_ulong:
- * @attrs: the attributes
- * @attr_type: the type of attribute to set
- * @value: gulong value to set
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_ulong] instead.
- */
-void
-gck_attributes_set_ulong (GckAttributes *attrs,
- gulong attr_type,
- gulong value)
-{
- g_warning ("gck_attributes_set_ulong() is no no longer supported");
-}
-
-/**
- * gck_attributes_add_all:
- * @attrs: a set of attributes
- * @from: attributes to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.add_all] instead.
- */
-void
-gck_attributes_add_all (GckAttributes *attrs,
- GckAttributes *from)
-{
- g_warning ("gck_attributes_add_all() is no no longer supported");
-}
-
-/**
- * gck_attributes_set_all:
- * @attrs: set of attributes
- * @from: attributes to add
- *
- * #GckAttributes are now immutable. This method no longer does anything.
- *
- * Deprecated: 3.4: Use [method@Builder.set_all] instead.
- */
-void
-gck_attributes_set_all (GckAttributes *attrs,
- GckAttributes *from)
-{
- g_warning ("gck_attributes_set_all() is no no longer supported");
-}
-
-/**
- * gck_attributes_dup:
- * @attrs: set of attributes to copy
- *
- * #GckAttributes are now immutable, and can be used in mulitple places.
- *
- * Deprecated: 3.4: Use gck_attributes_ref() or [method@Builder.add_all] instead.
- *
- * Returns: (transfer none): a new floating #GckAttributes
- */
-GckAttributes *
-gck_attributes_dup (GckAttributes *attrs)
-{
- GckBuilder builder = GCK_BUILDER_INIT;
-
- if (attrs == NULL)
- return NULL;
-
- gck_builder_add_all (&builder, attrs);
- return gck_builder_end (&builder);
-}
diff --git a/gck/gck-deprecated.h b/gck/gck-deprecated.h
deleted file mode 100644
index 029ab7e..0000000
--- a/gck/gck-deprecated.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* gck-deprecated.h - the GObject PKCS#11 wrapper library
-
- Copyright (C) 2011 Stefan Walter
-
- The Gnome Keyring Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Keyring Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- see <http://www.gnu.org/licenses/>.
-
- Author: Stef Walter <stefw@collabora.co.uk>
-*/
-
-#ifndef GCK_DEPRECATED_H
-#define GCK_DEPRECATED_H
-
-#include "gck.h"
-
-G_BEGIN_DECLS
-
-#ifndef GCK_DISABLE_DEPRECATED
-
-typedef GArray GckMechanisms;
-
-G_DEPRECATED_FOR(g_array_free)
-#define gck_mechanisms_free(a) (g_array_free (a, TRUE))
-
-#define CKR_GCK_MODULE_PROBLEM GCK_ERROR_MODULE_PROBLEM
-
-G_DEPRECATED_FOR(gck_error_get_quark)
-GQuark gck_get_error_quark (void);
-
-G_DEPRECATED_FOR(gck_uri_error_get_quark)
-GQuark gck_uri_get_error_quark (void);
-
-#define GCK_URI_BAD_PREFIX GCK_URI_BAD_SCHEME
-
-G_DEPRECATED_FOR(gck_attributes_get_type)
-GType gck_attributes_get_boxed_type (void) G_GNUC_CONST;
-
-G_DEPRECATED_FOR(gck_builder_set_all)
-GckAttributes * gck_attributes_new_full (GckAllocator allocator);
-
-G_DEPRECATED_FOR(gck_builder_set_all)
-GckAttribute * gck_attributes_add (GckAttributes *attrs,
- GckAttribute *attr);
-
-G_DEPRECATED_FOR(gck_builder_set_all)
-void gck_attributes_add_all (GckAttributes *attrs,
- GckAttributes *from);
-
-G_DEPRECATED_FOR(gck_builder_add_data)
-GckAttribute * gck_attributes_add_data (GckAttributes *attrs,
- gulong attr_type,
- const guchar *value,
- gsize length);
-
-G_DEPRECATED_FOR(gck_builder_add_invalid)
-GckAttribute * gck_attributes_add_invalid (GckAttributes *attrs,
- gulong attr_type);
-
-G_DEPRECATED_FOR(gck_builder_add_empty)
-GckAttribute * gck_attributes_add_empty (GckAttributes *attrs,
- gulong attr_type);
-
-G_DEPRECATED_FOR(gck_builder_add_boolean)
-GckAttribute* gck_attributes_add_boolean (GckAttributes *attrs,
- gulong attr_type,
- gboolean value);
-
-G_DEPRECATED_FOR(gck_builder_add_string)
-GckAttribute* gck_attributes_add_string (GckAttributes *attrs,
- gulong attr_type,
- const gchar *value);
-
-G_DEPRECATED_FOR(gck_builder_add_date)
-GckAttribute* gck_attributes_add_date (GckAttributes *attrs,
- gulong attr_type,
- const GDate *value);
-
-G_DEPRECATED_FOR(gck_builder_add_ulong)
-GckAttribute* gck_attributes_add_ulong (GckAttributes *attrs,
- gulong attr_type,
- gulong value);
-
-G_DEPRECATED_FOR(gck_builder_set_data)
-void gck_attributes_set (GckAttributes *attrs,
- GckAttribute *attr);
-
-G_DEPRECATED_FOR(gck_builder_set_boolean)
-void gck_attributes_set_boolean (GckAttributes *attrs,
- gulong attr_type,
- gboolean value);
-
-G_DEPRECATED_FOR(gck_builder_set_ulong)
-void gck_attributes_set_ulong (GckAttributes *attrs,
- gulong attr_type,
- gulong value);
-
-G_DEPRECATED_FOR(gck_builder_set_string)
-void gck_attributes_set_string (GckAttributes *attrs,
- gulong attr_type,
- const gchar *value);
-
-G_DEPRECATED_FOR(gck_builder_set_date)
-void gck_attributes_set_date (GckAttributes *attrs,
- gulong attr_type,
- const GDate *value);
-
-G_DEPRECATED_FOR(gck_builder_set_all)
-void gck_attributes_set_all (GckAttributes *attrs,
- GckAttributes *from);
-
-G_DEPRECATED_FOR(gck_attributes_ref or gck_builder_add_all)
-GckAttributes * gck_attributes_dup (GckAttributes *attrs);
-
-#endif /* GCK_DISABLE_DEPRECATED */
-
-G_END_DECLS
-
-#endif /* GCK_H */
diff --git a/gck/gck-misc.c b/gck/gck-misc.c
index e2fbbf8..2c864a1 100644
--- a/gck/gck-misc.c
+++ b/gck/gck-misc.c
@@ -103,13 +103,6 @@ EGG_SECURE_DEFINE_GLIB_GLOBALS ();
*/
GQuark
-gck_get_error_quark (void)
-{
- /* This is the deprecated version */
- return gck_error_get_quark ();
-}
-
-GQuark
gck_error_get_quark (void)
{
static GQuark domain = 0;
diff --git a/gck/gck-module.c b/gck/gck-module.c
index a50f78d..935bbeb 100644
--- a/gck/gck-module.c
+++ b/gck/gck-module.c
@@ -321,9 +321,9 @@ perform_initialize (Initialize *args)
funcs = p11_kit_module_load (args->path, P11_KIT_MODULE_CRITICAL);
if (funcs == NULL) {
- g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
_("Error loading PKCS#11 module: %s"), p11_kit_message ());
- return CKR_GCK_MODULE_PROBLEM;
+ return GCK_ERROR_MODULE_PROBLEM;
}
result = g_object_new (GCK_TYPE_MODULE,
diff --git a/gck/gck-modules.c b/gck/gck-modules.c
index 97d7f01..fb9b93e 100644
--- a/gck/gck-modules.c
+++ b/gck/gck-modules.c
@@ -56,9 +56,9 @@ perform_initialize_registered (InitializeRegistered *args)
modules = p11_kit_modules_load_and_initialize (0);
if (modules == NULL) {
- g_set_error (&args->error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM,
+ g_set_error (&args->error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM,
_("Couldn’t initialize registered PKCS#11 modules: %s"), p11_kit_message ());
- return CKR_GCK_MODULE_PROBLEM;
+ return GCK_ERROR_MODULE_PROBLEM;
}
for (funcs = modules; *funcs; ++funcs) {
diff --git a/gck/gck-uri.c b/gck/gck-uri.c
index ba92715..e0c3faf 100644
--- a/gck/gck-uri.c
+++ b/gck/gck-uri.c
@@ -96,22 +96,6 @@
* Error domain for URI errors.
*/
-/**
- * GCK_URI_BAD_PREFIX:
- *
- * Use %GCK_URI_BAD_SCHEME instead.
- *
- * Deprecated: Since 3.2
- */
-
-/**
- * CKR_GCK_MODULE_PROBLEM:
- *
- * Use %GCK_ERROR_MODULE_PROBLEM instead.
- *
- * Deprecated: Since 3.4
- */
-
#define URI_PREFIX "pkcs11:"
#define N_URI_PREFIX 7
@@ -123,13 +107,6 @@ struct _GckUri {
};
GQuark
-gck_uri_get_error_quark (void)
-{
- /* This is deprecated version */
- return gck_uri_error_get_quark ();
-}
-
-GQuark
gck_uri_error_get_quark (void)
{
static GQuark domain = 0;
diff --git a/gck/gck.h b/gck/gck.h
index bb52c01..1b60308 100644
--- a/gck/gck.h
+++ b/gck/gck.h
@@ -1595,8 +1595,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (GckUriData, gck_uri_data_free);
G_END_DECLS
-#include "gck-deprecated.h"
-
#undef __GCK_INSIDE_HEADER__
#endif /* GCK_H */
diff --git a/gck/meson.build b/gck/meson.build
index e461509..ab97d29 100644
--- a/gck/meson.build
+++ b/gck/meson.build
@@ -57,7 +57,6 @@ gck_sources = [
gck_exported_headers = [
gck_headers,
gck_version_h,
- 'gck-deprecated.h',
'pkcs11.h',
'pkcs11n.h',
'pkcs11x.h',
diff --git a/gck/test-gck-module.c b/gck/test-gck-module.c
index 91e7e4d..0cd8c1c 100644
--- a/gck/test-gck-module.c
+++ b/gck/test-gck-module.c
@@ -95,14 +95,14 @@ test_invalid_modules (Test *test, gconstpointer unused)
/* Shouldn't be able to load modules */
invalid = gck_module_initialize ("blah-blah-non-existant", NULL, &error);
- g_assert_error (error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM);
+ g_assert_error (error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM);
g_assert_null (invalid);
g_clear_error (&error);
/* Shouldn't be able to load any file successfully */
invalid = gck_module_initialize ("/usr/lib/libm.so", NULL, &error);
- g_assert_error (error, GCK_ERROR, (int)CKR_GCK_MODULE_PROBLEM);
+ g_assert_error (error, GCK_ERROR, (int)GCK_ERROR_MODULE_PROBLEM);
g_assert_null (invalid);
g_clear_error (&error);
diff --git a/gck/test-gck-modules.c b/gck/test-gck-modules.c
index 1468b9b..6ef994e 100644
--- a/gck/test-gck-modules.c
+++ b/gck/test-gck-modules.c
@@ -114,7 +114,7 @@ test_token_for_uri_error (Test *test, gconstpointer unused)
slot = gck_modules_token_for_uri (test->modules, "http://invalid.uri", &error);
g_assert_null (slot);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
g_error_free (error);
}
@@ -148,7 +148,7 @@ test_object_for_uri_error (Test *test, gconstpointer unused)
object = gck_modules_object_for_uri (test->modules, "http://invalid.uri", 0, &error);
g_assert_null (object);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
g_error_free (error);
}
diff --git a/gck/test-gck-slot.c b/gck/test-gck-slot.c
index c314233..4cfddbe 100644
--- a/gck/test-gck-slot.c
+++ b/gck/test-gck-slot.c
@@ -182,7 +182,7 @@ test_slot_mechanisms (Test *test, gconstpointer unused)
gck_mechanism_info_free (info);
}
- gck_mechanisms_free (mechs);
+ g_array_unref (mechs);
}
static void
diff --git a/gck/test-gck-uri.c b/gck/test-gck-uri.c
index bbfddda..57adee9 100644
--- a/gck/test-gck-uri.c
+++ b/gck/test-gck-uri.c
@@ -59,7 +59,7 @@ test_parse_bad_scheme (void)
uri_data = gck_uri_parse ("http:\\example.com\test", GCK_URI_FOR_ANY, &error);
g_assert_null (uri_data);
- g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_PREFIX);
+ g_assert_error (error, GCK_URI_ERROR, GCK_URI_BAD_SCHEME);
g_error_free (error);
}
diff --git a/gcr/gcr-key-mechanisms.c b/gcr/gcr-key-mechanisms.c
index 7d82908..89f968a 100644
--- a/gcr/gcr-key-mechanisms.c
+++ b/gcr/gcr-key-mechanisms.c
@@ -70,7 +70,7 @@ find_first_usable_mechanism (GckObject *key,
break;
}
- gck_mechanisms_free (mechs);
+ g_array_unref (mechs);
if (i < n_mechanisms)
return mechanisms[i];