diff options
author | Brent Cook <busterb@gmail.com> | 2015-01-21 06:14:24 -0600 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2015-01-21 06:14:24 -0600 |
commit | a2233651277a50955cdc4c7810da7a12e4e33551 (patch) | |
tree | 5d48e874577eb6f0c955bfa6ddfdae04d13af406 /crypto | |
parent | ec81c28219b3d3234ddf0af12d0579efa1a3d2a6 (diff) | |
download | portable-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.am | 18 | ||||
-rw-r--r-- | crypto/compat/arc4random.h | 3 |
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 | |||
74 | if HOST_FREEBSD | 74 | if HOST_FREEBSD |
75 | libcompat_la_SOURCES += compat/getentropy_freebsd.c | 75 | libcompat_la_SOURCES += compat/getentropy_freebsd.c |
76 | endif | 76 | endif |
77 | if HOST_HPUX | ||
78 | libcompat_la_SOURCES += compat/getentropy_hpux.c | ||
79 | endif | ||
77 | if HOST_LINUX | 80 | if HOST_LINUX |
78 | libcompat_la_SOURCES += compat/getentropy_linux.c | 81 | libcompat_la_SOURCES += compat/getentropy_linux.c |
79 | endif | 82 | endif |
83 | if HOST_NETBSD | ||
84 | libcompat_la_SOURCES += compat/getentropy_netbsd.c | ||
85 | endif | ||
80 | if HOST_DARWIN | 86 | if HOST_DARWIN |
81 | libcompat_la_SOURCES += compat/getentropy_osx.c | 87 | libcompat_la_SOURCES += compat/getentropy_osx.c |
82 | endif | 88 | endif |
@@ -86,9 +92,6 @@ endif | |||
86 | if HOST_WIN | 92 | if HOST_WIN |
87 | libcompat_la_SOURCES += compat/getentropy_win.c | 93 | libcompat_la_SOURCES += compat/getentropy_win.c |
88 | endif | 94 | endif |
89 | if HOST_HPUX | ||
90 | libcompat_la_SOURCES += compat/getentropy_hpux.c | ||
91 | endif | ||
92 | endif | 95 | endif |
93 | 96 | ||
94 | endif | 97 | endif |
@@ -97,22 +100,23 @@ if !HAVE_ISSETUGID | |||
97 | if HOST_LINUX | 100 | if HOST_LINUX |
98 | libcompat_la_SOURCES += compat/issetugid_linux.c | 101 | libcompat_la_SOURCES += compat/issetugid_linux.c |
99 | endif | 102 | endif |
100 | if HOST_WIN | ||
101 | libcompat_la_SOURCES += compat/issetugid_win.c | ||
102 | endif | ||
103 | if HOST_HPUX | 103 | if HOST_HPUX |
104 | libcompat_la_SOURCES += compat/issetugid_hpux.c | 104 | libcompat_la_SOURCES += compat/issetugid_hpux.c |
105 | endif | 105 | endif |
106 | if HOST_WIN | ||
107 | libcompat_la_SOURCES += compat/issetugid_win.c | ||
108 | endif | ||
106 | endif | 109 | endif |
107 | 110 | ||
108 | noinst_HEADERS = | 111 | noinst_HEADERS = |
109 | noinst_HEADERS += compat/arc4random.h | 112 | noinst_HEADERS += compat/arc4random.h |
110 | noinst_HEADERS += compat/arc4random_freebsd.h | 113 | noinst_HEADERS += compat/arc4random_freebsd.h |
114 | noinst_HEADERS += compat/arc4random_hpux.h | ||
111 | noinst_HEADERS += compat/arc4random_linux.h | 115 | noinst_HEADERS += compat/arc4random_linux.h |
116 | noinst_HEADERS += compat/arc4random_netbsd.h | ||
112 | noinst_HEADERS += compat/arc4random_osx.h | 117 | noinst_HEADERS += compat/arc4random_osx.h |
113 | noinst_HEADERS += compat/arc4random_solaris.h | 118 | noinst_HEADERS += compat/arc4random_solaris.h |
114 | noinst_HEADERS += compat/arc4random_win.h | 119 | noinst_HEADERS += compat/arc4random_win.h |
115 | noinst_HEADERS += compat/arc4random_hpux.h | ||
116 | noinst_HEADERS += compat/chacha_private.h | 120 | noinst_HEADERS += compat/chacha_private.h |
117 | 121 | ||
118 | libcrypto_la_SOURCES = | 122 | libcrypto_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 | ||