[gentoo-commits] repo/gentoo:master commit in: net-libs/glib-networking/, net-libs/glib-networking/files/

2022-12-01 Thread Sam James
commit: 161af48a5a8d86be95b1a07f4877a0dbc8df1db3
Author: Sam James  gentoo  org>
AuthorDate: Fri Dec  2 03:27:26 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Dec  2 03:27:33 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=161af48a

net-libs/glib-networking: fix tests w/ gnutls 3.7.8

Closes: https://bugs.gentoo.org/877077
Signed-off-by: Sam James  gentoo.org>

 ...lib-networking-2.74.0-gnutls-tls-1.3-test.patch | 85 ++
 .../glib-networking/glib-networking-2.74.0.ebuild  |  4 +
 2 files changed, 89 insertions(+)

diff --git 
a/net-libs/glib-networking/files/glib-networking-2.74.0-gnutls-tls-1.3-test.patch
 
b/net-libs/glib-networking/files/glib-networking-2.74.0-gnutls-tls-1.3-test.patch
new file mode 100644
index ..b93cb8ab9828
--- /dev/null
+++ 
b/net-libs/glib-networking/files/glib-networking-2.74.0-gnutls-tls-1.3-test.patch
@@ -0,0 +1,85 @@
+https://bugs.gentoo.org/877077
+https://gitlab.gnome.org/GNOME/glib-networking/-/issues/201
+https://gitlab.gnome.org/GNOME/glib-networking/-/commit/205b578c6de0a6b42dd24d97f08ab47d0347431a
+
+From 205b578c6de0a6b42dd24d97f08ab47d0347431a Mon Sep 17 00:00:00 2001
+From: Natanael Copa 
+Date: Wed, 2 Nov 2022 13:26:53 +0100
+Subject: [PATCH] tests: skip tls-exporter test for TLS 1.2
+
+TLS exporter does not exist before TLS 1.3 so skip the tls-exporter test
+for TLS 1.2.
+
+Fixes https://gitlab.gnome.org/GNOME/glib-networking/-/issues/201
+
+Part-of: 
+--- a/tls/tests/connection.c
 b/tls/tests/connection.c
+@@ -2988,6 +2988,8 @@ test_connection_binding_match_tls_exporter 
(TestConnection *test,
+   GByteArray *client_cb, *server_cb;
+   gchar *client_b64, *server_b64;
+   GError *error = NULL;
++  gboolean client_supports_tls_exporter;
++  gboolean server_supports_tls_exporter;
+ 
+   test->database = g_tls_file_database_new (tls_test_file_path 
("ca-roots.pem"), );
+   g_assert_no_error (error);
+@@ -3016,27 +3018,38 @@ test_connection_binding_match_tls_exporter 
(TestConnection *test,
+   g_main_loop_run (test->loop);
+ 
+   /* Smoke test: ensure both sides support tls-exporter */
+-  g_assert_true (g_tls_connection_get_channel_binding_data (G_TLS_CONNECTION 
(test->client_connection),
+-
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, NULL, NULL));
+-  g_assert_true (g_tls_connection_get_channel_binding_data (G_TLS_CONNECTION 
(test->server_connection),
+-
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, NULL, NULL));
++  client_supports_tls_exporter = g_tls_connection_get_channel_binding_data 
(G_TLS_CONNECTION (test->client_connection),
++
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, NULL, NULL);
++  server_supports_tls_exporter = g_tls_connection_get_channel_binding_data 
(G_TLS_CONNECTION (test->server_connection),
++
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, NULL, NULL);
+ 
+-  /* Real test: retrieve bindings and compare */
+-  client_cb = g_byte_array_new ();
+-  server_cb = g_byte_array_new ();
+-  g_assert_true (g_tls_connection_get_channel_binding_data (G_TLS_CONNECTION 
(test->client_connection),
+-
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, client_cb, NULL));
+-  g_assert_true (g_tls_connection_get_channel_binding_data (G_TLS_CONNECTION 
(test->server_connection),
+-
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, server_cb, NULL));
++  g_assert_true (client_supports_tls_exporter == 
server_supports_tls_exporter);
+ 
+-  client_b64 = g_base64_encode (client_cb->data, client_cb->len);
+-  server_b64 = g_base64_encode (server_cb->data, server_cb->len);
+-  g_assert_cmpstr (client_b64, ==, server_b64);
++  if (client_supports_tls_exporter)
++{
++  /* Real test: retrieve bindings and compare */
++  client_cb = g_byte_array_new ();
++  server_cb = g_byte_array_new ();
++  g_assert_true (g_tls_connection_get_channel_binding_data 
(G_TLS_CONNECTION (test->client_connection),
++
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, client_cb, NULL));
++  g_assert_true (g_tls_connection_get_channel_binding_data 
(G_TLS_CONNECTION (test->server_connection),
++
G_TLS_CHANNEL_BINDING_TLS_EXPORTER, server_cb, NULL));
+ 
+-  g_free (client_b64);
+-  g_free (server_b64);
+-  g_byte_array_unref (client_cb);
+-  g_byte_array_unref (server_cb);
++  client_b64 = g_base64_encode (client_cb->data, client_cb->len);
++  server_b64 = g_base64_encode (server_cb->data, server_cb->len);
++  g_assert_cmpstr (client_b64, ==, server_b64);
++
++  g_free (client_b64);
++  g_free (server_b64);
++  g_byte_array_unref (client_cb);
++  

[gentoo-commits] repo/gentoo:master commit in: net-libs/glib-networking/, net-libs/glib-networking/files/

2021-11-28 Thread Sam James
commit: 0a9dcd47814bfdc36c92de4e57071ad692fd4480
Author: Sam James  gentoo  org>
AuthorDate: Mon Nov 29 05:30:13 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Nov 29 05:30:25 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a9dcd47

net-libs/glib-networking: apply upstream patch for 32-bit test failure

Signed-off-by: Sam James  gentoo.org>

 .../glib-networking-2.70.0-time_t-32-bit.patch | 52 ++
 .../glib-networking/glib-networking-2.70.0.ebuild  |  4 ++
 2 files changed, 56 insertions(+)

diff --git 
a/net-libs/glib-networking/files/glib-networking-2.70.0-time_t-32-bit.patch 
b/net-libs/glib-networking/files/glib-networking-2.70.0-time_t-32-bit.patch
new file mode 100644
index ..fc9ccea13952
--- /dev/null
+++ b/net-libs/glib-networking/files/glib-networking-2.70.0-time_t-32-bit.patch
@@ -0,0 +1,52 @@
+Workaround/fix test failure on 32-bit arches. Should be in release
+after 2.70.0.
+
+https://gitlab.gnome.org/GNOME/glib-networking/-/commit/4f8ca86a0e460794188c3355f0c7cc11fdbe4229.patch
+
+From: Simon McVittie 
+Date: Tue, 21 Sep 2021 17:07:44 +
+Subject: [PATCH] tests: Accept GNUTLS' workaround for limited size of time_t
+
+--- a/tls/tests/certificate.c
 b/tls/tests/certificate.c
+@@ -672,6 +672,12 @@ test_certificate_not_valid_before (void)
+   g_object_unref (cert);
+ }
+ 
++/* On 32-bit, GNUTLS caps expiry times at 2037-12-31 23:23:23 to avoid
++ * overflowing time_t. Hopefully by 2037, either 32-bit will finally have
++ * died out, or GNUTLS will rethink its approach to
++ * https://gitlab.com/gnutls/gnutls/-/issues/370 */
++#define GNUTLS_32_BIT_NOT_VALID_AFTER_MAX 2145914603
++
+ static void
+ test_certificate_not_valid_after (void)
+ {
+@@ -686,7 +692,16 @@ test_certificate_not_valid_after (void)
+   actual = g_tls_certificate_get_not_valid_after (cert);
+   g_assert_nonnull (actual);
+   actual_str = g_date_time_format_iso8601 (actual);
++
++#if SIZEOF_TIME_T <= 4
++  if (g_date_time_to_unix (actual) == GNUTLS_32_BIT_NOT_VALID_AFTER_MAX)
++g_test_incomplete ("not-valid-after date not representable on 32-bit");
++  else
++g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER);
++#else
+   g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER);
++#endif
++
+   g_free (actual_str);
+   g_date_time_unref (actual);
+   g_object_unref (cert);
+--- a/tls/tests/meson.build
 b/tls/tests/meson.build
+@@ -69,6 +69,7 @@ foreach backend: backends
+ test_cflags = cflags + [
+   '-DBACKEND="@0@"'.format(backend),
+   '-DBACKEND_IS_' + backend.to_upper(),
++  '-DSIZEOF_TIME_T=@0@'.format(cc.sizeof('time_t', prefix: '#include 
')),
+ ]
+ 
+ if backend == 'openssl'
+GitLab

diff --git a/net-libs/glib-networking/glib-networking-2.70.0.ebuild 
b/net-libs/glib-networking/glib-networking-2.70.0.ebuild
index 860454cb0242..8bdcf6b9b5c7 100644
--- a/net-libs/glib-networking/glib-networking-2.70.0.ebuild
+++ b/net-libs/glib-networking/glib-networking-2.70.0.ebuild
@@ -30,6 +30,10 @@ BDEPEND="
test? ( sys-apps/dbus )
 "
 
+PATCHES=(
+   "${FILESDIR}"/${P}-time_t-32-bit.patch
+)
+
 src_prepare() {
xdg_src_prepare
 



[gentoo-commits] repo/gentoo:master commit in: net-libs/glib-networking/, net-libs/glib-networking/files/

2017-01-26 Thread Mart Raudsepp
commit: 9e69bcc3725e0b1001b313726481c687f92aa030
Author: Mart Raudsepp  gentoo  org>
AuthorDate: Thu Jan 26 09:35:10 2017 +
Commit: Mart Raudsepp  gentoo  org>
CommitDate: Thu Jan 26 10:55:24 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e69bcc3

net-libs/glib-networking: Remove old

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 net-libs/glib-networking/Manifest  |  2 -
 .../files/glib-networking-2.40.1-unittests.patch   | 45 ---
 .../glib-networking/glib-networking-2.44.0.ebuild  | 67 
 .../glib-networking/glib-networking-2.46.1.ebuild  | 89 --
 4 files changed, 203 deletions(-)

diff --git a/net-libs/glib-networking/Manifest 
b/net-libs/glib-networking/Manifest
index 3c353c8..91ecc96 100644
--- a/net-libs/glib-networking/Manifest
+++ b/net-libs/glib-networking/Manifest
@@ -1,4 +1,2 @@
-DIST glib-networking-2.44.0.tar.xz 375456 SHA256 
8f8a340d3ba99bfdef38b653da929652ea6640e27969d29f7ac51fbbe11a4346 SHA512 
318d7b7a4beeb21f75da9278bae7016bf78be48f9e2b9365d48246c97d1c6b6f5aba3365ef81f2592fd3cc3d5d16122c245dd3cfede6eaffc3e94113a527e10b
 WHIRLPOOL 
aaee32a45fbccbece1378a0a304b6215862bd1fd69991fbd99f344027693b4040b5acfe6b96f20c9d05d648cc72394dade50a233d61f19195e2f7ced5c4f0292
-DIST glib-networking-2.46.1.tar.xz 378352 SHA256 
d5034214217f705891b6c9e719cc2c583c870bfcfdc454ebbb5e5e8940ac90b1 SHA512 
0d8d1977a3841c73eeaee478ceaf84bbba810818596350afdf218ff4cae4cdfc4a3a814c38481f7e439050f6bcb71b0b06d02afd8ea3e33d390f87f436f17b96
 WHIRLPOOL 
ff448e1a8d57795c1803dfcbf0e082e09ecdd6d37111e703e2e4877af9d0aa51ee70b0fc9ee31b9142f058906e64da40dc42ebd81e8bac635c04a479db5ab926
 DIST glib-networking-2.48.2.tar.xz 392340 SHA256 
925c0c49d6b2b8b5695f2e33cd952d1dbb7d18d3f2f796413577719315bb3a84 SHA512 
e33e2f2af062eaa686bb20cd872f25eca0bbbf9bba072e74049a2996dd66fe1a2000ba991354ed63fc196f3da4d9cfa05cc4ae31cfe08cfaf997cf08a9e2fd84
 WHIRLPOOL 
75a09eb6de135419cfc7a4f2ad3b97a0c3004ba9e8a4f1c64983eda72eb7ce6e9f11d58460ee71dc36c62d0040927d01d9283269626d1647e03e19ffc52fdaa0
 DIST glib-networking-2.50.0.tar.xz 435380 SHA256 
3f1a442f3c2a734946983532ce59ed49120319fdb10c938447c373d5e5286bee SHA512 
a1e9d28a546f83d461057f088ca2467a32be110f444c8ede1cbfeb20244637d8d5fb5b5b0ee4485feb517beebc3536671442bbfdd3ba01663b52e6da138bd7fe
 WHIRLPOOL 
c9d2fa9c36fa9e48991ebf09c5719ccb6e0cb72bcdc5a878ea7d1db71d7edf2614ff6a4c91839860cb3f92aae336fd6033c26d8905c06730369e1256435ee47a

diff --git 
a/net-libs/glib-networking/files/glib-networking-2.40.1-unittests.patch 
b/net-libs/glib-networking/files/glib-networking-2.40.1-unittests.patch
deleted file mode 100644
index 4301b84..
--- a/net-libs/glib-networking/files/glib-networking-2.40.1-unittests.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 8867e6a0b3b84b41b5a61c5194fa1300c5c39d8c Mon Sep 17 00:00:00 2001
-From: Gilles Dartiguelongue 
-Date: Fri, 25 Apr 2014 22:59:01 +0200
-Subject: [PATCH] test connection is not PKCS#11 related
-
-Avoids silly test failure:
-
-CCLD connection
-/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/Scrt1.o: In
-function `_start':
-(.text+0x20): undefined reference to `main'
-collect2: error: ld returned 1 exit status
-Makefile:897: recipe for target 'connection' failed
-make[4]: *** [connection] Error 1

- tls/tests/Makefile.am | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/tls/tests/Makefile.am b/tls/tests/Makefile.am
-index 6287b9c..009b388 100644
 a/tls/tests/Makefile.am
-+++ b/tls/tests/Makefile.am
-@@ -15,6 +15,9 @@ test_programs =   \
-   connection\
-   $(NULL)
- 
-+connection_SOURCES = connection.c \
-+  mock-interaction.c mock-interaction.h
-+
- if HAVE_PKCS11
- 
- test_programs +=   \
-@@ -33,9 +36,6 @@ pkcs11_slot_SOURCES = pkcs11-slot.c \
-   mock-pkcs11.c mock-pkcs11.h \
-   mock-interaction.c mock-interaction.h
- 
--connection_SOURCES = connection.c \
--  mock-interaction.c mock-interaction.h
--
- endif
- 
- testfiles_data =  \
--- 
-1.9.0
-

diff --git a/net-libs/glib-networking/glib-networking-2.44.0.ebuild 
b/net-libs/glib-networking/glib-networking-2.44.0.ebuild
deleted file mode 100644
index be93ead..
--- a/net-libs/glib-networking/glib-networking-2.44.0.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-GCONF_DEBUG="no"
-GNOME2_LA_PUNT="yes"
-
-inherit autotools eutils gnome2 multilib-minimal virtualx
-
-DESCRIPTION="Network-related giomodules for glib"
-HOMEPAGE="https://git.gnome.org/browse/glib-networking/;
-
-LICENSE="LGPL-2+"
-SLOT="0"
-IUSE="+gnome +libproxy smartcard +ssl test"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 
~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos 
~x86-macos ~sparc-solaris ~x86-solaris"
-
-RDEPEND="
-