diff options
author | Brent Cook <busterb@gmail.com> | 2015-02-14 20:03:39 -0600 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2015-02-14 20:03:39 -0600 |
commit | ad7ac48d030b5ba7b8449bf3621b817affe3190f (patch) | |
tree | 5cf7743e8f68f5a5613653e66ec5212254002a71 | |
parent | 28311d4355e38376dc7ebcf1d2d7957718f55359 (diff) | |
download | portable-ad7ac48d030b5ba7b8449bf3621b817affe3190f.tar.gz portable-ad7ac48d030b5ba7b8449bf3621b817affe3190f.tar.bz2 portable-ad7ac48d030b5ba7b8449bf3621b817affe3190f.zip |
add strsep fallback for libtls
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | include/string.h | 4 | ||||
-rw-r--r-- | tls/Makefile.am | 5 | ||||
-rwxr-xr-x | update.sh | 6 |
4 files changed, 16 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 2f86fbd..46e9a40 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -196,7 +196,7 @@ LDFLAGS="$LDFLAGS $CLANG_FLAGS" | |||
196 | 196 | ||
197 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) | 197 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) |
198 | AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) | 198 | AC_CHECK_FUNCS([getentropy issetugid memmem poll reallocarray]) |
199 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum]) | 199 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) |
200 | AC_CHECK_FUNCS([symlink openat]) | 200 | AC_CHECK_FUNCS([symlink openat]) |
201 | AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp]) | 201 | AC_CHECK_FUNCS([timingsafe_bcmp timingsafe_memcmp]) |
202 | 202 | ||
@@ -213,6 +213,7 @@ AM_CONDITIONAL([HAVE_STRLCAT], [test "x$ac_cv_func_strlcat" = xyes]) | |||
213 | AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes]) | 213 | AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes]) |
214 | AM_CONDITIONAL([HAVE_STRNDUP], [test "x$ac_cv_func_strndup" = xyes]) | 214 | AM_CONDITIONAL([HAVE_STRNDUP], [test "x$ac_cv_func_strndup" = xyes]) |
215 | AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes]) | 215 | AM_CONDITIONAL([HAVE_STRNLEN], [test "x$ac_cv_func_strnlen" = xyes]) |
216 | AM_CONDITIONAL([HAVE_STRSEP], [test "x$ac_cv_func_strsep" = xyes]) | ||
216 | AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) | 217 | AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) |
217 | AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes]) | 218 | AM_CONDITIONAL([HAVE_TIMINGSAFE_BCMP], [test "x$ac_cv_func_timingsafe_bcmp" = xyes]) |
218 | AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes]) | 219 | AM_CONDITIONAL([HAVE_TIMINGSAFE_MEMCMP], [test "x$ac_cv_func_timingsafe_memcmp" = xyes]) |
diff --git a/include/string.h b/include/string.h index c558a90..05d1ffc 100644 --- a/include/string.h +++ b/include/string.h | |||
@@ -33,6 +33,10 @@ size_t strnlen(const char *str, size_t maxlen); | |||
33 | #endif | 33 | #endif |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #ifndef HAVE_STRSEP | ||
37 | char *strsep(char **stringp, const char *delim); | ||
38 | #endif | ||
39 | |||
36 | #ifndef HAVE_EXPLICIT_BZERO | 40 | #ifndef HAVE_EXPLICIT_BZERO |
37 | void explicit_bzero(void *, size_t); | 41 | void explicit_bzero(void *, size_t); |
38 | #endif | 42 | #endif |
diff --git a/tls/Makefile.am b/tls/Makefile.am index 8a88632..f0919a5 100644 --- a/tls/Makefile.am +++ b/tls/Makefile.am | |||
@@ -16,4 +16,9 @@ libtls_la_SOURCES += tls_server.c | |||
16 | libtls_la_SOURCES += tls_util.c | 16 | libtls_la_SOURCES += tls_util.c |
17 | libtls_la_SOURCES += tls_verify.c | 17 | libtls_la_SOURCES += tls_verify.c |
18 | noinst_HEADERS = tls_internal.h | 18 | noinst_HEADERS = tls_internal.h |
19 | |||
20 | if !HAVE_STRSEP | ||
21 | libtls_la_SOURCES += strsep.c | ||
22 | endif | ||
23 | |||
19 | endif | 24 | endif |
@@ -168,7 +168,11 @@ done | |||
168 | echo copying libtls source | 168 | echo copying libtls source |
169 | rm -f tls/*.c tls/*.h | 169 | rm -f tls/*.c tls/*.h |
170 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do | 170 | for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do |
171 | $CP $libtls_src/$i tls | 171 | if [ -e $libtls_src/$i ]; then |
172 | $CP $libtls_src/$i tls | ||
173 | else | ||
174 | $CP $libc_src/string/$i tls | ||
175 | fi | ||
172 | done | 176 | done |
173 | 177 | ||
174 | # copy openssl(1) source | 178 | # copy openssl(1) source |