From ea6e7116c9d09f850d5045ef922b8bb9e0f65d82 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 21 Jul 2014 18:57:06 -0500 Subject: [PATCH] build openbsd memmem implementation for explicit_bzero test memmem is not always available, and not all memmem's work the same way ok beck@ guenther@ --- .gitignore | 1 + include/string.h | 3 +++ update.sh | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 93f185f..7578eee 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ tests/mont* tests/timingsafe* tests/*test tests/*test.c +tests/memmem.c tests/*.pem tests/testssl tests/*.txt diff --git a/include/string.h b/include/string.h index acdde6c..6277247 100644 --- a/include/string.h +++ b/include/string.h @@ -22,4 +22,7 @@ int timingsafe_bcmp(const void *b1, const void *b2, size_t n); int timingsafe_memcmp(const void *b1, const void *b2, size_t len); +void * memmem(const void *big, size_t big_len, const void *little, + size_t little_len); + #endif diff --git a/update.sh b/update.sh index 5bb6034..290e06d 100755 --- a/update.sh +++ b/update.sh @@ -312,10 +312,11 @@ tests_disabled=( biotest pidwraptest ) +$CP $libc_src/string/memmem.c tests/ (cd tests $CP Makefile.am.tpl Makefile.am - for i in `ls -1 *.c|sort`; do + for i in `ls -1 *.c|sort|grep -v memmem.c`; do TEST=`echo $i|sed -e "s/\.c//"` if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then echo "TESTS += $TEST" >> Makefile.am @@ -325,6 +326,7 @@ tests_disabled=( echo "${TEST}_LDADD = \$(top_builddir)/ssl/libssl.la" >> Makefile.am echo "${TEST}_LDADD += \$(top_builddir)/crypto/libcrypto.la" >> Makefile.am done + echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am ) $CP $libcrypto_regress/evp/evptests.txt tests $CP $libcrypto_regress/aead/aeadtests.txt tests