More secure storage of key material.
[openssl.git] / test / Makefile
index 01724aa0b5db1267cb82e3250017234d78f15ba3..508c53b6fd9298f22c0e390db0a7f2c88edf9873 100644 (file)
@@ -63,6 +63,7 @@ EVPEXTRATEST=evp_extra_test
 P5_CRPT2_TEST= p5_crpt2_test
 IGETEST=       igetest
 JPAKETEST=     jpaketest
+SECMEMTEST=    secmemtest
 SRPTEST=       srptest
 V3NAMETEST=    v3nametest
 HEARTBEATTEST=  heartbeat_test
@@ -80,7 +81,8 @@ EXE=  $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT)  $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)
        $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) \
        $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \
        $(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) \
-       $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) \
+       $(JPAKETEST)$(EXE_EXT) $(SECMEMTEST)$(EXE_EXT) \
+       $(SRPTEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) \
        $(HEARTBEATTEST)$(EXE_EXT) $(P5_CRPT2_TEST)$(EXE_EXT) \
        $(CONSTTIMETEST)$(EXE_EXT)
 
@@ -145,7 +147,8 @@ alltests: \
        test_enc test_x509 test_rsa test_crl test_sid \
        test_gen test_req test_pkcs7 test_verify test_dh test_dsa \
        test_ss test_ca test_engine test_evp test_evp_extra test_ssl test_tsa \
-       test_ige test_jpake test_srp test_cms test_v3name test_ocsp \
+       test_ige test_jpake test_secmem \
+       test_srp test_cms test_v3name test_ocsp \
        test_gost2814789 test_heartbeat test_p5_crpt2 \
        test_constant_time
 
@@ -245,7 +248,7 @@ test_x509: ../apps/openssl$(EXE_EXT) tx509 testx509.pem v3-cert1.pem v3-cert2.pe
        @echo $(START) $@ -- second x509v3 certificate
        sh ./tx509 v3-cert2.pem
 
-test_rsa: $(RSATEST)$(EXE_EXT) ../apps/openssl$(EXE_EXT) tkey testrsa.pem
+test_rsa: $(RSATEST)$(EXE_EXT) ../apps/openssl$(EXE_EXT) tkey testrsa.pem testrsapub.pem
        @echo $(START) $@
        ../util/shlib_wrap.sh ./$(RSATEST)
        @echo $(START) $@ -- private key
@@ -282,7 +285,7 @@ test_bn: $(BNTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) bctest
        @echo $(START) $@ -- $(EXPTEST)
        ../util/shlib_wrap.sh ./$(EXPTEST)
 
-test_ec: $(ECTEST)$(EXE_EXT) tkey testec-p256.pem
+test_ec: $(ECTEST)$(EXE_EXT) tkey testec-p256.pem testecpub-p256.pem
        @echo $(START) $@
        ../util/shlib_wrap.sh ./$(ECTEST)
        @echo $(START) $@ -- private
@@ -300,13 +303,13 @@ test_ecdh: $(ECDHTEST)$(EXE_EXT)
 
 test_verify: ../apps/openssl$(EXE_EXT)
        @echo $(START) $@ -- expect some failures and expired certificates
-       OPENSSL_CONF=/dev/null ../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs/demo ../certs/demo/*.pem
+       ../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs/demo ../certs/demo/*.pem
 
 test_dh: $(DHTEST)$(EXE_EXT)
        @echo $(START) $@
        ../util/shlib_wrap.sh ./$(DHTEST)
 
-test_dsa: $(DSATEST)$(EXE_EXT) tkey testdsa.pem
+test_dsa: $(DSATEST)$(EXE_EXT) tkey testdsa.pem testdsapub.pem
        @echo $(START) $@
        ../util/shlib_wrap.sh ./$(DSATEST)
        @echo $(START) $@ -- app2_1
@@ -345,7 +348,7 @@ test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \
        @sh ./testsslproxy keyP2.ss certP2.ss intP2.ss
 
 test_ca: ../apps/openssl$(EXE_EXT) testca CAss.cnf Uss.cnf
-       @if OPENSSL_CONF=/dev/null ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
+       @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
          echo SKIP $@ -- requires RSA; \
        else \
          echo $(START) $@; \
@@ -353,7 +356,7 @@ test_ca: ../apps/openssl$(EXE_EXT) testca CAss.cnf Uss.cnf
        fi
 
 test_tsa: ../apps/openssl$(EXE_EXT) testtsa CAtsa.cnf ../util/shlib_wrap.sh
-       @if OPENSSL_CONF=/dev/null ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
+       @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
            echo SKIP $@ -- requires RSA; \
        else \
          echo $(START) $@; \
@@ -370,7 +373,11 @@ test_jpake: $(JPAKETEST)$(EXE_EXT)
 
 test_cms: ../apps/openssl$(EXE_EXT) cms-test.pl smcont.txt
        @echo $(START) $@
-       OPENSSL_CONFIG=/dev/null $(PERL) cms-test.pl
+       $(PERL) cms-test.pl
+
+test_secmem: $(SECMEMTEST)$(EXE_EXT)
+       @echo $(START) $@
+       ../util/shlib_wrap.sh ./secmemtest
 
 test_srp: $(SRPTEST)$(EXE_EXT)
        @echo $(START) $@
@@ -392,12 +399,13 @@ test_constant_time: $(CONSTTIMETEST)$(EXE_EXT)
        @echo $(START) $@
        ../util/shlib_wrap.sh ./$(CONSTTIMETEST)
 
-depend:
-       @if [ -z "$(THIS)" ]; then \
-           $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
-       else \
-           $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
-       fi
+update: local_depend
+       @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+depend: local_depend
+       @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+local_depend:
+       @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC)
 
 dclean:
        $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
@@ -408,10 +416,10 @@ clean:
        rm -f .rnd tmp.bntest tmp.bctest *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log dummytest
 
 $(DLIBSSL):
-       (cd ..; $(MAKE) DIRS=ssl all)
+       (cd ..; $(MAKE) build_libssl)
 
 $(DLIBCRYPTO):
-       (cd ..; $(MAKE) DIRS=crypto all)
+       (cd ..; $(MAKE) build_libcrypto)
 
 BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
                shlib_target="$(SHLIB_TARGET)"; \
@@ -563,6 +571,9 @@ $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
 $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO)
        @target=$(JPAKETEST); $(BUILD_CMD)
 
+$(SECMEMTEST)$(EXE_EXT): $(SECMEMTEST).o $(DLIBCRYPTO)
+       @target=$(SECMEMTEST); $(BUILD_CMD)
+
 $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
        @target=$(SRPTEST); $(BUILD_CMD)
 
@@ -690,16 +701,17 @@ evp_extra_test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 evp_extra_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 evp_extra_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
 evp_extra_test.o: evp_extra_test.c
-evp_test.o: ../include/openssl/asn1.h ../include/openssl/bio.h
-evp_test.o: ../include/openssl/buffer.h ../include/openssl/conf.h
-evp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
-evp_test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
-evp_test.o: ../include/openssl/ecdsa.h ../include/openssl/err.h
-evp_test.o: ../include/openssl/evp.h ../include/openssl/lhash.h
-evp_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
-evp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
-evp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
-evp_test.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
+evp_test.o: ../include/internal/numbers.h ../include/openssl/asn1.h
+evp_test.o: ../include/openssl/bio.h ../include/openssl/buffer.h
+evp_test.o: ../include/openssl/conf.h ../include/openssl/crypto.h
+evp_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+evp_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h
+evp_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
+evp_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
+evp_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+evp_test.o: ../include/openssl/pem.h ../include/openssl/pem2.h
+evp_test.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h
 evp_test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 evp_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 evp_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
@@ -741,11 +753,11 @@ heartbeat_test.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h
 heartbeat_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
 heartbeat_test.o: ../include/openssl/sha.h ../include/openssl/srtp.h
 heartbeat_test.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
-heartbeat_test.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
-heartbeat_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-heartbeat_test.o: ../include/openssl/tls1.h ../include/openssl/x509.h
-heartbeat_test.o: ../include/openssl/x509_vfy.h ../ssl/record/record.h
-heartbeat_test.o: ../ssl/ssl_locl.h heartbeat_test.c testutil.h
+heartbeat_test.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
+heartbeat_test.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
+heartbeat_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
+heartbeat_test.o: ../ssl/record/record.h ../ssl/ssl_locl.h heartbeat_test.c
+heartbeat_test.o: testutil.h
 hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h
@@ -849,11 +861,11 @@ ssltest.o: ../include/openssl/rand.h ../include/openssl/rsa.h
 ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 ssltest.o: ../include/openssl/srp.h ../include/openssl/srtp.h
 ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
-ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
-ssltest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
-ssltest.o: ../include/openssl/tls1.h ../include/openssl/x509.h
-ssltest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h
-ssltest.o: ../ssl/record/record.h ../ssl/ssl_locl.h ssltest.c
+ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h
+ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
+ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
+ssltest.o: ../include/openssl/x509v3.h ../ssl/record/record.h ../ssl/ssl_locl.h
+ssltest.o: ssltest.c
 testutil.o: ../e_os.h ../include/openssl/e_os2.h
 testutil.o: ../include/openssl/opensslconf.h testutil.c testutil.h
 v3nametest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h