diff options
author | Christian Heimes <christian@python.org> | 2013-11-13 01:46:42 +0100 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2014-05-25 17:35:04 +0100 |
commit | 56431240ae8e3f75008575b1da1eb28115e5ee46 (patch) | |
tree | 12bf153c937f1624ce0d3d6e67e8bb7aec7f2922 | |
parent | 4d4a535dcfb0c77f273eda338b1955fd83ad9d6f (diff) |
add test case to makefiles
-rw-r--r-- | crypto/evp/Makefile | 2 | ||||
-rw-r--r-- | crypto/evp/p5_crpt2_test.c | 17 | ||||
-rw-r--r-- | test/Makefile | 16 |
3 files changed, 29 insertions, 6 deletions
diff --git a/crypto/evp/Makefile b/crypto/evp/Makefile index dd77a06c61..2302eb1fae 100644 --- a/crypto/evp/Makefile +++ b/crypto/evp/Makefile @@ -13,7 +13,7 @@ AR= ar r CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile -TEST=evp_test.c +TEST=evp_test.c p5_crpt2_test.c TESTDATA=evptests.txt APPS= diff --git a/crypto/evp/p5_crpt2_test.c b/crypto/evp/p5_crpt2_test.c index cf02851246..ad57e17655 100644 --- a/crypto/evp/p5_crpt2_test.c +++ b/crypto/evp/p5_crpt2_test.c @@ -61,6 +61,14 @@ #include <openssl/err.h> #include <openssl/conf.h> +#ifdef OPENSSL_NO_SHA +int main(int argc, char *argv[]) +{ + printf("No SHA support\n"); + return(0); +} +#else + typedef struct { const char *pass; int passlen; @@ -113,7 +121,7 @@ hexdump(FILE *f, const char *title, const unsigned char *s, int l) { int i; fprintf(f, "%s", title); for(i=0; i < l ; i++) { - fprintf(f, " 0x%02x", s[i]); + fprintf(f, "%02x", s[i]); } fprintf(f, "\n"); } @@ -192,9 +200,15 @@ int main(int argc,char **argv) { printf("PKCS5_PBKDF2_HMAC() tests "); for (i=0; test->pass != NULL; i++, test++) { +#ifndef OPENSSL_NO_SHA0 test_p5_pbkdf2(i, "sha1", test, sha1_results[i]); +#endif +#ifndef OPENSSL_NO_SHA256 test_p5_pbkdf2(i, "sha256", test, sha256_results[i]); +#endif +#ifndef OPENSSL_NO_SHA512 test_p5_pbkdf2(i, "sha512", test, sha512_results[i]); +#endif printf("."); } printf(" done\n"); @@ -209,3 +223,4 @@ int main(int argc,char **argv) { CRYPTO_mem_leaks_fp(stderr); return 0; } +#endif /* OPENSSL_NO_SHA */ diff --git a/test/Makefile b/test/Makefile index 66ce1a1bbd..10389133cb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -62,6 +62,7 @@ SSLTEST= ssltest RSATEST= rsa_test ENGINETEST= enginetest EVPTEST= evp_test +P5_CRPT2_TEST= p5_crpt2_test IGETEST= igetest JPAKETEST= jpaketest SRPTEST= srptest @@ -99,7 +100,7 @@ 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) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \ - $(V3NAMETEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) + $(V3NAMETEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) $(P5_CRPT2_TEST)$(EXE_EXT) FIPSEXE=$(FIPS_SHATEST)$(EXE_EXT) $(FIPS_DESTEST)$(EXE_EXT) \ $(FIPS_RANDTEST)$(EXE_EXT) $(FIPS_AESTEST)$(EXE_EXT) \ @@ -128,7 +129,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ $(FIPS_TEST_SUITE).o $(FIPS_DHVS).o $(FIPS_ECDSAVS).o \ $(FIPS_ECDHVS).o $(FIPS_CMACTEST).o $(FIPS_ALGVS).o \ $(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(V3NAMETEST).o \ - $(GOST2814789TEST).o $(HEARTBEATTEST).o + $(GOST2814789TEST).o $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o + SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ $(HMACTEST).c $(WPTEST).c \ @@ -143,7 +145,7 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(FIPS_TEST_SUITE).c $(FIPS_DHVS).c $(FIPS_ECDSAVS).c \ $(FIPS_ECDHVS).c $(FIPS_CMACTEST).c $(FIPS_ALGVS).c \ $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(V3NAMETEST).c \ - $(GOST2814789TEST).c $(HEARTBEATTEST).c + $(GOST2814789TEST).c $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c EXHEADER= HEADER= $(EXHEADER) @@ -191,11 +193,14 @@ alltests: \ test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ test_jpake test_srp test_cms test_v3name test_ocsp \ - test_gost2814789 test_heartbeat + test_gost2814789 test_heartbeat test_p5_crpt2 test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt +test_p5_crpt2: $(P5_CRPT2_TEST)$(EXE_EXT) + ../util/shlib_wrap.sh ./$(P5_CRPT2_TEST) + test_des: $(DESTEST)$(EXE_EXT) ../util/shlib_wrap.sh ./$(DESTEST) @@ -591,6 +596,9 @@ $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO) $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO) @target=$(EVPTEST); $(BUILD_CMD) +$(P5_CRPT2_TEST)$(EXE_EXT): $(P5_CRPT2_TEST).o $(DLIBCRYPTO) + @target=$(P5_CRPT2_TEST); $(BUILD_CMD) + $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO) @target=$(ECDSATEST); $(BUILD_CMD) |