From 9ba62a2c52a0b50b0fa4741a5a09ec8f0cb6f151 Mon Sep 17 00:00:00 2001 From: toddouska Date: Sat, 28 Mar 2015 14:58:17 -0700 Subject: [PATCH] allow examples build if no-sha but psk is on --- configure.ac | 2 +- tests/hash.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 912aa459e..6614f0fb6 100644 --- a/configure.ac +++ b/configure.ac @@ -1695,7 +1695,7 @@ AC_ARG_ENABLE([examples], AS_IF([test "x$ENABLED_FILESYSTEM" = "xno"], [ENABLED_EXAMPLES="no"]) AS_IF([test "x$ENABLED_INLINE" = "xno"], [ENABLED_EXAMPLES="no"]) # certs still have sha signatures for now -AS_IF([test "x$ENABLED_SHA" = "xno"], [ENABLED_EXAMPLES="no"]) +AS_IF([test "x$ENABLED_SHA" = "xno" && test"x$ENABLED_PSK" = "xno"], [ENABLED_EXAMPLES="no"]) AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$ENABLED_EXAMPLES" = "xyes"]) diff --git a/tests/hash.c b/tests/hash.c index eae8feb8e..e28a71a03 100644 --- a/tests/hash.c +++ b/tests/hash.c @@ -127,10 +127,12 @@ int HashTest(void) printf( " HMAC-MD5 test passed!\n"); #endif + #ifndef NO_SHA if ( (ret = hmac_sha_test()) ) printf( " HMAC-SHA test failed!\n"); else printf( " HMAC-SHA test passed!\n"); + #endif #ifndef NO_SHA256 if ( (ret = hmac_sha256_test()) ) @@ -631,7 +633,7 @@ int hmac_md5_test(void) } #endif -#ifndef NO_HMAC +#if !defined(NO_HMAC) && !defined(NO_SHA) int hmac_sha_test(void) { Hmac hmac;