Compare commits
222 Commits
Author | SHA1 | Date |
---|---|---|
Kalev Lember | f9fbe5a4c8 | |
Michael Catanzaro | a6c366328b | |
Michael Catanzaro | f52f413589 | |
Michael Catanzaro | 78bc3e5c67 | |
Michael Catanzaro | 8f38a70fd6 | |
Kalev Lember | 74300be378 | |
Kalev Lember | 9b1f9aa2f2 | |
Kalev Lember | b5748c4edb | |
Michael Catanzaro | 6c5949a8ca | |
Michael Catanzaro | 62d0b8f09a | |
Michael Catanzaro | ce0559a035 | |
Kalev Lember | 22bd71a65a | |
Kalev Lember | 6248b5a00a | |
Kalev Lember | e1ea8b2fcf | |
Adam Williamson | c3df0e5227 | |
Jeff Law | 683c99b0e4 | |
Kalev Lember | 1d384aa8fb | |
Kalev Lember | b03aa2af4a | |
Fedora Release Engineering | 7a981e97c7 | |
Fedora Release Engineering | ea83fb0237 | |
Jeff Law | 06a3cf31cd | |
Kalev Lember | ee2a246925 | |
Kalev Lember | 6e6595e611 | |
Kalev Lember | fbd5247c7a | |
Kalev Lember | 46f4926d2c | |
Kalev Lember | d43d0ce458 | |
Tomas Popela | ec78e22b1b | |
Kalev Lember | ba78ee1988 | |
Kalev Lember | cf59eebaca | |
Kalev Lember | 1ac207bef9 | |
Kalev Lember | 898c00b2ad | |
Kalev Lember | a23372a417 | |
Michael Catanzaro | fdfddfe804 | |
Kalev Lember | 807f65d4bd | |
Stephen Gallagher | ab00509fe1 | |
Fedora Release Engineering | af14559f8f | |
Kalev Lember | e992d2d872 | |
Kalev Lember | 540aeada95 | |
Kalev Lember | cfb57c36bc | |
Kalev Lember | 348b2bb6ec | |
Kalev Lember | 0085371da8 | |
Kalev Lember | 927ce866ba | |
Kalev Lember | 3f77266cf6 | |
Kalev Lember | 80b2df57b6 | |
Fedora Release Engineering | 9558681601 | |
Kalev Lember | dd3956be01 | |
David King | f45e5da632 | |
David King | aafbdc7a3c | |
David King | e81b0cb6f7 | |
Kalev Lember | d40813ab05 | |
Adam Williamson | 0f797a67d7 | |
Kalev Lember | 8b0b09cbeb | |
Kalev Lember | 46304cbb85 | |
Zbigniew Jędrzejewski-Szmek | 12007a228d | |
Zbigniew Jędrzejewski-Szmek | de2e4aad98 | |
Zbigniew Jędrzejewski-Szmek | 789d0acce0 | |
Kalev Lember | 66f00fe02c | |
Kalev Lember | 8594386f06 | |
Kalev Lember | 0660fa0c94 | |
Fedora Release Engineering | b0612ed4ec | |
Kalev Lember | f877f72c6a | |
Kalev Lember | 1cc525296d | |
Kalev Lember | 9f7e13d0db | |
Kalev Lember | cbe7cdc693 | |
Kalev Lember | 118876b458 | |
Kalev Lember | aedd1304a1 | |
Miro Hrončok | 6070ee78fb | |
Kalev Lember | 4acd8adcda | |
Kalev Lember | 03b8b8e2e3 | |
Kalev Lember | 5d7683bd2f | |
Kalev Lember | e17445b580 | |
Kalev Lember | 8772f8141f | |
Colin Walters | 9a01b6006b | |
Ondrej Holy | 96178709bd | |
Ondrej Holy | 61bd4d25e7 | |
Fedora Release Engineering | 38b0fc282d | |
Miro Hrončok | fdc1cc9df5 | |
Debarshi Ray | 9c3ca0aa8b | |
Kalev Lember | 6c43ffbb6e | |
Kalev Lember | dea8a050cc | |
Fabio Valentini | 4c1e2ebdaa | |
Kalev Lember | 98d0423b58 | |
Kalev Lember | cda7784363 | |
Igor Gnatenko | 9b6973c83d | |
Igor Gnatenko | 2bf83454cd | |
Kalev Lember | 2cdd991d06 | |
Kalev Lember | fd6c7196f2 | |
Kalev Lember | ad56827ff1 | |
Igor Gnatenko | 14f6fc54a9 | |
Kalev Lember | 087ef3ba0f | |
Kalev Lember | 903f77fb2d | |
Kalev Lember | acd3cbe4d5 | |
Kalev Lember | 0ce8af8d61 | |
Kalev Lember | 1267711fed | |
Kalev Lember | 9c81d716d8 | |
Kalev Lember | a462f9ad53 | |
Kalev Lember | a26ff7ab92 | |
Kalev Lember | bdba4a7a70 | |
Igor Gnatenko | d7233f80ab | |
Igor Gnatenko | 78ad5e06b9 | |
Kalev Lember | 7601a56f32 | |
Fedora Release Engineering | 52c8682ec3 | |
Kalev Lember | 8a2874adbc | |
Kalev Lember | 9d1a02789c | |
Kalev Lember | 712673e983 | |
Owen W. Taylor | a93430c4ec | |
Florian Müllner | c120a31c5c | |
Kalev Lember | 15854645a4 | |
Kalev Lember | ca7ad47973 | |
Colin Walters | 05d466c2f3 | |
Colin Walters | 020ac281a0 | |
Kalev Lember | 28d80c00df | |
Kalev Lember | 801e4a1ba0 | |
Kalev Lember | 13e91f1191 | |
Kalev Lember | 3d2fdcc93f | |
Kalev Lember | d0061dc774 | |
David King | 9212218622 | |
David King | c61950e22a | |
David King | d6f26ff142 | |
Richard Hughes | 0a852c03e0 | |
Richard Hughes | 521a0af72d | |
Richard Hughes | 6eddb09ca7 | |
Richard Hughes | de68b09821 | |
Fedora Release Engineering | 6ebc67f953 | |
Miro Hrončok | 66ce32f8f6 | |
Kalev Lember | 909ce71f92 | |
Kalev Lember | 590ba0a7c2 | |
Kalev Lember | f0e37d48aa | |
Kalev Lember | b667522807 | |
Kalev Lember | f19e684016 | |
Kalev Lember | 49888f2247 | |
Kalev Lember | 050e056f1a | |
Kalev Lember | 6fa82410a9 | |
Kalev Lember | 720a3c04d3 | |
Kalev Lember | 8c1e113e30 | |
Miro Hrončok | 95c4ff00c9 | |
Ville Skyttä | bd79cc7078 | |
Kalev Lember | 3988005eba | |
Kalev Lember | e80d9926c8 | |
Petr Písař | 33893e2564 | |
Richard Hughes | edffddfc65 | |
Yaakov Selkowitz | 87058bdf9c | |
Florian Müllner | 65184ef400 | |
Kalev Lember | 4a9a2168b8 | |
Colin Walters | c1a8bc0c27 | |
Kalev Lember | d2f294c971 | |
Richard Hughes | 8fe0a4919c | |
Richard Hughes | 9a2f240e5e | |
Colin Walters | 7bda568479 | |
Richard Hughes | f441ba778e | |
Dennis Gilmore | b409b5060b | |
David King | 78b0c0f225 | |
Kalev Lember | 30be49854c | |
Kalev Lember | 43ad60e20e | |
Kalev Lember | 5472a32d5c | |
Kevin Fenzi | 7473b58ac4 | |
Kalev Lember | cafbb83624 | |
Kalev Lember | 64b1fd19ea | |
Kalev Lember | 135a12a11c | |
Kalev Lember | 8efb30daf8 | |
Kalev Lember | ee9fe8145c | |
Kalev Lember | 90bf1b32b0 | |
Kalev Lember | 4235df9f60 | |
Kalev Lember | 8b343f3544 | |
Matthias Clasen | 6755798d12 | |
David King | 2dcc4a3c39 | |
Kalev Lember | 33edb32972 | |
David King | 37425187a1 | |
Dennis Gilmore | bb5d4bcab2 | |
David King | 155dac13a7 | |
Kalev Lember | aaaadfa0e3 | |
Kalev Lember | a7cfb69290 | |
Kalev Lember | 5b9d4813fe | |
Kalev Lember | 18083219d7 | |
Till Maas | 79b7e1a5e5 | |
David King | cc555d1c72 | |
David King | ff0cae3123 | |
Matthias Clasen | 3678fff388 | |
David King | 31b797e2a7 | |
Kalev Lember | 0766feafff | |
Kalev Lember | fca95b7377 | |
Florian Müllner | c894923a28 | |
Kalev Lember | ee19c0cfd1 | |
Kalev Lember | 7173be9291 | |
Matthias Clasen | 2c8f4e7a31 | |
Bastien Nocera | 1759e582c5 | |
Kalev Lember | b45bc84b46 | |
Kalev Lember | b106300330 | |
Peter Robinson | 82f0a6a1c1 | |
Stef Walter | d143a7bba6 | |
Kalev Lember | acaa117c64 | |
Tom Callaway | 2f6436c152 | |
Richard Hughes | f4398cbb64 | |
Dennis Gilmore | 7ab7df4b4f | |
Kalev Lember | 94703bb293 | |
Richard Hughes | 062ae8743a | |
Richard Hughes | 73831db5f5 | |
Richard Hughes | 37f2e6a09b | |
Richard Hughes | 87399ddca1 | |
Richard Hughes | 9df1f592d1 | |
Richard Hughes | af8f0d018f | |
Richard W.M. Jones | 8d1f2560de | |
Richard Hughes | c83908386e | |
Richard Hughes | 5ccb823475 | |
Richard Hughes | 6c0de58bfa | |
Richard Hughes | 0f1e253d42 | |
Richard Hughes | 3be72f99c3 | |
Richard Hughes | d247541600 | |
Kalev Lember | aafdb1dc21 | |
Kalev Lember | 8cc88f501a | |
Kalev Lember | 2beaa32957 | |
Debarshi Ray | 9da0fb4b16 | |
Petr Písař | ef9967724e | |
Debarshi Ray | 7262b9bce8 | |
Petr Písař | 6dea828cc8 | |
Debarshi Ray | 19a1f0d61e | |
Matthias Clasen | b95e4bd68c | |
Kalev Lember | 50d046e3fd | |
Debarshi Ray | b947f05ed6 | |
Matthias Clasen | 828dd098f4 | |
Matthias Clasen | 25351c5075 | |
Kalev Lember | 2d0f25ec3e |
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,32 @@
|
||||||
|
From c2b8fa8a34765d42be69e7eb9a4c44eeb970f775 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Catanzaro <mcatanzaro@gnome.org>
|
||||||
|
Date: Wed, 28 Oct 2020 10:41:13 -0500
|
||||||
|
Subject: [PATCH] gsocketclient: fix crash when async connection step fails
|
||||||
|
|
||||||
|
This is a regression from !1686. The tmp_error is no longer valid after
|
||||||
|
it is "considered" and cannot be used at this point. We should print the
|
||||||
|
error earlier instead.
|
||||||
|
|
||||||
|
Fixes #2233
|
||||||
|
---
|
||||||
|
gio/gsocketclient.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c
|
||||||
|
index ce3c186fb..373774682 100644
|
||||||
|
--- a/gio/gsocketclient.c
|
||||||
|
+++ b/gio/gsocketclient.c
|
||||||
|
@@ -1837,9 +1837,9 @@ g_socket_client_connected_callback (GObject *source,
|
||||||
|
{
|
||||||
|
if (!g_cancellable_is_cancelled (attempt->cancellable))
|
||||||
|
{
|
||||||
|
+ g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message);
|
||||||
|
clarify_connect_error (data->error_info->tmp_error, data->connectable, attempt->address);
|
||||||
|
consider_tmp_error (data->error_info, G_SOCKET_CLIENT_CONNECTING);
|
||||||
|
- g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message);
|
||||||
|
connection_attempt_remove (attempt);
|
||||||
|
connection_attempt_unref (attempt);
|
||||||
|
try_next_connection_or_finish (data, FALSE);
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
|
@ -1,133 +0,0 @@
|
||||||
From f3b1054b0ebb4912f700e08da0c3d35c30113e79 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ryan Lortie <desrt@desrt.ca>
|
|
||||||
Date: Tue, 23 Apr 2013 17:26:48 +0000
|
|
||||||
Subject: Partially revert "Merge waitpid() from g_spawn_sync into gmain()"
|
|
||||||
|
|
||||||
This partially reverts commit ce0022933c255313e010b27f977f4ae02aad1e7e.
|
|
||||||
|
|
||||||
It used to be safe to use g_spawn_sync() from processes that had their
|
|
||||||
own SIGCHLD handler because it simply called wait(). When it was
|
|
||||||
changed to depend on the GLib child watching infrastructure this meant
|
|
||||||
that GLib had to own the SIGCHLD handler.
|
|
||||||
|
|
||||||
This caused hangs in at least Pidgin.
|
|
||||||
|
|
||||||
The patch contained two other improvements to the child watch code which
|
|
||||||
we want to keep, so only revert the changes to gspawn itself.
|
|
||||||
|
|
||||||
https://bugzilla.gnome.org/show_bug.cgi?id=698081
|
|
||||||
---
|
|
||||||
diff --git a/glib/gspawn.c b/glib/gspawn.c
|
|
||||||
index 381ed5c..01cedf6 100644
|
|
||||||
--- a/glib/gspawn.c
|
|
||||||
+++ b/glib/gspawn.c
|
|
||||||
@@ -47,7 +47,6 @@
|
|
||||||
|
|
||||||
#include "genviron.h"
|
|
||||||
#include "gmem.h"
|
|
||||||
-#include "gmain.h"
|
|
||||||
#include "gshell.h"
|
|
||||||
#include "gstring.h"
|
|
||||||
#include "gstrfuncs.h"
|
|
||||||
@@ -207,21 +206,6 @@ read_data (GString *str,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-typedef struct {
|
|
||||||
- GMainLoop *loop;
|
|
||||||
- gint *status_p;
|
|
||||||
-} SyncWaitpidData;
|
|
||||||
-
|
|
||||||
-static void
|
|
||||||
-on_sync_waitpid (GPid pid,
|
|
||||||
- gint status,
|
|
||||||
- gpointer user_data)
|
|
||||||
-{
|
|
||||||
- SyncWaitpidData *data = user_data;
|
|
||||||
- *(data->status_p) = status;
|
|
||||||
- g_main_loop_quit (data->loop);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
/**
|
|
||||||
* g_spawn_sync:
|
|
||||||
* @working_directory: (allow-none): child's current working directory, or %NULL to inherit parent's
|
|
||||||
@@ -277,7 +261,6 @@ g_spawn_sync (const gchar *working_directory,
|
|
||||||
GString *errstr = NULL;
|
|
||||||
gboolean failed;
|
|
||||||
gint status;
|
|
||||||
- SyncWaitpidData waitpid_data;
|
|
||||||
|
|
||||||
g_return_val_if_fail (argv != NULL, FALSE);
|
|
||||||
g_return_val_if_fail (!(flags & G_SPAWN_DO_NOT_REAP_CHILD), FALSE);
|
|
||||||
@@ -410,32 +393,45 @@ g_spawn_sync (const gchar *working_directory,
|
|
||||||
close_and_invalidate (&outpipe);
|
|
||||||
if (errpipe >= 0)
|
|
||||||
close_and_invalidate (&errpipe);
|
|
||||||
-
|
|
||||||
- /* Now create a temporary main context and loop, with just one
|
|
||||||
- * waitpid source. We used to invoke waitpid() directly here, but
|
|
||||||
- * this way we unify with the worker thread in gmain.c.
|
|
||||||
+
|
|
||||||
+ /* Wait for child to exit, even if we have
|
|
||||||
+ * an error pending.
|
|
||||||
*/
|
|
||||||
- {
|
|
||||||
- GMainContext *context;
|
|
||||||
- GMainLoop *loop;
|
|
||||||
- GSource *source;
|
|
||||||
-
|
|
||||||
- context = g_main_context_new ();
|
|
||||||
- loop = g_main_loop_new (context, TRUE);
|
|
||||||
+ again:
|
|
||||||
+
|
|
||||||
+ ret = waitpid (pid, &status, 0);
|
|
||||||
|
|
||||||
- waitpid_data.loop = loop;
|
|
||||||
- waitpid_data.status_p = &status;
|
|
||||||
-
|
|
||||||
- source = g_child_watch_source_new (pid);
|
|
||||||
- g_source_set_callback (source, (GSourceFunc)on_sync_waitpid, &waitpid_data, NULL);
|
|
||||||
- g_source_attach (source, context);
|
|
||||||
- g_source_unref (source);
|
|
||||||
-
|
|
||||||
- g_main_loop_run (loop);
|
|
||||||
+ if (ret < 0)
|
|
||||||
+ {
|
|
||||||
+ if (errno == EINTR)
|
|
||||||
+ goto again;
|
|
||||||
+ else if (errno == ECHILD)
|
|
||||||
+ {
|
|
||||||
+ if (exit_status)
|
|
||||||
+ {
|
|
||||||
+ g_warning ("In call to g_spawn_sync(), exit status of a child process was requested but ECHILD was received by waitpid(). Most likely the process is ignoring SIGCHLD, or some other thread is invoking waitpid() with a nonpositive first argument; either behavior can break applications that use g_spawn_sync either directly or indirectly.");
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ /* We don't need the exit status. */
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ if (!failed) /* avoid error pileups */
|
|
||||||
+ {
|
|
||||||
+ int errsv = errno;
|
|
||||||
|
|
||||||
- g_main_context_unref (context);
|
|
||||||
- g_main_loop_unref (loop);
|
|
||||||
- }
|
|
||||||
+ failed = TRUE;
|
|
||||||
+
|
|
||||||
+ g_set_error (error,
|
|
||||||
+ G_SPAWN_ERROR,
|
|
||||||
+ G_SPAWN_ERROR_READ,
|
|
||||||
+ _("Unexpected error in waitpid() (%s)"),
|
|
||||||
+ g_strerror (errsv));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
|
|
||||||
if (failed)
|
|
||||||
{
|
|
||||||
--
|
|
||||||
cgit v0.9.1
|
|
||||||
|
|
1895
glib2.spec
1895
glib2.spec
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,668 @@
|
||||||
|
From afb5735506e2ed1c638a8c916aa3748bf0615f32 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Walters <walters@verbum.org>
|
||||||
|
Date: Fri, 7 Jun 2019 18:44:43 +0000
|
||||||
|
Subject: [PATCH 1/2] ghmac: Split off wrapper functions into ghmac-utils.c
|
||||||
|
|
||||||
|
Prep for adding a GnuTLS HMAC implementation; these are just
|
||||||
|
utility functions that call the "core" API.
|
||||||
|
---
|
||||||
|
glib/ghmac-utils.c | 145 +++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
glib/ghmac.c | 112 ----------------------------------
|
||||||
|
glib/meson.build | 1 +
|
||||||
|
3 files changed, 146 insertions(+), 112 deletions(-)
|
||||||
|
create mode 100644 glib/ghmac-utils.c
|
||||||
|
|
||||||
|
diff --git a/glib/ghmac-utils.c b/glib/ghmac-utils.c
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000..a17359ff1
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/glib/ghmac-utils.c
|
||||||
|
@@ -0,0 +1,145 @@
|
||||||
|
+/* ghmac.h - data hashing functions
|
||||||
|
+ *
|
||||||
|
+ * Copyright (C) 2011 Collabora Ltd.
|
||||||
|
+ * Copyright (C) 2019 Red Hat, Inc.
|
||||||
|
+ *
|
||||||
|
+ * This library is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation; either
|
||||||
|
+ * version 2.1 of the License, or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * This library is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public License
|
||||||
|
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "config.h"
|
||||||
|
+
|
||||||
|
+#include <string.h>
|
||||||
|
+
|
||||||
|
+#include "ghmac.h"
|
||||||
|
+
|
||||||
|
+#include "glib/galloca.h"
|
||||||
|
+#include "gatomic.h"
|
||||||
|
+#include "gslice.h"
|
||||||
|
+#include "gmem.h"
|
||||||
|
+#include "gstrfuncs.h"
|
||||||
|
+#include "gtestutils.h"
|
||||||
|
+#include "gtypes.h"
|
||||||
|
+#include "glibintl.h"
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * g_compute_hmac_for_data:
|
||||||
|
+ * @digest_type: a #GChecksumType to use for the HMAC
|
||||||
|
+ * @key: (array length=key_len): the key to use in the HMAC
|
||||||
|
+ * @key_len: the length of the key
|
||||||
|
+ * @data: (array length=length): binary blob to compute the HMAC of
|
||||||
|
+ * @length: length of @data
|
||||||
|
+ *
|
||||||
|
+ * Computes the HMAC for a binary @data of @length. This is a
|
||||||
|
+ * convenience wrapper for g_hmac_new(), g_hmac_get_string()
|
||||||
|
+ * and g_hmac_unref().
|
||||||
|
+ *
|
||||||
|
+ * The hexadecimal string returned will be in lower case.
|
||||||
|
+ *
|
||||||
|
+ * Returns: the HMAC of the binary data as a string in hexadecimal.
|
||||||
|
+ * The returned string should be freed with g_free() when done using it.
|
||||||
|
+ *
|
||||||
|
+ * Since: 2.30
|
||||||
|
+ */
|
||||||
|
+gchar *
|
||||||
|
+g_compute_hmac_for_data (GChecksumType digest_type,
|
||||||
|
+ const guchar *key,
|
||||||
|
+ gsize key_len,
|
||||||
|
+ const guchar *data,
|
||||||
|
+ gsize length)
|
||||||
|
+{
|
||||||
|
+ GHmac *hmac;
|
||||||
|
+ gchar *retval;
|
||||||
|
+
|
||||||
|
+ g_return_val_if_fail (length == 0 || data != NULL, NULL);
|
||||||
|
+
|
||||||
|
+ hmac = g_hmac_new (digest_type, key, key_len);
|
||||||
|
+ if (!hmac)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ g_hmac_update (hmac, data, length);
|
||||||
|
+ retval = g_strdup (g_hmac_get_string (hmac));
|
||||||
|
+ g_hmac_unref (hmac);
|
||||||
|
+
|
||||||
|
+ return retval;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * g_compute_hmac_for_bytes:
|
||||||
|
+ * @digest_type: a #GChecksumType to use for the HMAC
|
||||||
|
+ * @key: the key to use in the HMAC
|
||||||
|
+ * @data: binary blob to compute the HMAC of
|
||||||
|
+ *
|
||||||
|
+ * Computes the HMAC for a binary @data. This is a
|
||||||
|
+ * convenience wrapper for g_hmac_new(), g_hmac_get_string()
|
||||||
|
+ * and g_hmac_unref().
|
||||||
|
+ *
|
||||||
|
+ * The hexadecimal string returned will be in lower case.
|
||||||
|
+ *
|
||||||
|
+ * Returns: the HMAC of the binary data as a string in hexadecimal.
|
||||||
|
+ * The returned string should be freed with g_free() when done using it.
|
||||||
|
+ *
|
||||||
|
+ * Since: 2.50
|
||||||
|
+ */
|
||||||
|
+gchar *
|
||||||
|
+g_compute_hmac_for_bytes (GChecksumType digest_type,
|
||||||
|
+ GBytes *key,
|
||||||
|
+ GBytes *data)
|
||||||
|
+{
|
||||||
|
+ gconstpointer byte_data;
|
||||||
|
+ gsize length;
|
||||||
|
+ gconstpointer key_data;
|
||||||
|
+ gsize key_len;
|
||||||
|
+
|
||||||
|
+ g_return_val_if_fail (data != NULL, NULL);
|
||||||
|
+ g_return_val_if_fail (key != NULL, NULL);
|
||||||
|
+
|
||||||
|
+ byte_data = g_bytes_get_data (data, &length);
|
||||||
|
+ key_data = g_bytes_get_data (key, &key_len);
|
||||||
|
+ return g_compute_hmac_for_data (digest_type, key_data, key_len, byte_data, length);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * g_compute_hmac_for_string:
|
||||||
|
+ * @digest_type: a #GChecksumType to use for the HMAC
|
||||||
|
+ * @key: (array length=key_len): the key to use in the HMAC
|
||||||
|
+ * @key_len: the length of the key
|
||||||
|
+ * @str: the string to compute the HMAC for
|
||||||
|
+ * @length: the length of the string, or -1 if the string is nul-terminated
|
||||||
|
+ *
|
||||||
|
+ * Computes the HMAC for a string.
|
||||||
|
+ *
|
||||||
|
+ * The hexadecimal string returned will be in lower case.
|
||||||
|
+ *
|
||||||
|
+ * Returns: the HMAC as a hexadecimal string.
|
||||||
|
+ * The returned string should be freed with g_free()
|
||||||
|
+ * when done using it.
|
||||||
|
+ *
|
||||||
|
+ * Since: 2.30
|
||||||
|
+ */
|
||||||
|
+gchar *
|
||||||
|
+g_compute_hmac_for_string (GChecksumType digest_type,
|
||||||
|
+ const guchar *key,
|
||||||
|
+ gsize key_len,
|
||||||
|
+ const gchar *str,
|
||||||
|
+ gssize length)
|
||||||
|
+{
|
||||||
|
+ g_return_val_if_fail (length == 0 || str != NULL, NULL);
|
||||||
|
+
|
||||||
|
+ if (length < 0)
|
||||||
|
+ length = strlen (str);
|
||||||
|
+
|
||||||
|
+ return g_compute_hmac_for_data (digest_type, key, key_len,
|
||||||
|
+ (const guchar *) str, length);
|
||||||
|
+}
|
||||||
|
diff --git a/glib/ghmac.c b/glib/ghmac.c
|
||||||
|
index 49fd272f0..4f181f21f 100644
|
||||||
|
--- a/glib/ghmac.c
|
||||||
|
+++ b/glib/ghmac.c
|
||||||
|
@@ -329,115 +329,3 @@ g_hmac_get_digest (GHmac *hmac,
|
||||||
|
g_checksum_update (hmac->digesto, buffer, len);
|
||||||
|
g_checksum_get_digest (hmac->digesto, buffer, digest_len);
|
||||||
|
}
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * g_compute_hmac_for_data:
|
||||||
|
- * @digest_type: a #GChecksumType to use for the HMAC
|
||||||
|
- * @key: (array length=key_len): the key to use in the HMAC
|
||||||
|
- * @key_len: the length of the key
|
||||||
|
- * @data: (array length=length): binary blob to compute the HMAC of
|
||||||
|
- * @length: length of @data
|
||||||
|
- *
|
||||||
|
- * Computes the HMAC for a binary @data of @length. This is a
|
||||||
|
- * convenience wrapper for g_hmac_new(), g_hmac_get_string()
|
||||||
|
- * and g_hmac_unref().
|
||||||
|
- *
|
||||||
|
- * The hexadecimal string returned will be in lower case.
|
||||||
|
- *
|
||||||
|
- * Returns: the HMAC of the binary data as a string in hexadecimal.
|
||||||
|
- * The returned string should be freed with g_free() when done using it.
|
||||||
|
- *
|
||||||
|
- * Since: 2.30
|
||||||
|
- */
|
||||||
|
-gchar *
|
||||||
|
-g_compute_hmac_for_data (GChecksumType digest_type,
|
||||||
|
- const guchar *key,
|
||||||
|
- gsize key_len,
|
||||||
|
- const guchar *data,
|
||||||
|
- gsize length)
|
||||||
|
-{
|
||||||
|
- GHmac *hmac;
|
||||||
|
- gchar *retval;
|
||||||
|
-
|
||||||
|
- g_return_val_if_fail (length == 0 || data != NULL, NULL);
|
||||||
|
-
|
||||||
|
- hmac = g_hmac_new (digest_type, key, key_len);
|
||||||
|
- if (!hmac)
|
||||||
|
- return NULL;
|
||||||
|
-
|
||||||
|
- g_hmac_update (hmac, data, length);
|
||||||
|
- retval = g_strdup (g_hmac_get_string (hmac));
|
||||||
|
- g_hmac_unref (hmac);
|
||||||
|
-
|
||||||
|
- return retval;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * g_compute_hmac_for_bytes:
|
||||||
|
- * @digest_type: a #GChecksumType to use for the HMAC
|
||||||
|
- * @key: the key to use in the HMAC
|
||||||
|
- * @data: binary blob to compute the HMAC of
|
||||||
|
- *
|
||||||
|
- * Computes the HMAC for a binary @data. This is a
|
||||||
|
- * convenience wrapper for g_hmac_new(), g_hmac_get_string()
|
||||||
|
- * and g_hmac_unref().
|
||||||
|
- *
|
||||||
|
- * The hexadecimal string returned will be in lower case.
|
||||||
|
- *
|
||||||
|
- * Returns: the HMAC of the binary data as a string in hexadecimal.
|
||||||
|
- * The returned string should be freed with g_free() when done using it.
|
||||||
|
- *
|
||||||
|
- * Since: 2.50
|
||||||
|
- */
|
||||||
|
-gchar *
|
||||||
|
-g_compute_hmac_for_bytes (GChecksumType digest_type,
|
||||||
|
- GBytes *key,
|
||||||
|
- GBytes *data)
|
||||||
|
-{
|
||||||
|
- gconstpointer byte_data;
|
||||||
|
- gsize length;
|
||||||
|
- gconstpointer key_data;
|
||||||
|
- gsize key_len;
|
||||||
|
-
|
||||||
|
- g_return_val_if_fail (data != NULL, NULL);
|
||||||
|
- g_return_val_if_fail (key != NULL, NULL);
|
||||||
|
-
|
||||||
|
- byte_data = g_bytes_get_data (data, &length);
|
||||||
|
- key_data = g_bytes_get_data (key, &key_len);
|
||||||
|
- return g_compute_hmac_for_data (digest_type, key_data, key_len, byte_data, length);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * g_compute_hmac_for_string:
|
||||||
|
- * @digest_type: a #GChecksumType to use for the HMAC
|
||||||
|
- * @key: (array length=key_len): the key to use in the HMAC
|
||||||
|
- * @key_len: the length of the key
|
||||||
|
- * @str: the string to compute the HMAC for
|
||||||
|
- * @length: the length of the string, or -1 if the string is nul-terminated
|
||||||
|
- *
|
||||||
|
- * Computes the HMAC for a string.
|
||||||
|
- *
|
||||||
|
- * The hexadecimal string returned will be in lower case.
|
||||||
|
- *
|
||||||
|
- * Returns: the HMAC as a hexadecimal string.
|
||||||
|
- * The returned string should be freed with g_free()
|
||||||
|
- * when done using it.
|
||||||
|
- *
|
||||||
|
- * Since: 2.30
|
||||||
|
- */
|
||||||
|
-gchar *
|
||||||
|
-g_compute_hmac_for_string (GChecksumType digest_type,
|
||||||
|
- const guchar *key,
|
||||||
|
- gsize key_len,
|
||||||
|
- const gchar *str,
|
||||||
|
- gssize length)
|
||||||
|
-{
|
||||||
|
- g_return_val_if_fail (length == 0 || str != NULL, NULL);
|
||||||
|
-
|
||||||
|
- if (length < 0)
|
||||||
|
- length = strlen (str);
|
||||||
|
-
|
||||||
|
- return g_compute_hmac_for_data (digest_type, key, key_len,
|
||||||
|
- (const guchar *) str, length);
|
||||||
|
-}
|
||||||
|
diff --git a/glib/meson.build b/glib/meson.build
|
||||||
|
index aaf40a218..b3bf067c7 100644
|
||||||
|
--- a/glib/meson.build
|
||||||
|
+++ b/glib/meson.build
|
||||||
|
@@ -253,6 +253,7 @@ glib_sources = files(
|
||||||
|
'ggettext.c',
|
||||||
|
'ghash.c',
|
||||||
|
'ghmac.c',
|
||||||
|
+ 'ghmac-utils.c',
|
||||||
|
'ghook.c',
|
||||||
|
'ghostutils.c',
|
||||||
|
'giochannel.c',
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
||||||
|
|
||||||
|
From 703e63f9d8b3ea4f26f41f0d2287b301025a73cc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Walters <walters@verbum.org>
|
||||||
|
Date: Fri, 7 Jun 2019 19:36:54 +0000
|
||||||
|
Subject: [PATCH 2/2] Add a gnutls backend for GHmac
|
||||||
|
|
||||||
|
For RHEL we want apps to use FIPS-certified crypto libraries,
|
||||||
|
and HMAC apparently counts as "keyed" and hence needs to
|
||||||
|
be validated.
|
||||||
|
|
||||||
|
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1630260
|
||||||
|
Replaces: https://gitlab.gnome.org/GNOME/glib/merge_requests/897
|
||||||
|
|
||||||
|
This is a build-time option that backs the GHmac API with GnuTLS.
|
||||||
|
Most distributors ship glib-networking built with GnuTLS, and
|
||||||
|
most apps use glib-networking, so this isn't a net-new library
|
||||||
|
in most cases.
|
||||||
|
|
||||||
|
mcatanzaro note: I've updated Colin's original patch to implement
|
||||||
|
g_hmac_copy() using gnutls_hmac_copy(), which didn't exist when Colin
|
||||||
|
developed this patch.
|
||||||
|
---
|
||||||
|
glib/gchecksum.c | 9 ++-
|
||||||
|
glib/gchecksumprivate.h | 32 ++++++++
|
||||||
|
glib/ghmac-gnutls.c | 164 ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
glib/ghmac.c | 3 +
|
||||||
|
glib/meson.build | 10 ++-
|
||||||
|
meson.build | 7 ++
|
||||||
|
meson_options.txt | 5 ++
|
||||||
|
7 files changed, 224 insertions(+), 6 deletions(-)
|
||||||
|
create mode 100644 glib/gchecksumprivate.h
|
||||||
|
create mode 100644 glib/ghmac-gnutls.c
|
||||||
|
|
||||||
|
diff --git a/glib/gchecksum.c b/glib/gchecksum.c
|
||||||
|
index f8a3f9ab8..b391a6264 100644
|
||||||
|
--- a/glib/gchecksum.c
|
||||||
|
+++ b/glib/gchecksum.c
|
||||||
|
@@ -20,7 +20,7 @@
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
-#include "gchecksum.h"
|
||||||
|
+#include "gchecksumprivate.h"
|
||||||
|
|
||||||
|
#include "gslice.h"
|
||||||
|
#include "gmem.h"
|
||||||
|
@@ -173,9 +173,9 @@ sha_byte_reverse (guint32 *buffer,
|
||||||
|
}
|
||||||
|
#endif /* G_BYTE_ORDER == G_BIG_ENDIAN */
|
||||||
|
|
||||||
|
-static gchar *
|
||||||
|
-digest_to_string (guint8 *digest,
|
||||||
|
- gsize digest_len)
|
||||||
|
+gchar *
|
||||||
|
+gchecksum_digest_to_string (guint8 *digest,
|
||||||
|
+ gsize digest_len)
|
||||||
|
{
|
||||||
|
gsize i, len = digest_len * 2;
|
||||||
|
gchar *retval;
|
||||||
|
@@ -194,6 +194,7 @@ digest_to_string (guint8 *digest,
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
+#define digest_to_string gchecksum_digest_to_string
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MD5 Checksum
|
||||||
|
diff --git a/glib/gchecksumprivate.h b/glib/gchecksumprivate.h
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000..86c7a3b61
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/glib/gchecksumprivate.h
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+/* gstdioprivate.h - Private GLib stdio functions
|
||||||
|
+ *
|
||||||
|
+ * Copyright 2017 Руслан Ижбулатов
|
||||||
|
+ *
|
||||||
|
+ * This library is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation; either
|
||||||
|
+ * version 2.1 of the License, or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * This library is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public License
|
||||||
|
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#ifndef __G_CHECKSUMPRIVATE_H__
|
||||||
|
+#define __G_CHECKSUMPRIVATE_H__
|
||||||
|
+
|
||||||
|
+#include "gchecksum.h"
|
||||||
|
+
|
||||||
|
+G_BEGIN_DECLS
|
||||||
|
+
|
||||||
|
+gchar *
|
||||||
|
+gchecksum_digest_to_string (guint8 *digest,
|
||||||
|
+ gsize digest_len);
|
||||||
|
+
|
||||||
|
+G_END_DECLS
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/glib/ghmac-gnutls.c b/glib/ghmac-gnutls.c
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000..f1a74a849
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/glib/ghmac-gnutls.c
|
||||||
|
@@ -0,0 +1,164 @@
|
||||||
|
+/* ghmac.h - data hashing functions
|
||||||
|
+ *
|
||||||
|
+ * Copyright (C) 2011 Collabora Ltd.
|
||||||
|
+ * Copyright (C) 2019 Red Hat, Inc.
|
||||||
|
+ *
|
||||||
|
+ * This library is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation; either
|
||||||
|
+ * version 2.1 of the License, or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * This library is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public License
|
||||||
|
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "config.h"
|
||||||
|
+
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <gnutls/crypto.h>
|
||||||
|
+
|
||||||
|
+#include "ghmac.h"
|
||||||
|
+
|
||||||
|
+#include "glib/galloca.h"
|
||||||
|
+#include "gatomic.h"
|
||||||
|
+#include "gslice.h"
|
||||||
|
+#include "gmem.h"
|
||||||
|
+#include "gstrfuncs.h"
|
||||||
|
+#include "gchecksumprivate.h"
|
||||||
|
+#include "gtestutils.h"
|
||||||
|
+#include "gtypes.h"
|
||||||
|
+#include "glibintl.h"
|
||||||
|
+
|
||||||
|
+#ifndef HAVE_GNUTLS
|
||||||
|
+#error "build configuration error"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+struct _GHmac
|
||||||
|
+{
|
||||||
|
+ int ref_count;
|
||||||
|
+ GChecksumType digest_type;
|
||||||
|
+ gnutls_hmac_hd_t hmac;
|
||||||
|
+ gchar *digest_str;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+GHmac *
|
||||||
|
+g_hmac_new (GChecksumType digest_type,
|
||||||
|
+ const guchar *key,
|
||||||
|
+ gsize key_len)
|
||||||
|
+{
|
||||||
|
+ gnutls_mac_algorithm_t algo;
|
||||||
|
+ GHmac *hmac = g_slice_new0 (GHmac);
|
||||||
|
+ hmac->ref_count = 1;
|
||||||
|
+ hmac->digest_type = digest_type;
|
||||||
|
+
|
||||||
|
+ switch (digest_type)
|
||||||
|
+ {
|
||||||
|
+ case G_CHECKSUM_MD5:
|
||||||
|
+ algo = GNUTLS_MAC_MD5;
|
||||||
|
+ break;
|
||||||
|
+ case G_CHECKSUM_SHA1:
|
||||||
|
+ algo = GNUTLS_MAC_SHA1;
|
||||||
|
+ break;
|
||||||
|
+ case G_CHECKSUM_SHA256:
|
||||||
|
+ algo = GNUTLS_MAC_SHA256;
|
||||||
|
+ break;
|
||||||
|
+ case G_CHECKSUM_SHA384:
|
||||||
|
+ algo = GNUTLS_MAC_SHA384;
|
||||||
|
+ break;
|
||||||
|
+ case G_CHECKSUM_SHA512:
|
||||||
|
+ algo = GNUTLS_MAC_SHA512;
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ g_return_val_if_reached (NULL);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ gnutls_hmac_init (&hmac->hmac, algo, key, key_len);
|
||||||
|
+
|
||||||
|
+ return hmac;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+GHmac *
|
||||||
|
+g_hmac_copy (const GHmac *hmac)
|
||||||
|
+{
|
||||||
|
+ GHmac *copy;
|
||||||
|
+
|
||||||
|
+ g_return_val_if_fail (hmac != NULL, NULL);
|
||||||
|
+
|
||||||
|
+ copy = g_slice_new0 (GHmac);
|
||||||
|
+ copy->ref_count = 1;
|
||||||
|
+ copy->digest_type = hmac->digest_type;
|
||||||
|
+ copy->hmac = gnutls_hmac_copy (hmac->hmac);
|
||||||
|
+
|
||||||
|
+ return copy;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+GHmac *
|
||||||
|
+g_hmac_ref (GHmac *hmac)
|
||||||
|
+{
|
||||||
|
+ g_return_val_if_fail (hmac != NULL, NULL);
|
||||||
|
+
|
||||||
|
+ g_atomic_int_inc (&hmac->ref_count);
|
||||||
|
+
|
||||||
|
+ return hmac;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+g_hmac_unref (GHmac *hmac)
|
||||||
|
+{
|
||||||
|
+ g_return_if_fail (hmac != NULL);
|
||||||
|
+
|
||||||
|
+ if (g_atomic_int_dec_and_test (&hmac->ref_count))
|
||||||
|
+ {
|
||||||
|
+ gnutls_hmac_deinit (hmac->hmac, NULL);
|
||||||
|
+ g_free (hmac->digest_str);
|
||||||
|
+ g_slice_free (GHmac, hmac);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+g_hmac_update (GHmac *hmac,
|
||||||
|
+ const guchar *data,
|
||||||
|
+ gssize length)
|
||||||
|
+{
|
||||||
|
+ g_return_if_fail (hmac != NULL);
|
||||||
|
+ g_return_if_fail (length == 0 || data != NULL);
|
||||||
|
+
|
||||||
|
+ gnutls_hmac (hmac->hmac, data, length);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+const gchar *
|
||||||
|
+g_hmac_get_string (GHmac *hmac)
|
||||||
|
+{
|
||||||
|
+ guint8 *buffer;
|
||||||
|
+ gsize digest_len;
|
||||||
|
+
|
||||||
|
+ g_return_val_if_fail (hmac != NULL, NULL);
|
||||||
|
+
|
||||||
|
+ if (hmac->digest_str)
|
||||||
|
+ return hmac->digest_str;
|
||||||
|
+
|
||||||
|
+ digest_len = g_checksum_type_get_length (hmac->digest_type);
|
||||||
|
+ buffer = g_alloca (digest_len);
|
||||||
|
+
|
||||||
|
+ gnutls_hmac_output (hmac->hmac, buffer);
|
||||||
|
+ hmac->digest_str = gchecksum_digest_to_string (buffer, digest_len);
|
||||||
|
+ return hmac->digest_str;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+g_hmac_get_digest (GHmac *hmac,
|
||||||
|
+ guint8 *buffer,
|
||||||
|
+ gsize *digest_len)
|
||||||
|
+{
|
||||||
|
+ g_return_if_fail (hmac != NULL);
|
||||||
|
+
|
||||||
|
+ gnutls_hmac_output (hmac->hmac, buffer);
|
||||||
|
+ *digest_len = g_checksum_type_get_length (hmac->digest_type);
|
||||||
|
+}
|
||||||
|
diff --git a/glib/ghmac.c b/glib/ghmac.c
|
||||||
|
index 4f181f21f..c62d9ce4e 100644
|
||||||
|
--- a/glib/ghmac.c
|
||||||
|
+++ b/glib/ghmac.c
|
||||||
|
@@ -33,6 +33,9 @@
|
||||||
|
#include "gtypes.h"
|
||||||
|
#include "glibintl.h"
|
||||||
|
|
||||||
|
+#ifdef HAVE_GNUTLS
|
||||||
|
+#error "build configuration error"
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:hmac
|
||||||
|
diff --git a/glib/meson.build b/glib/meson.build
|
||||||
|
index b3bf067c7..3cdc3b573 100644
|
||||||
|
--- a/glib/meson.build
|
||||||
|
+++ b/glib/meson.build
|
||||||
|
@@ -252,7 +252,6 @@ glib_sources = files(
|
||||||
|
'gfileutils.c',
|
||||||
|
'ggettext.c',
|
||||||
|
'ghash.c',
|
||||||
|
- 'ghmac.c',
|
||||||
|
'ghmac-utils.c',
|
||||||
|
'ghook.c',
|
||||||
|
'ghostutils.c',
|
||||||
|
@@ -308,6 +307,7 @@ glib_sources = files(
|
||||||
|
'guriprivate.h',
|
||||||
|
'gutils.c',
|
||||||
|
'gutilsprivate.h',
|
||||||
|
+ 'gchecksumprivate.h',
|
||||||
|
'guuid.c',
|
||||||
|
'gvariant.c',
|
||||||
|
'gvariant-core.c',
|
||||||
|
@@ -352,6 +352,12 @@ else
|
||||||
|
glib_dtrace_hdr = []
|
||||||
|
endif
|
||||||
|
|
||||||
|
+if get_option('gnutls')
|
||||||
|
+ glib_sources += files('ghmac-gnutls.c')
|
||||||
|
+else
|
||||||
|
+ glib_sources += files('ghmac.c')
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
pcre_static_args = []
|
||||||
|
|
||||||
|
if use_pcre_static_flag
|
||||||
|
@@ -378,7 +384,7 @@ libglib = library('glib-2.0',
|
||||||
|
# intl.lib is not compatible with SAFESEH
|
||||||
|
link_args : [noseh_link_args, glib_link_flags, win32_ldflags],
|
||||||
|
include_directories : configinc,
|
||||||
|
- dependencies : pcre_deps + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + gnulib_libm_dependency + [libsysprof_capture_dep],
|
||||||
|
+ dependencies : pcre_deps + libgnutls_dep + [thread_dep, librt] + libintl_deps + libiconv + platform_deps + gnulib_libm_dependency + [libsysprof_capture_dep],
|
||||||
|
c_args : glib_c_args,
|
||||||
|
objc_args : glib_c_args,
|
||||||
|
)
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index e0b308a25..70dd5355e 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -2056,6 +2056,13 @@ if host_system == 'linux'
|
||||||
|
glib_conf.set('HAVE_LIBMOUNT', libmount_dep.found())
|
||||||
|
endif
|
||||||
|
|
||||||
|
+# gnutls is used optionally by ghmac
|
||||||
|
+libgnutls_dep = []
|
||||||
|
+if get_option('gnutls')
|
||||||
|
+ libgnutls_dep = [dependency('gnutls', version : '>=3.6.9', required : true)]
|
||||||
|
+ glib_conf.set('HAVE_GNUTLS', 1)
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
if host_system == 'windows'
|
||||||
|
winsock2 = cc.find_library('ws2_32')
|
||||||
|
endif
|
||||||
|
diff --git a/meson_options.txt b/meson_options.txt
|
||||||
|
index af9645eda..2c4b2c37e 100644
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -34,6 +34,11 @@ option('libmount',
|
||||||
|
value : 'auto',
|
||||||
|
description : 'build with libmount support')
|
||||||
|
|
||||||
|
+option('gnutls',
|
||||||
|
+ type : 'boolean',
|
||||||
|
+ value : false,
|
||||||
|
+ description : 'build with gnutls support')
|
||||||
|
+
|
||||||
|
option('internal_pcre',
|
||||||
|
type : 'boolean',
|
||||||
|
value : false,
|
||||||
|
--
|
||||||
|
2.28.0
|
2
sources
2
sources
|
@ -1 +1 @@
|
||||||
a3bbee44a13facb5a3cab18be5ece14c glib-2.36.1.tar.xz
|
SHA512 (glib-2.67.0.tar.xz) = 82d562bc80885c7e516e38f17a8830596b32b1e1a4b58454ca589be79e6ab27e0a2fe0a108cb02da21981c75474abed0263c0aa38c71ead45a68db675a1d2f80
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
if test $# != 1; then
|
|
||||||
echo "usage: update-gio-modules host_triplet" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Warning: update-gio-modules is deprecated and will be removed in glib2-2.28.0"
|
|
||||||
|
|
||||||
umask 022
|
|
||||||
|
|
||||||
case "$host" in
|
|
||||||
alpha*|ia64*|powerpc64*|ppc64*|s390x*|sparc64*|x86_64*)
|
|
||||||
/usr/bin/gio-querymodules-64 /usr/lib64/gio/modules
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
/usr/bin/gio-querymodules-32 /usr/lib/gio/modules
|
|
||||||
;;
|
|
||||||
esac
|
|
Loading…
Reference in New Issue