summaryrefslogtreecommitdiff
path: root/gio/tests/tls-bindings.c
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/tls-bindings.c
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/tls-bindings.c')
-rw-r--r--gio/tests/tls-bindings.c97
1 files changed, 0 insertions, 97 deletions
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 ();
-}