aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--configure.ac.tpl5
-rw-r--r--crypto/Makefile.am.tpl5
-rw-r--r--include/string.h4
-rwxr-xr-xupdate.sh2
5 files changed, 17 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 7578eee..26f2783 100644
--- a/.gitignore
+++ b/.gitignore
@@ -108,6 +108,8 @@ crypto/compat/getentropy_*.c
108crypto/compat/reallocarray.c 108crypto/compat/reallocarray.c
109crypto/compat/strlcat.c 109crypto/compat/strlcat.c
110crypto/compat/strlcpy.c 110crypto/compat/strlcpy.c
111crypto/compat/strndup.c
112crypto/compat/strnlen.c
111crypto/compat/strtonum.c 113crypto/compat/strtonum.c
112crypto/compat/timingsafe_bcmp.c 114crypto/compat/timingsafe_bcmp.c
113crypto/compat/timingsafe_memcmp.c 115crypto/compat/timingsafe_memcmp.c
diff --git a/configure.ac.tpl b/configure.ac.tpl
index 8e85e9b..61476cf 100644
--- a/configure.ac.tpl
+++ b/configure.ac.tpl
@@ -64,6 +64,11 @@ AC_CHECK_FUNC(strlcat,[AC_SEARCH_LIBS(strlcat,, [NO_STRLCAT=],
64AC_SUBST(NO_STRLCAT) 64AC_SUBST(NO_STRLCAT)
65AM_CONDITIONAL(NO_STRLCAT, test "x$NO_STRLCAT" = "xyes") 65AM_CONDITIONAL(NO_STRLCAT, test "x$NO_STRLCAT" = "xyes")
66 66
67AC_CHECK_FUNC(strndup,[AC_SEARCH_LIBS(strndup,, [NO_STRNDUP=],
68 [NO_STRNDUP=yes])], [NO_STRNDUP=yes])
69AC_SUBST(NO_STRNDUP)
70AM_CONDITIONAL(NO_STRNDUP, test "x$NO_STRNDUP" = "xyes")
71
67AC_CHECK_FUNC(reallocarray,[AC_SEARCH_LIBS(reallocarray,, [NO_REALLOCARRAY=], 72AC_CHECK_FUNC(reallocarray,[AC_SEARCH_LIBS(reallocarray,, [NO_REALLOCARRAY=],
68 [NO_REALLOCARRAY=yes])], [NO_REALLOCARRAY=yes]) 73 [NO_REALLOCARRAY=yes])], [NO_REALLOCARRAY=yes])
69AC_SUBST(NO_REALLOCARRAY) 74AC_SUBST(NO_REALLOCARRAY)
diff --git a/crypto/Makefile.am.tpl b/crypto/Makefile.am.tpl
index a29e07f..6ac6c4f 100644
--- a/crypto/Makefile.am.tpl
+++ b/crypto/Makefile.am.tpl
@@ -33,6 +33,11 @@ if NO_STRLCPY
33libcompat_la_SOURCES += compat/strlcpy.c 33libcompat_la_SOURCES += compat/strlcpy.c
34endif 34endif
35 35
36if NO_STRNDUP
37libcompat_la_SOURCES += compat/strndup.c
38libcompat_la_SOURCES += compat/strnlen.c
39endif
40
36if NO_REALLOCARRAY 41if NO_REALLOCARRAY
37libcompat_la_SOURCES += compat/reallocarray.c 42libcompat_la_SOURCES += compat/reallocarray.c
38endif 43endif
diff --git a/include/string.h b/include/string.h
index 6277247..cd3430a 100644
--- a/include/string.h
+++ b/include/string.h
@@ -16,6 +16,10 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
16 16
17size_t strlcat(char *dst, const char *src, size_t siz); 17size_t strlcat(char *dst, const char *src, size_t siz);
18 18
19char * strndup(const char *str, size_t maxlen);
20
21size_t strnlen(const char *str, size_t maxlen);
22
19void explicit_bzero(void *, size_t); 23void explicit_bzero(void *, size_t);
20 24
21int timingsafe_bcmp(const void *b1, const void *b2, size_t n); 25int timingsafe_bcmp(const void *b1, const void *b2, size_t n);
diff --git a/update.sh b/update.sh
index 290e06d..30c2286 100755
--- a/update.sh
+++ b/update.sh
@@ -64,7 +64,7 @@ $CP $libssl_src/src/crypto/opensslfeatures.h include/openssl
64$CP $libssl_src/src/e_os2.h include/openssl 64$CP $libssl_src/src/e_os2.h include/openssl
65$CP $libssl_src/src/ssl/pqueue.h include 65$CP $libssl_src/src/ssl/pqueue.h include
66 66
67for i in explicit_bzero.c strlcpy.c strlcat.c timingsafe_bcmp.c timingsafe_memcmp.c; do 67for i in explicit_bzero.c strlcpy.c strlcat.c strndup.c strnlen.c timingsafe_bcmp.c timingsafe_memcmp.c; do
68 $CP $libc_src/string/$i crypto/compat 68 $CP $libc_src/string/$i crypto/compat
69done 69done
70$CP $libc_src/stdlib/reallocarray.c crypto/compat 70$CP $libc_src/stdlib/reallocarray.c crypto/compat