From 06724fbb1771386cae73d0dd1387a48384282fbd Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Wed, 3 Jun 2015 11:11:23 +1000 Subject: [PATCH] Renamed SHA2 support option to SHA2_ENABLE per request. --- app/crypto/digests.c | 3 ++- app/crypto/sha2.c | 5 +++-- app/include/user_config.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/crypto/digests.c b/app/crypto/digests.c index c9b5fc0b..66fb2198 100644 --- a/app/crypto/digests.c +++ b/app/crypto/digests.c @@ -28,6 +28,7 @@ * */ #include "digests.h" +#include "user_config.h" #include "lwip/mem.h" #include "lwip/arch.h" #include "ssl/ssl_crypto.h" @@ -53,7 +54,7 @@ static const digest_mech_info_t hash_mechs[] = MECH(MD2, MD2_SIZE, 16) ,MECH(MD5, MD5_SIZE, 64) ,MECH(SHA1, SHA1_SIZE, 64) -#ifndef WITHOUT_SHA2 +#ifdef SHA2_ENABLE ,MECH(SHA256, SHA256_DIGEST_LENGTH, SHA256_BLOCK_LENGTH) ,MECH(SHA384, SHA384_DIGEST_LENGTH, SHA384_BLOCK_LENGTH) ,MECH(SHA512, SHA512_DIGEST_LENGTH, SHA512_BLOCK_LENGTH) diff --git a/app/crypto/sha2.c b/app/crypto/sha2.c index 27f6391c..ee42895d 100644 --- a/app/crypto/sha2.c +++ b/app/crypto/sha2.c @@ -32,8 +32,9 @@ * */ -#ifndef WITHOUT_SHA2 +#include "user_config.h" +#ifdef SHA2_ENABLE #include "sha2.h" #include /* memcpy()/memset() or bcopy()/bzero() */ #define assert(x) do {} while (0) @@ -909,4 +910,4 @@ void ICACHE_FLASH_ATTR SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { MEMSET_BZERO(context, sizeof(SHA384_CTX)); } -#endif // WITHOUT_SHA2 +#endif // SHA2_ENABLE diff --git a/app/include/user_config.h b/app/include/user_config.h index 96ad3322..bff94808 100644 --- a/app/include/user_config.h +++ b/app/include/user_config.h @@ -41,6 +41,7 @@ #define CLIENT_SSL_ENABLE #define GPIO_INTERRUPT_ENABLE +#define SHA2_ENABLE // #define BUILD_WOFS 1 #define BUILD_SPIFFS 1