aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2014-07-21 18:57:06 -0500
committerBrent Cook <bcook@openbsd.org>2014-07-21 20:29:49 -0500
commitea6e7116c9d09f850d5045ef922b8bb9e0f65d82 (patch)
treecf3986e343653f99cb15fbbd147401db7c4d4243
parent451dbd967ca64d229db40dd779154d42e381c525 (diff)
downloadportable-ea6e7116c9d09f850d5045ef922b8bb9e0f65d82.tar.gz
portable-ea6e7116c9d09f850d5045ef922b8bb9e0f65d82.tar.bz2
portable-ea6e7116c9d09f850d5045ef922b8bb9e0f65d82.zip
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@
-rw-r--r--.gitignore1
-rw-r--r--include/string.h3
-rwxr-xr-xupdate.sh4
3 files changed, 7 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 93f185f..7578eee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,7 @@ tests/mont*
47tests/timingsafe* 47tests/timingsafe*
48tests/*test 48tests/*test
49tests/*test.c 49tests/*test.c
50tests/memmem.c
50tests/*.pem 51tests/*.pem
51tests/testssl 52tests/testssl
52tests/*.txt 53tests/*.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);
22 22
23int timingsafe_memcmp(const void *b1, const void *b2, size_t len); 23int timingsafe_memcmp(const void *b1, const void *b2, size_t len);
24 24
25void * memmem(const void *big, size_t big_len, const void *little,
26 size_t little_len);
27
25#endif 28#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=(
312 biotest 312 biotest
313 pidwraptest 313 pidwraptest
314) 314)
315$CP $libc_src/string/memmem.c tests/
315(cd tests 316(cd tests
316 $CP Makefile.am.tpl Makefile.am 317 $CP Makefile.am.tpl Makefile.am
317 318
318 for i in `ls -1 *.c|sort`; do 319 for i in `ls -1 *.c|sort|grep -v memmem.c`; do
319 TEST=`echo $i|sed -e "s/\.c//"` 320 TEST=`echo $i|sed -e "s/\.c//"`
320 if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then 321 if ! [[ ${test_drivers[*]} =~ "$TEST" ]]; then
321 echo "TESTS += $TEST" >> Makefile.am 322 echo "TESTS += $TEST" >> Makefile.am
@@ -325,6 +326,7 @@ tests_disabled=(
325 echo "${TEST}_LDADD = \$(top_builddir)/ssl/libssl.la" >> Makefile.am 326 echo "${TEST}_LDADD = \$(top_builddir)/ssl/libssl.la" >> Makefile.am
326 echo "${TEST}_LDADD += \$(top_builddir)/crypto/libcrypto.la" >> Makefile.am 327 echo "${TEST}_LDADD += \$(top_builddir)/crypto/libcrypto.la" >> Makefile.am
327 done 328 done
329 echo "explicit_bzero_SOURCES += memmem.c" >> Makefile.am
328) 330)
329$CP $libcrypto_regress/evp/evptests.txt tests 331$CP $libcrypto_regress/evp/evptests.txt tests
330$CP $libcrypto_regress/aead/aeadtests.txt tests 332$CP $libcrypto_regress/aead/aeadtests.txt tests