aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2015-01-21 06:14:24 -0600
committerBrent Cook <busterb@gmail.com>2015-01-21 06:14:24 -0600
commita2233651277a50955cdc4c7810da7a12e4e33551 (patch)
tree5d48e874577eb6f0c955bfa6ddfdae04d13af406 /crypto
parentec81c28219b3d3234ddf0af12d0579efa1a3d2a6 (diff)
downloadportable-a2233651277a50955cdc4c7810da7a12e4e33551.tar.gz
portable-a2233651277a50955cdc4c7810da7a12e4e33551.tar.bz2
portable-a2233651277a50955cdc4c7810da7a12e4e33551.zip
add NetBSD shims for arc4random
The current NetBSD release, 6.1.5, fails to reseed arc4random fork. Work around it by providing arc4random/getentropy shims. Revisit when NetBSD 7 is available.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/Makefile.am18
-rw-r--r--crypto/compat/arc4random.h3
2 files changed, 14 insertions, 7 deletions
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index 9f5311a..10dd63d 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -74,9 +74,15 @@ if !HAVE_GETENTROPY
74if HOST_FREEBSD 74if HOST_FREEBSD
75libcompat_la_SOURCES += compat/getentropy_freebsd.c 75libcompat_la_SOURCES += compat/getentropy_freebsd.c
76endif 76endif
77if HOST_HPUX
78libcompat_la_SOURCES += compat/getentropy_hpux.c
79endif
77if HOST_LINUX 80if HOST_LINUX
78libcompat_la_SOURCES += compat/getentropy_linux.c 81libcompat_la_SOURCES += compat/getentropy_linux.c
79endif 82endif
83if HOST_NETBSD
84libcompat_la_SOURCES += compat/getentropy_netbsd.c
85endif
80if HOST_DARWIN 86if HOST_DARWIN
81libcompat_la_SOURCES += compat/getentropy_osx.c 87libcompat_la_SOURCES += compat/getentropy_osx.c
82endif 88endif
@@ -86,9 +92,6 @@ endif
86if HOST_WIN 92if HOST_WIN
87libcompat_la_SOURCES += compat/getentropy_win.c 93libcompat_la_SOURCES += compat/getentropy_win.c
88endif 94endif
89if HOST_HPUX
90libcompat_la_SOURCES += compat/getentropy_hpux.c
91endif
92endif 95endif
93 96
94endif 97endif
@@ -97,22 +100,23 @@ if !HAVE_ISSETUGID
97if HOST_LINUX 100if HOST_LINUX
98libcompat_la_SOURCES += compat/issetugid_linux.c 101libcompat_la_SOURCES += compat/issetugid_linux.c
99endif 102endif
100if HOST_WIN
101libcompat_la_SOURCES += compat/issetugid_win.c
102endif
103if HOST_HPUX 103if HOST_HPUX
104libcompat_la_SOURCES += compat/issetugid_hpux.c 104libcompat_la_SOURCES += compat/issetugid_hpux.c
105endif 105endif
106if HOST_WIN
107libcompat_la_SOURCES += compat/issetugid_win.c
108endif
106endif 109endif
107 110
108noinst_HEADERS = 111noinst_HEADERS =
109noinst_HEADERS += compat/arc4random.h 112noinst_HEADERS += compat/arc4random.h
110noinst_HEADERS += compat/arc4random_freebsd.h 113noinst_HEADERS += compat/arc4random_freebsd.h
114noinst_HEADERS += compat/arc4random_hpux.h
111noinst_HEADERS += compat/arc4random_linux.h 115noinst_HEADERS += compat/arc4random_linux.h
116noinst_HEADERS += compat/arc4random_netbsd.h
112noinst_HEADERS += compat/arc4random_osx.h 117noinst_HEADERS += compat/arc4random_osx.h
113noinst_HEADERS += compat/arc4random_solaris.h 118noinst_HEADERS += compat/arc4random_solaris.h
114noinst_HEADERS += compat/arc4random_win.h 119noinst_HEADERS += compat/arc4random_win.h
115noinst_HEADERS += compat/arc4random_hpux.h
116noinst_HEADERS += compat/chacha_private.h 120noinst_HEADERS += compat/chacha_private.h
117 121
118libcrypto_la_SOURCES = 122libcrypto_la_SOURCES =
diff --git a/crypto/compat/arc4random.h b/crypto/compat/arc4random.h
index ed812ba..ce1bbea 100644
--- a/crypto/compat/arc4random.h
+++ b/crypto/compat/arc4random.h
@@ -12,6 +12,9 @@
12#elif defined(__linux__) 12#elif defined(__linux__)
13#include "arc4random_linux.h" 13#include "arc4random_linux.h"
14 14
15#elif defined(__NetBSD__)
16#include "arc4random_netbsd.h"
17
15#elif defined(__APPLE__) 18#elif defined(__APPLE__)
16#include "arc4random_osx.h" 19#include "arc4random_osx.h"
17 20