add strndup/strnlen compat functions from OpenBSD
This commit is contained in:
parent
fb67b92eb2
commit
0a74a4d464
2
.gitignore
vendored
2
.gitignore
vendored
@ -108,6 +108,8 @@ crypto/compat/getentropy_*.c
|
||||
crypto/compat/reallocarray.c
|
||||
crypto/compat/strlcat.c
|
||||
crypto/compat/strlcpy.c
|
||||
crypto/compat/strndup.c
|
||||
crypto/compat/strnlen.c
|
||||
crypto/compat/strtonum.c
|
||||
crypto/compat/timingsafe_bcmp.c
|
||||
crypto/compat/timingsafe_memcmp.c
|
||||
|
@ -64,6 +64,11 @@ AC_CHECK_FUNC(strlcat,[AC_SEARCH_LIBS(strlcat,, [NO_STRLCAT=],
|
||||
AC_SUBST(NO_STRLCAT)
|
||||
AM_CONDITIONAL(NO_STRLCAT, test "x$NO_STRLCAT" = "xyes")
|
||||
|
||||
AC_CHECK_FUNC(strndup,[AC_SEARCH_LIBS(strndup,, [NO_STRNDUP=],
|
||||
[NO_STRNDUP=yes])], [NO_STRNDUP=yes])
|
||||
AC_SUBST(NO_STRNDUP)
|
||||
AM_CONDITIONAL(NO_STRNDUP, test "x$NO_STRNDUP" = "xyes")
|
||||
|
||||
AC_CHECK_FUNC(reallocarray,[AC_SEARCH_LIBS(reallocarray,, [NO_REALLOCARRAY=],
|
||||
[NO_REALLOCARRAY=yes])], [NO_REALLOCARRAY=yes])
|
||||
AC_SUBST(NO_REALLOCARRAY)
|
||||
|
@ -33,6 +33,11 @@ if NO_STRLCPY
|
||||
libcompat_la_SOURCES += compat/strlcpy.c
|
||||
endif
|
||||
|
||||
if NO_STRNDUP
|
||||
libcompat_la_SOURCES += compat/strndup.c
|
||||
libcompat_la_SOURCES += compat/strnlen.c
|
||||
endif
|
||||
|
||||
if NO_REALLOCARRAY
|
||||
libcompat_la_SOURCES += compat/reallocarray.c
|
||||
endif
|
||||
|
@ -16,6 +16,10 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||
|
||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
|
||||
char * strndup(const char *str, size_t maxlen);
|
||||
|
||||
size_t strnlen(const char *str, size_t maxlen);
|
||||
|
||||
void explicit_bzero(void *, size_t);
|
||||
|
||||
int timingsafe_bcmp(const void *b1, const void *b2, size_t n);
|
||||
|
@ -64,7 +64,7 @@ $CP $libssl_src/src/crypto/opensslfeatures.h include/openssl
|
||||
$CP $libssl_src/src/e_os2.h include/openssl
|
||||
$CP $libssl_src/src/ssl/pqueue.h include
|
||||
|
||||
for i in explicit_bzero.c strlcpy.c strlcat.c timingsafe_bcmp.c timingsafe_memcmp.c; do
|
||||
for i in explicit_bzero.c strlcpy.c strlcat.c strndup.c strnlen.c timingsafe_bcmp.c timingsafe_memcmp.c; do
|
||||
$CP $libc_src/string/$i crypto/compat
|
||||
done
|
||||
$CP $libc_src/stdlib/reallocarray.c crypto/compat
|
||||
|
Loading…
x
Reference in New Issue
Block a user