diff options
author | Andy Polyakov <appro@openssl.org> | 2005-02-02 00:48:37 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2005-02-02 00:48:37 +0100 |
commit | 62d27939c2f103654b52a83b17febe968a67ec73 (patch) | |
tree | e6be6a7d5bdb754d840776066d28d8a98154c316 /test | |
parent | The first argument to load_iv should really be a char ** instead of an (diff) | |
download | openssl-62d27939c2f103654b52a83b17febe968a67ec73.tar.xz openssl-62d27939c2f103654b52a83b17febe968a67ec73.zip |
Address run-time linker problems: LD_PRELOAD issue on multi-ABI platforms
and SafeDllSearchMode in Windows.
Submitted by: Richard Levitte
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.ssl | 112 | ||||
-rw-r--r-- | test/tcrl | 9 | ||||
-rw-r--r-- | test/testca | 7 | ||||
-rw-r--r-- | test/testenc | 2 | ||||
-rw-r--r-- | test/testgen | 6 | ||||
-rw-r--r-- | test/testss | 10 | ||||
-rw-r--r-- | test/testssl | 14 | ||||
-rw-r--r-- | test/tpkcs7 | 9 | ||||
-rw-r--r-- | test/tpkcs7d | 9 | ||||
-rw-r--r-- | test/treq | 9 | ||||
-rw-r--r-- | test/trsa | 11 | ||||
-rw-r--r-- | test/tsid | 9 | ||||
-rw-r--r-- | test/tx509 | 9 |
13 files changed, 78 insertions, 138 deletions
diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 85d3247b41..202938033b 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -131,21 +131,6 @@ tests: exe apps $(TESTS) apps: @(cd ..; $(MAKE) DIRS=apps all) -SET_SO_PATHS=\ - if [ -n "$(SHARED_LIBS)" ]; then \ - OSSL_LIBPATH="`cd ..; pwd`"; \ - LD_LIBRARY_PATH="$$OSSL_LIBPATH:$$LD_LIBRARY_PATH"; \ - DYLD_LIBRARY_PATH="$$OSSL_LIBPATH:$$DYLD_LIBRARY_PATH"; \ - SHLIB_PATH="$$OSSL_LIBPATH:$$SHLIB_PATH"; \ - LIBPATH="$$OSSL_LIBPATH:$$LIBPATH"; \ - if [ "$(PLATFORM)" = "Cygwin" ]; then \ - PATH="$${LIBPATH}:$$PATH"; \ - fi; \ - LD_PRELOAD="$$OSSL_LIBPATH/libssl.so $$OSSL_LIBPATH/libcrypto.so"; \ - export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \ - export LD_PRELOAD; \ - fi - alltests: \ test_des test_idea test_sha test_md4 test_md5 test_hmac \ test_md2 test_mdc2 \ @@ -156,144 +141,144 @@ alltests: \ test_ss test_ca test_engine test_evp test_ssl test_evp: - $(SET_SO_PATHS); ./$(EVPTEST) evptests.txt + ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt test_des: - $(SET_SO_PATHS); ./$(DESTEST) + ../util/shlib_wrap.sh ./$(DESTEST) test_idea: - $(SET_SO_PATHS); ./$(IDEATEST) + ../util/shlib_wrap.sh ./$(IDEATEST) test_sha: - $(SET_SO_PATHS); ./$(SHATEST) - $(SET_SO_PATHS); ./$(SHA1TEST) - $(SET_SO_PATHS); ./$(SHA256TEST) - $(SET_SO_PATHS); ./$(SHA512TEST) + ../util/shlib_wrap.sh ./$(SHATEST) + ../util/shlib_wrap.sh ./$(SHA1TEST) + ../util/shlib_wrap.sh ./$(SHA256TEST) + ../util/shlib_wrap.sh ./$(SHA512TEST) test_mdc2: - $(SET_SO_PATHS); ./$(MDC2TEST) + ../util/shlib_wrap.sh ./$(MDC2TEST) test_md5: - $(SET_SO_PATHS); ./$(MD5TEST) + ../util/shlib_wrap.sh ./$(MD5TEST) test_md4: - $(SET_SO_PATHS); ./$(MD4TEST) + ../util/shlib_wrap.sh ./$(MD4TEST) test_hmac: - $(SET_SO_PATHS); ./$(HMACTEST) + ../util/shlib_wrap.sh ./$(HMACTEST) test_md2: - $(SET_SO_PATHS); ./$(MD2TEST) + ../util/shlib_wrap.sh ./$(MD2TEST) test_rmd: - $(SET_SO_PATHS); ./$(RMDTEST) + ../util/shlib_wrap.sh ./$(RMDTEST) test_bf: - $(SET_SO_PATHS); ./$(BFTEST) + ../util/shlib_wrap.sh ./$(BFTEST) test_cast: - $(SET_SO_PATHS); ./$(CASTTEST) + ../util/shlib_wrap.sh ./$(CASTTEST) test_rc2: - $(SET_SO_PATHS); ./$(RC2TEST) + ../util/shlib_wrap.sh ./$(RC2TEST) test_rc4: - $(SET_SO_PATHS); ./$(RC4TEST) + ../util/shlib_wrap.sh ./$(RC4TEST) test_rc5: - $(SET_SO_PATHS); ./$(RC5TEST) + ../util/shlib_wrap.sh ./$(RC5TEST) test_rand: - $(SET_SO_PATHS); ./$(RANDTEST) + ../util/shlib_wrap.sh ./$(RANDTEST) test_enc: - @$(SET_SO_PATHS); sh ./testenc + @sh ./testenc test_x509: echo test normal x509v1 certificate - $(SET_SO_PATHS); sh ./tx509 2>/dev/null + sh ./tx509 2>/dev/null echo test first x509v3 certificate - $(SET_SO_PATHS); sh ./tx509 v3-cert1.pem 2>/dev/null + sh ./tx509 v3-cert1.pem 2>/dev/null echo test second x509v3 certificate - $(SET_SO_PATHS); sh ./tx509 v3-cert2.pem 2>/dev/null + sh ./tx509 v3-cert2.pem 2>/dev/null test_rsa: - @$(SET_SO_PATHS); sh ./trsa 2>/dev/null - $(SET_SO_PATHS); ./$(RSATEST) + @sh ./trsa 2>/dev/null + ../util/shlib_wrap.sh ./$(RSATEST) test_crl: - @$(SET_SO_PATHS); sh ./tcrl 2>/dev/null + @sh ./tcrl 2>/dev/null test_sid: - @$(SET_SO_PATHS); sh ./tsid 2>/dev/null + @sh ./tsid 2>/dev/null test_req: - @$(SET_SO_PATHS); sh ./treq 2>/dev/null - @$(SET_SO_PATHS); sh ./treq testreq2.pem 2>/dev/null + @sh ./treq 2>/dev/null + @sh ./treq testreq2.pem 2>/dev/null test_pkcs7: - @$(SET_SO_PATHS); sh ./tpkcs7 2>/dev/null - @$(SET_SO_PATHS); sh ./tpkcs7d 2>/dev/null + @sh ./tpkcs7 2>/dev/null + @sh ./tpkcs7d 2>/dev/null test_bn: @echo starting big number library test, could take a while... - @$(SET_SO_PATHS); ./$(BNTEST) >tmp.bntest + @../util/shlib_wrap.sh ./$(BNTEST) >tmp.bntest @echo quit >>tmp.bntest @echo "running bc" @<tmp.bntest sh -c "`sh ./bctest ignore`" | $(PERL) -e '$$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} else {print STDERR "."; $$i++;}} print STDERR "\n$$i tests passed\n"' @echo 'test a^b%c implementations' - $(SET_SO_PATHS); ./$(EXPTEST) + ../util/shlib_wrap.sh ./$(EXPTEST) test_ec: @echo 'test elliptic curves' - $(SET_SO_PATHS); ./$(ECTEST) + ../util/shlib_wrap.sh ./$(ECTEST) test_ecdsa: @echo 'test ecdsa' - $(SET_SO_PATHS); ./$(ECDSATEST) + ../util/shlib_wrap.sh ./$(ECDSATEST) test_ecdh: @echo 'test ecdh' - $(SET_SO_PATHS); ./$(ECDHTEST) + ../util/shlib_wrap.sh ./$(ECDHTEST) test_verify: @echo "The following command should have some OK's and some failures" @echo "There are definitly a few expired certificates" - $(SET_SO_PATHS); ../apps/openssl verify -CApath ../certs ../certs/*.pem + ../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs ../certs/*.pem test_dh: @echo "Generate a set of DH parameters" - $(SET_SO_PATHS); ./$(DHTEST) + ../util/shlib_wrap.sh ./$(DHTEST) test_dsa: @echo "Generate a set of DSA parameters" - $(SET_SO_PATHS); ./$(DSATEST) - $(SET_SO_PATHS); ./$(DSATEST) -app2_1 + ../util/shlib_wrap.sh ./$(DSATEST) + ../util/shlib_wrap.sh ./$(DSATEST) -app2_1 test_gen: @echo "Generate and verify a certificate request" - @$(SET_SO_PATHS); sh ./testgen + @sh ./testgen test_ss keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ intP1.ss intP2.ss: testss @echo "Generate and certify a test certificate" - @$(SET_SO_PATHS); sh ./testss + @sh ./testss @cat certCA.ss certU.ss > intP1.ss @cat certCA.ss certU.ss certP1.ss > intP2.ss test_engine: @echo "Manipulate the ENGINE structures" - $(SET_SO_PATHS); ./$(ENGINETEST) + ../util/shlib_wrap.sh ./$(ENGINETEST) test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ intP1.ss intP2.ss @echo "test SSL protocol" - @$(SET_SO_PATHS); sh ./testssl keyU.ss certU.ss certCA.ss - @$(SET_SO_PATHS); sh ./testsslproxy keyP1.ss certP1.ss intP1.ss - @$(SET_SO_PATHS); sh ./testsslproxy keyP2.ss certP2.ss intP2.ss + @sh ./testssl keyU.ss certU.ss certCA.ss + @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss + @sh ./testsslproxy keyP2.ss certP2.ss intP2.ss test_ca: - @$(SET_SO_PATHS); if ../apps/openssl no-rsa; then \ + @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \ echo "skipping CA.sh test -- requires RSA"; \ else \ echo "Generate and certify a test certificate via the 'ca' program"; \ @@ -302,7 +287,7 @@ test_ca: test_aes: #$(AESTEST) # @echo "test Rijndael" -# $(SET_SO_PATHS); ./$(AESTEST) +# ../util/shlib_wrap.sh ./$(AESTEST) lint: lint -DLINT $(INCLUDES) $(SRC)>fluff @@ -859,6 +844,7 @@ dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ LIBRPATH=$(INSTALLTOP)/lib \ link_app.$${shlib_target} + @for i in `ls ../*.dll 2>/dev/null`; do cp -p $$i .; done; exit 0 # DO NOT DELETE THIS LINE -- make depend depends on it. @@ -1,13 +1,6 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -cmd='../apps/openssl crl' +cmd='../util/shlib_wrap.sh ../apps/openssl crl' if [ "$1"x != "x" ]; then t=$1 diff --git a/test/testca b/test/testca index 8215ebb5d1..b109cfe271 100644 --- a/test/testca +++ b/test/testca @@ -2,15 +2,18 @@ SH="/bin/sh" if test "$OSTYPE" = msdosdjgpp; then - PATH=./apps\;../apps\;$PATH + PATH="../apps\;$PATH" else - PATH=../apps:$PATH + PATH="../apps:$PATH" fi export SH PATH SSLEAY_CONFIG="-config CAss.cnf" export SSLEAY_CONFIG +OPENSSL="`pwd`/../util/opensslwrap.sh" +export OPENSSL + /bin/rm -fr demoCA $SH ../apps/CA.sh -newca <<EOF EOF diff --git a/test/testenc b/test/testenc index 0656c7f525..23e3f5a376 100644 --- a/test/testenc +++ b/test/testenc @@ -2,7 +2,7 @@ testsrc=Makefile.ssl test=./p -cmd=../apps/openssl +cmd="../util/shlib_wrap.sh ../apps/openssl" cat $testsrc >$test; diff --git a/test/testgen b/test/testgen index 3798543e04..524c0d134c 100644 --- a/test/testgen +++ b/test/testgen @@ -17,7 +17,7 @@ echo "generating certificate request" echo "string to make the random number generator think it has entropy" >> ./.rnd -if ../apps/openssl no-rsa; then +if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then req_new='-newkey dsa:../apps/dsa512.pem' else req_new='-new' @@ -29,13 +29,13 @@ echo "This could take some time." rm -f testkey.pem testreq.pem -../apps/openssl req -config test.cnf $req_new -out testreq.pem +../util/shlib_wrap.sh ../apps/openssl req -config test.cnf $req_new -out testreq.pem if [ $? != 0 ]; then echo problems creating request exit 1 fi -../apps/openssl req -config test.cnf -verify -in testreq.pem -noout +../util/shlib_wrap.sh ../apps/openssl req -config test.cnf -verify -in testreq.pem -noout if [ $? != 0 ]; then echo signature on req is wrong exit 1 diff --git a/test/testss b/test/testss index e71510befa..1a426857d3 100644 --- a/test/testss +++ b/test/testss @@ -1,9 +1,9 @@ #!/bin/sh -digest='-md5' -reqcmd="../apps/openssl req" -x509cmd="../apps/openssl x509 $digest" -verifycmd="../apps/openssl verify" +digest='-sha1' +reqcmd="../util/shlib_wrap.sh ../apps/openssl req" +x509cmd="../util/shlib_wrap.sh ../apps/openssl x509 $digest" +verifycmd="../util/shlib_wrap.sh ../apps/openssl verify" dummycnf="../apps/openssl.cnf" CAkey="keyCA.ss" @@ -34,7 +34,7 @@ echo "make a certificate request using 'req'" echo "string to make the random number generator think it has entropy" >> ./.rnd -if ../apps/openssl no-rsa; then +if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then req_new='-newkey dsa:../apps/dsa512.pem' else req_new='-new' diff --git a/test/testssl b/test/testssl index ca8e718022..8ac90ae5ee 100644 --- a/test/testssl +++ b/test/testssl @@ -10,9 +10,9 @@ if [ "$2" = "" ]; then else cert="$2" fi -ssltest="./ssltest -key $key -cert $cert -c_key $key -c_cert $cert" +ssltest="../util/shlib_wrap.sh ./ssltest -key $key -cert $cert -c_key $key -c_cert $cert" -if ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then +if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then dsa_cert=YES else dsa_cert=NO @@ -121,24 +121,24 @@ $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1 ############################################################################# -if ../apps/openssl no-dh; then +if ../util/shlib_wrap.sh ../apps/openssl no-dh; then echo skipping anonymous DH tests else echo test tls1 with 1024bit anonymous DH, multiple handshakes $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1 fi -if ../apps/openssl no-rsa; then +if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then echo skipping RSA tests else echo test tls1 with 1024bit RSA, no DHE, multiple handshakes - ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1 + ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1 - if ../apps/openssl no-dh; then + if ../util/shlib_wrap.sh ../apps/openssl no-dh; then echo skipping RSA+DHE tests else echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes - ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1 + ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1 fi fi diff --git a/test/tpkcs7 b/test/tpkcs7 index cf3bd9fadb..3e435ffbf9 100644 --- a/test/tpkcs7 +++ b/test/tpkcs7 @@ -1,13 +1,6 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -cmd='../apps/openssl pkcs7' +cmd='../util/shlib_wrap.sh ../apps/openssl pkcs7' if [ "$1"x != "x" ]; then t=$1 diff --git a/test/tpkcs7d b/test/tpkcs7d index 18f9311b06..64fc28e88f 100644 --- a/test/tpkcs7d +++ b/test/tpkcs7d @@ -1,13 +1,6 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -cmd='../apps/openssl pkcs7' +cmd='../util/shlib_wrap.sh ../apps/openssl pkcs7' if [ "$1"x != "x" ]; then t=$1 @@ -1,13 +1,6 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -cmd='../apps/openssl req -config ../apps/openssl.cnf' +cmd='../util/shlib_wrap.sh ../apps/openssl req -config ../apps/openssl.cnf' if [ "$1"x != "x" ]; then t=$1 @@ -1,18 +1,11 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -if ../apps/openssl no-rsa; then +if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then echo skipping rsa conversion test exit 0 fi -cmd='../apps/openssl rsa' +cmd='../util/shlib_wrap.sh ../apps/openssl rsa' if [ "$1"x != "x" ]; then t=$1 @@ -1,13 +1,6 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -cmd='../apps/openssl sess_id' +cmd='../util/shlib_wrap.sh ../apps/openssl sess_id' if [ "$1"x != "x" ]; then t=$1 diff --git a/test/tx509 b/test/tx509 index d380963abc..4a15b98d17 100644 --- a/test/tx509 +++ b/test/tx509 @@ -1,13 +1,6 @@ #!/bin/sh -if test "$OSTYPE" = msdosdjgpp; then - PATH=../apps\;$PATH -else - PATH=../apps:$PATH -fi -export PATH - -cmd='../apps/openssl x509' +cmd='../util/shlib_wrap.sh ../apps/openssl x509' if [ "$1"x != "x" ]; then t=$1 |