From a2bd6e786d8b31e6b1a92cd684df1e00112f4f46 Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 10 Apr 2013 12:42:51 -0700 Subject: [PATCH] fix leanpsk NO_SHA build --- ctaocrypt/test/test.c | 2 +- cyassl/ctaocrypt/sha.h | 3 +++ cyassl/internal.h | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ctaocrypt/test/test.c b/ctaocrypt/test/test.c index 3166bbe43..e43b22d64 100644 --- a/ctaocrypt/test/test.c +++ b/ctaocrypt/test/test.c @@ -1062,7 +1062,7 @@ int hmac_md5_test(void) } #endif /* NO_HMAC && NO_MD5 */ -#ifndef NO_HMAC +#if !defined(NO_HMAC) && !defined(NO_SHA) int hmac_sha_test(void) { Hmac hmac; diff --git a/cyassl/ctaocrypt/sha.h b/cyassl/ctaocrypt/sha.h index aaed8813a..591a86ee0 100644 --- a/cyassl/ctaocrypt/sha.h +++ b/cyassl/ctaocrypt/sha.h @@ -20,6 +20,8 @@ */ +#ifndef NO_SHA + #ifndef CTAO_CRYPT_SHA_H #define CTAO_CRYPT_SHA_H @@ -62,4 +64,5 @@ CYASSL_API void ShaFinal(Sha*, byte*); #endif #endif /* CTAO_CRYPT_SHA_H */ +#endif /* NO_SHA */ diff --git a/cyassl/internal.h b/cyassl/internal.h index 3182e7ec1..bea8bb0ec 100644 --- a/cyassl/internal.h +++ b/cyassl/internal.h @@ -108,6 +108,10 @@ #endif #endif +#ifdef NO_SHA + #define SHA_DIGEST_SIZE 20 +#endif + #ifdef NO_SHA256 #define SHA256_DIGEST_SIZE 32 #endif