diff options
author | Brent Cook <bcook@openbsd.org> | 2017-03-16 18:53:12 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2017-03-16 18:53:12 -0500 |
commit | 8622dc7536040a041d709a7d2e6717735c84e4da (patch) | |
tree | 84527ca95ea5d5cedc9175a331e7dbe283091058 | |
parent | 27f08790305216e5730c5bb5352db9f616c4c56f (diff) | |
parent | 5297e9d486d4c0119e697d80eb53c8ef298f0bd7 (diff) | |
download | portable-8622dc7536040a041d709a7d2e6717735c84e4da.tar.gz portable-8622dc7536040a041d709a7d2e6717735c84e4da.tar.bz2 portable-8622dc7536040a041d709a7d2e6717735c84e4da.zip |
Land #288, update conditions under which getentropy, arc4random* are exported
-rw-r--r-- | crypto/CMakeLists.txt | 7 | ||||
-rw-r--r-- | m4/check-libc.m4 | 12 |
2 files changed, 6 insertions, 13 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 99670f8..47f0077 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -737,8 +737,10 @@ endif() | |||
737 | 737 | ||
738 | if(NOT HAVE_ARC4RANDOM_BUF) | 738 | if(NOT HAVE_ARC4RANDOM_BUF) |
739 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c) | 739 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c) |
740 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c) | ||
740 | set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random) | 741 | set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random) |
741 | set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_buf) | 742 | set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_buf) |
743 | set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform) | ||
742 | 744 | ||
743 | if(NOT HAVE_GETENTROPY) | 745 | if(NOT HAVE_GETENTROPY) |
744 | if(CMAKE_HOST_WIN32) | 746 | if(CMAKE_HOST_WIN32) |
@@ -762,11 +764,6 @@ if(NOT HAVE_ARC4RANDOM_BUF) | |||
762 | endif() | 764 | endif() |
763 | endif() | 765 | endif() |
764 | 766 | ||
765 | if(NOT HAVE_ARC4RANDOM_UNIFORM) | ||
766 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c) | ||
767 | set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform) | ||
768 | endif() | ||
769 | |||
770 | if(NOT HAVE_TIMINGSAFE_BCMP) | 767 | if(NOT HAVE_TIMINGSAFE_BCMP) |
771 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c) | 768 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c) |
772 | set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_bcmp) | 769 | set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_bcmp) |
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index c66364e..53ffce6 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 | |||
@@ -152,14 +152,13 @@ echo "generating $crypto_p_sym ..." | |||
152 | chmod u+w $srcdir/crypto | 152 | chmod u+w $srcdir/crypto |
153 | cp $crypto_sym $crypto_p_sym | 153 | cp $crypto_sym $crypto_p_sym |
154 | chmod u+w $crypto_p_sym | 154 | chmod u+w $crypto_p_sym |
155 | if test "x$ac_cv_func_arc4random" = "xno" ; then | ||
156 | echo arc4random >> $crypto_p_sym | ||
157 | fi | ||
158 | if test "x$ac_cv_func_arc4random_buf" = "xno" ; then | 155 | if test "x$ac_cv_func_arc4random_buf" = "xno" ; then |
156 | echo arc4random >> $crypto_p_sym | ||
159 | echo arc4random_buf >> $crypto_p_sym | 157 | echo arc4random_buf >> $crypto_p_sym |
160 | fi | ||
161 | if test "x$ac_cv_func_arc4random_uniform" = "xno" ; then | ||
162 | echo arc4random_uniform >> $crypto_p_sym | 158 | echo arc4random_uniform >> $crypto_p_sym |
159 | if test "x$ac_cv_func_getentropy" = "xno" ; then | ||
160 | echo getentropy >> $crypto_p_sym | ||
161 | fi | ||
163 | fi | 162 | fi |
164 | if test "x$ac_cv_func_asprintf" = "xno" ; then | 163 | if test "x$ac_cv_func_asprintf" = "xno" ; then |
165 | echo asprintf >> $crypto_p_sym | 164 | echo asprintf >> $crypto_p_sym |
@@ -168,9 +167,6 @@ fi | |||
168 | if test "x$ac_cv_func_explicit_bzero" = "xno" ; then | 167 | if test "x$ac_cv_func_explicit_bzero" = "xno" ; then |
169 | echo explicit_bzero >> $crypto_p_sym | 168 | echo explicit_bzero >> $crypto_p_sym |
170 | fi | 169 | fi |
171 | if test "x$ac_cv_func_getentropy" = "xno" ; then | ||
172 | echo getentropy >> $crypto_p_sym | ||
173 | fi | ||
174 | if test "x$ac_cv_func_inet_pton" = "xno" ; then | 170 | if test "x$ac_cv_func_inet_pton" = "xno" ; then |
175 | echo inet_pton >> $crypto_p_sym | 171 | echo inet_pton >> $crypto_p_sym |
176 | fi | 172 | fi |