Hello community,

here is the log from the commit of package epiphany for openSUSE:Factory 
checked in at 2020-01-24 13:10:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/epiphany (Old)
 and      /work/SRC/openSUSE:Factory/.epiphany.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "epiphany"

Fri Jan 24 13:10:48 2020 rev:172 rq:766615 version:3.34.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/epiphany/epiphany.changes        2020-01-07 
23:52:16.827997892 +0100
+++ /work/SRC/openSUSE:Factory/.epiphany.new.26092/epiphany.changes     
2020-01-24 13:12:11.789457972 +0100
@@ -1,0 +2,9 @@
+Thu Jan 23 09:48:38 UTC 2020 - Bjørn Lie <bjorn....@gmail.com>
+
+- Add backported patch from upstream: 
+  epiphany-fix-compile-warning.patch: sync-utils: use getrandom()
+  to generate randomness.
+- Drop epiphany-lang Recommends: No longer needed, lang
+  supplements will take care of it.
+
+-------------------------------------------------------------------

New:
----
  epiphany-fix-compile-warning.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ epiphany.spec ++++++
--- /var/tmp/diff_new_pack.w7DCVB/_old  2020-01-24 13:12:12.521458266 +0100
+++ /var/tmp/diff_new_pack.w7DCVB/_new  2020-01-24 13:12:12.521458266 +0100
@@ -25,6 +25,8 @@
 URL:            https://wiki.gnome.org/Apps/Web
 Source0:        
https://download.gnome.org/sources/epiphany/3.34/%{name}-%{version}.tar.xz
 Source99:       %{name}-rpmlintrc
+# PATCH-FIX-UPSTREAM epiphany-fix-compile-warning.patch -- sync-utils: use 
getrandom() to generate randomness
+Patch0:         epiphany-fix-compile-warning.patch
 
 BuildRequires:  fdupes
 BuildRequires:  meson >= 0.42.0
@@ -58,7 +60,6 @@
 BuildRequires:  pkgconfig(webkit2gtk-web-extension-4.0) >= 2.25.1
 Requires:       %{name}-branding = %{version}
 Requires:       iso-codes
-Recommends:     %{name}-lang
 Recommends:     ca-certificates
 
 %description

++++++ epiphany-fix-compile-warning.patch ++++++
>From 929f8f4d9e89c7751e6a6f15c1915349a2851c97 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanz...@gnome.org>
Date: Wed, 22 Jan 2020 16:11:58 -0600
Subject: [PATCH] sync-utils: use getrandom() to generate randomness

GCC complains that we ignore the return value from fread(), which is
important for error checking.

This is easy to fix, but might as well switch to getrandom() while we're
at it, since this is the nice/modern way to get randomness.

Note: requires glibc 2.25 or a newish FreeBSD.
---
 lib/ephy-sync-utils.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lib/ephy-sync-utils.c b/lib/ephy-sync-utils.c
index 6c8a37a85..4ae56220b 100644
--- a/lib/ephy-sync-utils.c
+++ b/lib/ephy-sync-utils.c
@@ -23,12 +23,14 @@
 
 #include "ephy-settings.h"
 
+#include <errno.h>
 #include <glib/gi18n.h>
 #include <inttypes.h>
 #include <json-glib/json-glib.h>
 #include <libsoup/soup.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/random.h>
 
 static const char hex_digits[] = "0123456789abcdef";
 
@@ -165,21 +167,24 @@ ephy_sync_utils_base64_urlsafe_decode (const char *text,
  * This is mainly required by Nettle's RSA support.
  * From Nettle's documentation: random_ctx and random is a randomness 
generator.
  * random(random_ctx, length, dst) should generate length random octets and 
store them at dst.
- * We don't really use random_ctx, since we have /dev/urandom available.
+ * We don't use random_ctx.
  */
 void
 ephy_sync_utils_generate_random_bytes (void   *random_ctx,
                                        gsize   num_bytes,
                                        guint8 *out)
 {
-  FILE *fp;
+  gssize ret;
 
   g_assert (num_bytes > 0);
   g_assert (out);
 
-  fp = fopen ("/dev/urandom", "r");
-  fread (out, sizeof (guint8), num_bytes, fp);
-  fclose (fp);
+  do {
+    ret = getrandom (out, num_bytes, 0);
+  } while (ret < (gssize)num_bytes && errno == EINTR);
+
+  if (ret != (gssize)num_bytes)
+    g_error ("Failed to generate randomness: %s", g_strerror (errno));
 }
 
 char *
-- 
2.24.1


Reply via email to