summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2023-12-18 22:47:20 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-20 07:47:00 +0000
commita5fc5b14a19c8d2e13f4afba06eb260ee3b1b67c (patch)
tree0212c0fb73ca0fe774be2256729bda0e33f74d22
parent6a47da632e451e9a4272877759e68b282386c4f4 (diff)
downloadpoky-a5fc5b14a19c8d2e13f4afba06eb260ee3b1b67c.tar.gz
glib-networking: upgrade 2.76.1 -> 2.78.0
(From OE-Core rev: 9f792d1f60c2ba582bc7eceb76923495dbfaa658) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-disable-PKCS-11-tests-if-not-available.patch113
-rw-r--r--meta/recipes-core/glib-networking/glib-networking/eagain.patch20
-rw-r--r--meta/recipes-core/glib-networking/glib-networking_2.78.0.bb (renamed from meta/recipes-core/glib-networking/glib-networking_2.76.1.bb)3
3 files changed, 15 insertions, 121 deletions
diff --git a/meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-disable-PKCS-11-tests-if-not-available.patch b/meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-disable-PKCS-11-tests-if-not-available.patch
deleted file mode 100644
index 7b003588c8..0000000000
--- a/meta/recipes-core/glib-networking/glib-networking/0001-tls-tests-disable-PKCS-11-tests-if-not-available.patch
+++ /dev/null
@@ -1,113 +0,0 @@
1From 04728a5b73e870b4695c5e7ba42fa41c00471944 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Fri, 12 May 2023 20:19:35 +0100
4Subject: [PATCH] tls/tests: disable PKCS#11 tests if not available
5
6GnuTLS can be built without PKCS#11, which means the symbols
7gnutls_pkcs11_init and gnutls_pkcs11_add_provider are not part of the
8library.
9
10If these symbols don't exist in GnuTLS then we can't add a mock pkcs#11
11provider for testing, and several tests which need the mock provider
12will fail.
13
14Solve this by checking for the symbols at build time and disabling the
15provider and tests which need it.
16
17Upstream-Status: Backport
18Signed-off-by: Ross Burton <ross.burton@arm.com>
19---
20 meson.build | 4 ++++
21 tls/tests/certificate.c | 11 +++++++----
22 tls/tests/connection.c | 4 +++-
23 3 files changed, 14 insertions(+), 5 deletions(-)
24
25diff --git a/meson.build b/meson.build
26index 0fa9027..d2a023a 100644
27--- a/meson.build
28+++ b/meson.build
29@@ -84,6 +84,10 @@ gnutls_dep = dependency('gnutls', version: '>= 3.7.4', required: get_option('gnu
30
31 if gnutls_dep.found()
32 backends += ['gnutls']
33+ # test-specific, maybe move to tls/tests
34+ if cc.has_function('gnutls_pkcs11_init', prefix: '#include <gnutls/pkcs11.h>', dependencies: gnutls_dep)
35+ config_h.set10('HAVE_GNUTLS_PKCS11', true)
36+ endif
37 endif
38
39 # *** Checks for OpenSSL ***
40diff --git a/tls/tests/certificate.c b/tls/tests/certificate.c
41index e820ba1..dd2412b 100644
42--- a/tls/tests/certificate.c
43+++ b/tls/tests/certificate.c
44@@ -24,6 +24,7 @@
45 * Author: Stef Walter <stefw@collabora.co.uk>
46 */
47
48+#include "config.h"
49 #include "certificate.h"
50
51 #include <gio/gio.h>
52@@ -911,7 +912,7 @@ int
53 main (int argc,
54 char *argv[])
55 {
56-#ifdef BACKEND_IS_GNUTLS
57+#if defined(BACKEND_IS_GNUTLS) && HAVE_GNUTLS_PKCS11
58 char *module_path;
59 #endif
60
61@@ -921,7 +922,7 @@ main (int argc,
62 g_setenv ("GIO_USE_TLS", BACKEND, TRUE);
63 g_assert_cmpint (g_ascii_strcasecmp (G_OBJECT_TYPE_NAME (g_tls_backend_get_default ()), "GTlsBackend" BACKEND), ==, 0);
64
65-#ifdef BACKEND_IS_GNUTLS
66+#if defined(BACKEND_IS_GNUTLS) && HAVE_GNUTLS_PKCS11
67 module_path = g_test_build_filename (G_TEST_BUILT, "mock-pkcs11.so", NULL);
68 g_assert_true (g_file_test (module_path, G_FILE_TEST_EXISTS));
69
70@@ -942,12 +943,14 @@ main (int argc,
71 setup_certificate, test_create_certificate_with_issuer, teardown_certificate);
72 g_test_add ("/tls/" BACKEND "/certificate/create-with-garbage-input", TestCertificate, NULL,
73 setup_certificate, test_create_certificate_with_garbage_input, teardown_certificate);
74- g_test_add ("/tls/" BACKEND "/certificate/pkcs11", TestCertificate, NULL,
75- setup_certificate, test_create_certificate_pkcs11, teardown_certificate);
76 g_test_add ("/tls/" BACKEND "/certificate/private-key", TestCertificate, NULL,
77 setup_certificate, test_private_key, teardown_certificate);
78+#if HAVE_GNUTLS_PKCS11
79+ g_test_add ("/tls/" BACKEND "/certificate/pkcs11", TestCertificate, NULL,
80+ setup_certificate, test_create_certificate_pkcs11, teardown_certificate);
81 g_test_add ("/tls/" BACKEND "/certificate/private-key-pkcs11", TestCertificate, NULL,
82 setup_certificate, test_private_key_pkcs11, teardown_certificate);
83+#endif
84
85 g_test_add_func ("/tls/" BACKEND "/certificate/create-chain", test_create_certificate_chain);
86 g_test_add_func ("/tls/" BACKEND "/certificate/create-no-chain", test_create_certificate_no_chain);
87diff --git a/tls/tests/connection.c b/tls/tests/connection.c
88index 17efe1b..62a7fbb 100644
89--- a/tls/tests/connection.c
90+++ b/tls/tests/connection.c
91@@ -3376,7 +3376,7 @@ main (int argc,
92
93 g_assert_true (g_ascii_strcasecmp (G_OBJECT_TYPE_NAME (g_tls_backend_get_default ()), "GTlsBackend" BACKEND) == 0);
94
95-#ifdef BACKEND_IS_GNUTLS
96+#if defined(BACKEND_IS_GNUTLS) && HAVE_GNUTLS_PKCS11
97 module_path = g_test_build_filename (G_TEST_BUILT, "mock-pkcs11.so", NULL);
98 g_assert_true (g_file_test (module_path, G_FILE_TEST_EXISTS));
99
100@@ -3438,8 +3438,10 @@ main (int argc,
101 setup_connection, test_client_auth_request_fail, teardown_connection);
102 g_test_add ("/tls/" BACKEND "/connection/client-auth-request-none", TestConnection, NULL,
103 setup_connection, test_client_auth_request_none, teardown_connection);
104+#if HAVE_GNUTLS_PKCS11
105 g_test_add ("/tls/" BACKEND "/connection/client-auth-pkcs11", TestConnection, NULL,
106 setup_connection, test_client_auth_pkcs11_connection, teardown_connection);
107+#endif
108 g_test_add ("/tls/" BACKEND "/connection/no-database", TestConnection, NULL,
109 setup_connection, test_connection_no_database, teardown_connection);
110 g_test_add ("/tls/" BACKEND "/connection/failed", TestConnection, NULL,
111--
1122.34.1
113
diff --git a/meta/recipes-core/glib-networking/glib-networking/eagain.patch b/meta/recipes-core/glib-networking/glib-networking/eagain.patch
index ee5b6a7beb..062fc0191b 100644
--- a/meta/recipes-core/glib-networking/glib-networking/eagain.patch
+++ b/meta/recipes-core/glib-networking/glib-networking/eagain.patch
@@ -1,4 +1,8 @@
1In autobuilder testing we regularly see glib-networking ptest fail with: 1From 025bb39dfdb81dd2852deaefea228b197ef3cd8d Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sat, 6 May 2023 12:18:50 +0100
4Subject: [PATCH] In autobuilder testing we regularly see glib-networking ptest
5 fail with:
2 6
3GLib-Net:ERROR:/usr/src/debug/glib-networking/2.74.0-r0/tls/tests/connection.c:1944:simul_read_thread: assertion failed (error == NULL): Resource temporarily unavailable (g-io-error-quark, 27) 7GLib-Net:ERROR:/usr/src/debug/glib-networking/2.74.0-r0/tls/tests/connection.c:1944:simul_read_thread: assertion failed (error == NULL): Resource temporarily unavailable (g-io-error-quark, 27)
4Bail out! GLib-Net:ERROR:/usr/src/debug/glib-networking/2.74.0-r0/tls/tests/connection.c:1944:simul_read_thread: assertion failed (error == NULL): Resource temporarily unavailable (g-io-error-quark, 27) 8Bail out! GLib-Net:ERROR:/usr/src/debug/glib-networking/2.74.0-r0/tls/tests/connection.c:1944:simul_read_thread: assertion failed (error == NULL): Resource temporarily unavailable (g-io-error-quark, 27)
@@ -12,11 +16,15 @@ Upstream-Status: Pending [testing to see if patch resolves the issue]
12 16
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 17Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14 18
15Index: glib-networking-2.74.0/tls/tests/connection.c 19---
16=================================================================== 20 tls/tests/connection.c | 4 ++++
17--- glib-networking-2.74.0.orig/tls/tests/connection.c 21 1 file changed, 4 insertions(+)
18+++ glib-networking-2.74.0/tls/tests/connection.c 22
19@@ -1941,6 +1941,10 @@ simul_read_thread (gpointer user_data) 23diff --git a/tls/tests/connection.c b/tls/tests/connection.c
24index 62a7fbb..3447c80 100644
25--- a/tls/tests/connection.c
26+++ b/tls/tests/connection.c
27@@ -2210,6 +2210,10 @@ simul_read_thread (gpointer user_data)
20 test->buf + test->nread, 28 test->buf + test->nread,
21 MIN (TEST_DATA_LENGTH / 2, TEST_DATA_LENGTH - test->nread), 29 MIN (TEST_DATA_LENGTH / 2, TEST_DATA_LENGTH - test->nread),
22 NULL, &error); 30 NULL, &error);
diff --git a/meta/recipes-core/glib-networking/glib-networking_2.76.1.bb b/meta/recipes-core/glib-networking/glib-networking_2.78.0.bb
index 0f8822e160..68f9a2ed78 100644
--- a/meta/recipes-core/glib-networking/glib-networking_2.76.1.bb
+++ b/meta/recipes-core/glib-networking/glib-networking_2.78.0.bb
@@ -14,7 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
14SECTION = "libs" 14SECTION = "libs"
15DEPENDS = "glib-2.0-native glib-2.0" 15DEPENDS = "glib-2.0-native glib-2.0"
16 16
17SRC_URI[archive.sha256sum] = "5c698a9994dde51efdfb1026a56698a221d6250e89dc50ebcddda7b81480a42b" 17SRC_URI[archive.sha256sum] = "52fe4ce93f7dc51334b102894599858d23c8a65ac4a1110b30920565d68d3aba"
18 18
19# Upstream note that for the openssl backend, half the tests where this backend don't return 19# Upstream note that for the openssl backend, half the tests where this backend don't return
20# the expected error code or don't work as expected so default to gnutls 20# the expected error code or don't work as expected so default to gnutls
@@ -31,7 +31,6 @@ inherit gnomebase gettext upstream-version-is-even gio-module-cache ptest-gnome
31 31
32SRC_URI += "file://run-ptest" 32SRC_URI += "file://run-ptest"
33SRC_URI += "file://eagain.patch" 33SRC_URI += "file://eagain.patch"
34SRC_URI += "file://0001-tls-tests-disable-PKCS-11-tests-if-not-available.patch"
35 34
36FILES:${PN} += "\ 35FILES:${PN} += "\
37 ${libdir}/gio/modules/libgio*.so \ 36 ${libdir}/gio/modules/libgio*.so \