summaryrefslogtreecommitdiff
path: root/gio/tests
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-09-01 13:14:14 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-09-01 13:14:14 -0500
commit6d1cb13c4f30b69fb55f546283545383a6b3f4a8 (patch)
tree78d345452a435af120fd687d7cccc783040476ae /gio/tests
parentb660ffe161776db1bddee3c7212b1bd27cdd658c (diff)
downloadglib-revert-channel-bindings.tar.gz
Revert "Add g_(d)tls_connection_get_channel_binding_data calls and enums"revert-channel-bindings
This reverts commit 44524b9daa622058e3e55617b9b0d4c986e3b8b3. We were not able to implement this API in glib-networking because it wasn't released until glib 2.65.1, one day before freeze. We eventually landed the implementation via the feature freeze break process, but failed to notice that it introduced new strings. It's much too late to be adding new translatable strings, so implementation will have to wait until next release cycle, after the first glib 2.67 release. https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/124
Diffstat (limited to 'gio/tests')
-rw-r--r--gio/tests/gtesttlsbackend.c6
-rw-r--r--gio/tests/meson.build1
-rw-r--r--gio/tests/tls-bindings.c97
3 files changed, 0 insertions, 104 deletions
diff --git a/gio/tests/gtesttlsbackend.c b/gio/tests/gtesttlsbackend.c
index 346a20dd9..157a4a3f3 100644
--- a/gio/tests/gtesttlsbackend.c
+++ b/gio/tests/gtesttlsbackend.c
@@ -59,8 +59,6 @@ g_test_tls_backend_iface_init (GTlsBackendInterface *iface)
iface->get_certificate_type = _g_test_tls_certificate_get_type;
iface->get_client_connection_type = _g_test_tls_connection_get_type;
iface->get_server_connection_type = _g_test_tls_connection_get_type;
- iface->get_dtls_client_connection_type = _g_test_tls_connection_get_type;
- iface->get_dtls_server_connection_type = _g_test_tls_connection_get_type;
iface->get_default_database = _g_test_tls_backend_get_default_database;
iface->get_file_database_type = _g_test_tls_database_get_type;
}
@@ -247,7 +245,6 @@ struct _GTestTlsConnectionClass {
enum
{
PROP_CONN_BASE_IO_STREAM = 1,
- PROP_CONN_BASE_SOCKET,
PROP_CONN_USE_SYSTEM_CERTDB,
PROP_CONN_REQUIRE_CLOSE_NOTIFY,
PROP_CONN_REHANDSHAKE_MODE,
@@ -267,8 +264,6 @@ static void g_test_tls_connection_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GTestTlsConnection, g_test_tls_connection, G_TYPE_TLS_CONNECTION,
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION, NULL)
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION, NULL)
- G_IMPLEMENT_INTERFACE (G_TYPE_DATAGRAM_BASED, NULL)
- G_IMPLEMENT_INTERFACE (G_TYPE_DTLS_CONNECTION, NULL)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
g_test_tls_connection_initable_iface_init))
@@ -313,7 +308,6 @@ g_test_tls_connection_class_init (GTestTlsConnectionClass *connection_class)
io_stream_class->close_fn = g_test_tls_connection_close;
g_object_class_override_property (gobject_class, PROP_CONN_BASE_IO_STREAM, "base-io-stream");
- g_object_class_override_property (gobject_class, PROP_CONN_BASE_SOCKET, "base-socket");
g_object_class_override_property (gobject_class, PROP_CONN_USE_SYSTEM_CERTDB, "use-system-certdb");
g_object_class_override_property (gobject_class, PROP_CONN_REQUIRE_CLOSE_NOTIFY, "require-close-notify");
g_object_class_override_property (gobject_class, PROP_CONN_REHANDSHAKE_MODE, "rehandshake-mode");
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index d8ebd56ac..c7c3e3035 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -78,7 +78,6 @@ gio_tests = {
'tls-certificate' : {'extra_sources' : ['gtesttlsbackend.c']},
'tls-interaction' : {'extra_sources' : ['gtesttlsbackend.c']},
'tls-database' : {'extra_sources' : ['gtesttlsbackend.c']},
- 'tls-bindings' : {'extra_sources' : ['gtesttlsbackend.c']},
'gdbus-address-get-session' : {},
'win32-appinfo' : {},
}
diff --git a/gio/tests/tls-bindings.c b/gio/tests/tls-bindings.c
deleted file mode 100644
index 89890248a..000000000
--- a/gio/tests/tls-bindings.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2020 (C) Ruslan N. Marchenko <me@ruff.mobi>
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- */
-
-#include "config.h"
-
-#include <gio/gio.h>
-
-#include "gtesttlsbackend.h"
-
-static void
-get_tls_channel_binding (void)
-{
- GTlsBackend *backend;
- gchar *not_null = "NOT_NULL";
- GTlsConnection *tls = NULL;
- GError *error = NULL;
-
- backend = g_tls_backend_get_default ();
- g_assert_nonnull (backend);
-
- /* check unimplemented GTlsConnection API sanity */
- tls = G_TLS_CONNECTION (g_object_new (
- g_tls_backend_get_client_connection_type (backend), NULL));
- g_assert_nonnull (tls);
-
- g_assert_false (g_tls_connection_get_channel_binding_data (tls,
- G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, NULL));
-
- g_assert_false (g_tls_connection_get_channel_binding_data (tls,
- G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, &error));
- g_assert_error (error, G_TLS_CHANNEL_BINDING_ERROR,
- G_TLS_CHANNEL_BINDING_ERROR_NOT_IMPLEMENTED);
- g_clear_error (&error);
-
- if (g_test_subprocess ())
- g_assert_false (g_tls_connection_get_channel_binding_data (tls,
- G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, (GError **)&not_null));
-
- g_object_unref (tls);
- g_object_unref (backend);
- g_test_trap_subprocess (NULL, 0, 0);
- g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*GLib-GIO-CRITICAL*");
-}
-
-static void
-get_dtls_channel_binding (void)
-{
- GTlsBackend *backend;
- gchar *not_null = "NOT_NULL";
- GDtlsConnection *dtls = NULL;
- GError *error = NULL;
-
- backend = g_tls_backend_get_default ();
- g_assert_nonnull (backend);
-
- /* repeat for the dtls now */
- dtls = G_DTLS_CONNECTION (g_object_new (
- g_tls_backend_get_dtls_client_connection_type (backend), NULL));
- g_assert_nonnull (dtls);
-
- g_assert_false (g_dtls_connection_get_channel_binding_data (dtls,
- G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, NULL));
-
- g_assert_false (g_dtls_connection_get_channel_binding_data (dtls,
- G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, &error));
- g_assert_error (error, G_TLS_CHANNEL_BINDING_ERROR,
- G_TLS_CHANNEL_BINDING_ERROR_NOT_IMPLEMENTED);
- g_clear_error (&error);
-
- if (g_test_subprocess ())
- g_assert_false (g_dtls_connection_get_channel_binding_data (dtls,
- G_TLS_CHANNEL_BINDING_TLS_UNIQUE, NULL, (GError **)&not_null));
-
- g_object_unref (dtls);
- g_object_unref (backend);
- g_test_trap_subprocess (NULL, 0, 0);
- g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*GLib-GIO-CRITICAL*");
-}
-
-int
-main (int argc,
- char *argv[])
-{
- g_test_init (&argc, &argv, NULL);
-
- _g_test_tls_backend_get_type ();
-
- g_test_add_func ("/tls-connection/get-tls-channel-binding", get_tls_channel_binding);
- g_test_add_func ("/tls-connection/get-dtls-channel-binding", get_dtls_channel_binding);
-
- return g_test_run ();
-}