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 /crypto/evp/p5_crpt2_test.c | |
parent | 4d4a535dcfb0c77f273eda338b1955fd83ad9d6f (diff) |
add test case to makefiles
Diffstat (limited to 'crypto/evp/p5_crpt2_test.c')
-rw-r--r-- | crypto/evp/p5_crpt2_test.c | 17 |
1 files changed, 16 insertions, 1 deletions
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 */ |