[glib-networking/verify-paths] tests: try to fix test case with openssl > 1.1.0



commit e0c3418051bd47b268cf82afd647ff7be0357ee4
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Thu Apr 25 16:32:10 2019 +0200

    tests: try to fix test case with openssl > 1.1.0

 tls/openssl/meson.build | 2 ++
 tls/tests/connection.c  | 6 ++++++
 tls/tests/meson.build   | 4 ++++
 3 files changed, 12 insertions(+)
---
diff --git a/tls/openssl/meson.build b/tls/openssl/meson.build
index 529b44b..89b8d37 100644
--- a/tls/openssl/meson.build
+++ b/tls/openssl/meson.build
@@ -13,6 +13,8 @@ sources = files(
 
 incs = [top_inc]
 
+openssl_inc = include_directories('.')
+
 deps = [
   gio_dep,
   glib_dep,
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 310574f..146f1ff 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -35,6 +35,8 @@
 
 #ifdef BACKEND_IS_GNUTLS
 #include <gnutls/gnutls.h>
+#else
+#include "openssl-include.h"
 #endif
 
 static const gchar *
@@ -1336,7 +1338,11 @@ test_client_auth_request_fail (TestConnection *test,
 
   /* FIXME: G_FILE_ERROR_ACCES is not a very great error to get here. */
   if (client_can_receive_certificate_required_errors (test))
+#if OPENSSL_VERSION_NUMBER < 0x10101000L || defined (LIBRESSL_VERSION_NUMBER)
     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
   else if (!g_error_matches (test->read_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE))
     g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_MISC);
 
diff --git a/tls/tests/meson.build b/tls/tests/meson.build
index 1dfe529..2f197b5 100644
--- a/tls/tests/meson.build
+++ b/tls/tests/meson.build
@@ -52,6 +52,10 @@ foreach backend: backends
         '-DBACKEND_IS_' + backend.to_upper(),
       ]
 
+      if backend == 'openssl'
+        incs += openssl_inc
+      endif
+
       exe = executable(
         program_name,
         [program[0] + '.c'] + program[1],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]