[glib-networking/mcatanzaro/client-auth-request-fail: 6/6] tests: test_client_auth_request_fail() should expect G_FILE_ERROR_ACCES
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/client-auth-request-fail: 6/6] tests: test_client_auth_request_fail() should expect G_FILE_ERROR_ACCES
- Date: Fri, 17 May 2019 17:48:04 +0000 (UTC)
commit e71d09a4577def37019abcb6d87f99d286160bbf
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Fri May 17 11:21:36 2019 -0500
tests: test_client_auth_request_fail() should expect G_FILE_ERROR_ACCES
The FIXME is wrong. I misunderstood the purpose of this test when adding
the FIXME. The point of the test is to see what happens when the
GTlsInteraction's certificate request fails. Our mock request uses
G_FILE_ERROR_ACCES in this case, so that's the error we should expect.
We spent some time today on IRC trying to debug why we were getting
G_TLS_CERTIFICATE_ERROR instead for GnuTLS. Turns out, we're not. The
preprocessor guard is just misleading. OPENSSL_VERSION_NUMBER is not
defined when compiling for GnuTLS, so that turns into 0, and 0 <
0x10101000L, so we actually are building the first case here, not the
second. Whoops!
Fixes #87
tls/tests/connection.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 0679153..35b349b 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -1259,13 +1259,10 @@ test_client_auth_request_fail (TestConnection *test,
g_main_loop_run (test->loop);
wait_until_server_finished (test);
-#if OPENSSL_VERSION_NUMBER < 0x10101000L || defined (LIBRESSL_VERSION_NUMBER)
- /* FIXME: G_FILE_ERROR_ACCES is not a very great error to get here. */
+ /* G_FILE_ERROR_ACCES is the error returned by our mock interaction object
+ * when the GTlsInteraction's certificate request fails.
+ */
g_assert_error (test->read_error, G_FILE_ERROR, G_FILE_ERROR_ACCES);
-#else
- g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED);
-#endif
-
g_assert_error (test->server_error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED);
g_io_stream_close (test->server_connection, NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]