Fix static overriding global in crypto/random/seed/GetEntropyRandomSeed.c

This commit is contained in:
Stuart D. Gathman 2017-01-14 13:47:49 -05:00
parent 3e280ce60f
commit 27c8f5913d
2 changed files with 33 additions and 0 deletions

30
cjdns.errors.patch Normal file
View File

@ -0,0 +1,30 @@
diff -up ./crypto/random/seed/GetEntropyRandomSeed.c.errors ./crypto/random/seed/GetEntropyRandomSeed.c
--- ./crypto/random/seed/GetEntropyRandomSeed.c.errors 2017-01-14 13:42:22.043640582 -0500
+++ ./crypto/random/seed/GetEntropyRandomSeed.c 2017-01-14 13:43:01.482108873 -0500
@@ -22,7 +22,8 @@
#include <sys/syscall.h>
#ifndef __OPENBSD__
-static int getentropy(void *buf, size_t buflen)
+/* NOTE: getentropy() is already defined in unistd.h */
+static int get_entropy(void *buf, size_t buflen)
{
int ret;
@@ -48,7 +49,7 @@ static int getentropy(void *buf, size_t
static int get(struct RandomSeed* randomSeed, uint64_t output[8])
{
- if (getentropy(output, 64) < 0) {
+ if (get_entropy(output, 64) < 0) {
return -1;
} else {
return 0;
@@ -59,6 +60,6 @@ struct RandomSeed* GetEntropyRandomSeed_
{
return Allocator_clone(alloc, (&(struct RandomSeed) {
.get = get,
- .name = "getentropy(2)"
+ .name = "get_entropy(2)"
}));
}

View File

@ -92,6 +92,8 @@ Patch11: cjdns.sodium.patch
Patch12: cjdns.sign.patch
# Recognize ppc64, ppc64le, and s390x arches
Patch13: cjdns.ppc64.patch
# Fix C coding errors
Patch14: cjdns.errors.patch
BuildRequires: nodejs, nodejs-ronn, python2
@ -206,6 +208,7 @@ fi
%patch9 -b .man
%patch10 -b .tools
%patch13 -b .ppc64
%patch14 -b .errors
cp %{SOURCE1} README_Fedora.md