[glib-networking/verify-paths: 2/3] test: ifdef for differences between openssl and gnutls
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/verify-paths: 2/3] test: ifdef for differences between openssl and gnutls
- Date: Fri, 26 Apr 2019 07:32:56 +0000 (UTC)
commit e2c231791bbd906d48896728bf048b75f56fe327
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Thu Apr 25 12:17:07 2019 +0200
test: ifdef for differences between openssl and gnutls
Ideally they should behave the same but we still need to fix openssl
to make the certificate at the right handshake time
tls/tests/connection.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 9f430d2..310574f 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -930,12 +930,18 @@ test_invalid_chain_with_alternative_ca_cert (TestConnection *test,
g_tls_client_connection_set_validation_flags (G_TLS_CLIENT_CONNECTION (test->client_connection),
G_TLS_CERTIFICATE_VALIDATE_ALL & ~G_TLS_CERTIFICATE_EXPIRED);
+#ifdef BACKEND_IS_GNUTLS
g_set_error_literal (&test->expected_server_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS, "");
+#endif
read_test_data_async (test);
g_main_loop_run (test->loop);
g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE);
+
+#ifdef BACKEND_IS_OPENSSL
+ g_assert_no_error (test->server_error);
+#endif
}
static void
@@ -1401,7 +1407,9 @@ test_failed_connection (TestConnection *test,
g_assert_no_error (error);
g_object_unref (connection);
+#ifdef BACKEND_IS_GNUTLS
g_set_error_literal (&test->expected_server_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS, "");
+#endif
g_tls_connection_handshake_async (G_TLS_CONNECTION (test->client_connection),
G_PRIORITY_DEFAULT, NULL,
@@ -1415,6 +1423,10 @@ test_failed_connection (TestConnection *test,
g_main_loop_run (test->loop);
g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE);
+
+#ifdef BACKEND_IS_OPENSSL
+ g_assert_no_error (test->server_error);
+#endif
}
static void
@@ -1497,7 +1509,9 @@ test_connection_socket_client_failed (TestConnection *test,
g_socket_client_set_tls (client, TRUE);
/* this time we don't adjust the validation flags */
+#ifdef BACKEND_IS_GNUTLS
g_set_error_literal (&test->expected_server_error, G_TLS_ERROR, G_TLS_ERROR_NOT_TLS, "");
+#endif
g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (test->address),
NULL, socket_client_failed, test);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]