- update to epiphany-3.36.3
- rework patch to use getentropy instead of reverting to an older commit
This commit is contained in:
parent
743fc2f7b1
commit
c7197d64f9
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.192 2020/05/30 12:52:00 jasper Exp $
|
||||
# $OpenBSD: Makefile,v 1.193 2020/07/03 07:21:39 jasper Exp $
|
||||
|
||||
COMMENT= GNOME web browser based on webkit
|
||||
|
||||
GNOME_PROJECT= epiphany
|
||||
GNOME_VERSION= 3.36.2
|
||||
GNOME_VERSION= 3.36.3
|
||||
|
||||
CATEGORIES= www
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (epiphany-3.36.2.tar.xz) = wuZ2qg/iEYCaXn6KfkYdGCiQ8lPFP0YQ8mEAlLb7+14=
|
||||
SIZE (epiphany-3.36.2.tar.xz) = 5811004
|
||||
SHA256 (epiphany-3.36.3.tar.xz) = YhtWJjdIkXaa/snDWUarbDkQ6pz5okmLqxZsmb2R4W8=
|
||||
SIZE (epiphany-3.36.3.tar.xz) = 5812928
|
||||
|
@ -1,52 +1,29 @@
|
||||
$OpenBSD: patch-lib_ephy-sync-utils_c,v 1.1 2020/05/14 15:03:33 jasper Exp $
|
||||
|
||||
Revert back to /dev/urandom; should probably use arc4random_buf(3).
|
||||
$OpenBSD: patch-lib_ephy-sync-utils_c,v 1.2 2020/07/03 07:21:39 jasper Exp $
|
||||
|
||||
Index: lib/ephy-sync-utils.c
|
||||
--- lib/ephy-sync-utils.c.orig
|
||||
+++ lib/ephy-sync-utils.c
|
||||
@@ -23,14 +23,12 @@
|
||||
|
||||
#include "ephy-settings.h"
|
||||
|
||||
-#include <errno.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <inttypes.h>
|
||||
#include <json-glib/json-glib.h>
|
||||
@@ -30,7 +30,11 @@
|
||||
#include <libsoup/soup.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
-#include <sys/random.h>
|
||||
+#if defined(__linux__)
|
||||
#include <sys/random.h>
|
||||
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
+#include <unistd.h>
|
||||
+#endif
|
||||
|
||||
static const char hex_digits[] = "0123456789abcdef";
|
||||
|
||||
@@ -167,24 +165,21 @@ ephy_sync_utils_base64_urlsafe_decode (const char *tex
|
||||
* 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 use random_ctx.
|
||||
+ * We don't really use random_ctx, since we have /dev/urandom available.
|
||||
*/
|
||||
void
|
||||
ephy_sync_utils_generate_random_bytes (void *random_ctx,
|
||||
gsize num_bytes,
|
||||
guint8 *out)
|
||||
{
|
||||
- gssize ret;
|
||||
+ FILE *fp;
|
||||
|
||||
@@ -179,6 +183,11 @@ ephy_sync_utils_generate_random_bytes (void *random_
|
||||
g_assert (num_bytes > 0);
|
||||
g_assert (out);
|
||||
|
||||
- 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));
|
||||
+ fp = fopen ("/dev/urandom", "r");
|
||||
+ fread (out, sizeof (guint8), num_bytes, fp);
|
||||
+ fclose (fp);
|
||||
}
|
||||
|
||||
char *
|
||||
+#ifdef __OpenBSD__
|
||||
+ if (getentropy (out, num_bytes) == -1) {
|
||||
+ g_error ("Failed to get entropy: %s", g_strerror (errno));
|
||||
+ }
|
||||
+#else
|
||||
do {
|
||||
ret = getrandom (out, num_bytes, 0);
|
||||
} while (ret < (gssize)num_bytes && errno == EINTR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user