From d347f5ca77fe967286630b9cf455e4b4a9fe33b9 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Sun, 20 May 2018 13:40:57 +0900 Subject: [PATCH] #define SHA384/512 WC_SHA384/512 -> wolfSSL_SHA384/512 --- wolfssl/openssl/sha.h | 12 ++++++++++-- wolfssl/wolfcrypt/sha512.h | 6 ------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/wolfssl/openssl/sha.h b/wolfssl/openssl/sha.h index 86e657bcb..9c098972c 100644 --- a/wolfssl/openssl/sha.h +++ b/wolfssl/openssl/sha.h @@ -148,7 +148,11 @@ typedef WOLFSSL_SHA384_CTX SHA384_CTX; #define SHA384_Init wolfSSL_SHA384_Init #define SHA384_Update wolfSSL_SHA384_Update #define SHA384_Final wolfSSL_SHA384_Final - +#if defined(NO_OLD_SHA256_NAMES) && !defined(HAVE_FIPS) + /* SHA384 is only available in non-fips mode because of SHA256 enum in FIPS + * build. */ + #define SHA384 wolfSSL_SHA384 +#endif #endif /* WOLFSSL_SHA384 */ #ifdef WOLFSSL_SHA512 @@ -173,7 +177,11 @@ typedef WOLFSSL_SHA512_CTX SHA512_CTX; #define SHA512_Init wolfSSL_SHA512_Init #define SHA512_Update wolfSSL_SHA512_Update #define SHA512_Final wolfSSL_SHA512_Final - +#if defined(NO_OLD_SHA256_NAMES) && !defined(HAVE_FIPS) + /* SHA256 is only available in non-fips mode because of SHA256 enum in FIPS + * build. */ + #define SHA512 wolfSSL_SHA512 +#endif #endif /* WOLFSSL_SHA512 */ diff --git a/wolfssl/wolfcrypt/sha512.h b/wolfssl/wolfcrypt/sha512.h index c2a421f69..315f56df0 100644 --- a/wolfssl/wolfcrypt/sha512.h +++ b/wolfssl/wolfcrypt/sha512.h @@ -73,9 +73,6 @@ #if !defined(NO_OLD_WC_NAMES) #define Sha512 wc_Sha512 - #if !defined(OPENSSL_EXTRA) - #define SHA512 WC_SHA512 - #endif #define SHA512_BLOCK_SIZE WC_SHA512_BLOCK_SIZE #define SHA512_DIGEST_SIZE WC_SHA512_DIGEST_SIZE #define SHA512_PAD_SIZE WC_SHA512_PAD_SIZE @@ -127,9 +124,6 @@ WOLFSSL_API int wc_Sha512Copy(wc_Sha512* src, wc_Sha512* dst); #if !defined(NO_OLD_SHA_NAMES) #define Sha384 wc_Sha384 - #if !defined(OPENSSL_EXTRA) - #define SHA384 WC_SHA384 - #endif #define SHA384_BLOCK_SIZE WC_SHA384_BLOCK_SIZE #define SHA384_DIGEST_SIZE WC_SHA384_DIGEST_SIZE #define SHA384_PAD_SIZE WC_SHA384_PAD_SIZE