Renamed SHA2 support option to SHA2_ENABLE per request.

This commit is contained in:
Johny Mattsson 2015-06-03 11:11:23 +10:00
parent 2d1e69151e
commit 06724fbb17
3 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -32,8 +32,9 @@
*
*/
#ifndef WITHOUT_SHA2
#include "user_config.h"
#ifdef SHA2_ENABLE
#include "sha2.h"
#include <string.h> /* 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

View File

@ -41,6 +41,7 @@
#define CLIENT_SSL_ENABLE
#define GPIO_INTERRUPT_ENABLE
#define SHA2_ENABLE
// #define BUILD_WOFS 1
#define BUILD_SPIFFS 1