diff options
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 */ |