From 091c817631bf3246aae7ea0bd8617cf5c7473d40 Mon Sep 17 00:00:00 2001 From: Stuart D. Gathman Date: Aug 06 2019 22:48:52 +0000 Subject: Preserve getrandom method when removing sysctl calls. --- diff --git a/cjdns.spec b/cjdns.spec index 03909d7..03f5fe2 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -80,7 +80,7 @@ Name: cjdns # major version is cjdns protocol version: Version: 20.3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: The privacy-friendly network without borders # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC # cnacl is unused except when use_embedded is true diff --git a/cjdns.sysctl.patch b/cjdns.sysctl.patch index 227be46..c8ecc79 100644 --- a/cjdns.sysctl.patch +++ b/cjdns.sysctl.patch @@ -1,11 +1,34 @@ -diff -up ./crypto/random/seed/SystemRandomSeed.c.sysctl ./crypto/random/seed/SystemRandomSeed.c ---- ./crypto/random/seed/SystemRandomSeed.c.sysctl 2019-08-06 12:28:23.084611733 -0400 -+++ ./crypto/random/seed/SystemRandomSeed.c 2019-08-06 12:28:36.864803551 -0400 -@@ -19,7 +19,6 @@ - #include "crypto/random/seed/RtlGenRandomSeed.h" - #include "crypto/random/seed/BsdKernArndSysctlRandomSeed.h" - #include "crypto/random/seed/DevUrandomRandomSeed.h" --#include "crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.h" - #include "crypto/random/seed/ProcSysKernelRandomUuidRandomSeed.h" - #include "crypto/random/seed/GetEntropyRandomSeed.h" - #include "crypto/random/seed/SystemRandomSeed.h" +diff -up ./crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.c.sysctl ./crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.c +--- ./crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.c.sysctl 2019-08-06 18:33:43.271999689 -0400 ++++ ./crypto/random/seed/LinuxRandomUuidSysctlRandomSeed.c 2019-08-06 18:34:21.804537236 -0400 +@@ -20,6 +20,7 @@ + + #include + #include ++#ifndef SYS_getrandom + #include + + static int getUUID(uint64_t output[2]) +@@ -35,6 +36,7 @@ static int getUUID(uint64_t output[2]) + } + return 0; + } ++#endif + + static int get(struct RandomSeed* randomSeed, uint64_t output[8]) + { +@@ -48,11 +50,13 @@ static int get(struct RandomSeed* random + if (ret == 64 && !Bits_isZero(output, 64)) { + return 0; + } +-#endif ++ return -1; ++#else + if (getUUID(output) || getUUID(output+2) || getUUID(output+4) || getUUID(output+6)) { + return -1; + } + return 0; ++#endif + } + + struct RandomSeed* LinuxRandomUuidSysctlRandomSeed_new(struct Allocator* alloc)