forked from wolfSSL/wolfssl
Merge pull request #1590 from JacobBarthelmeh/Compatibility-Layer
add NO_OLD_SHA_NAMES macro and add back SHA512, SHA384
This commit is contained in:
@@ -3930,7 +3930,7 @@ AC_ARG_ENABLE([oldnames],
|
||||
if test "x$ENABLED_OLDNAMES" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
|
||||
then
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_OLD_RNGNAME -DNO_OLD_WC_NAMES -DNO_OLD_SSL_NAMES"
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA256_NAMES"
|
||||
AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA_NAMES"
|
||||
fi
|
||||
|
||||
|
||||
|
@@ -18383,7 +18383,7 @@ static void test_wolfSSL_AES_ecb_encrypt(void)
|
||||
static void test_wolfSSL_SHA256(void)
|
||||
{
|
||||
#if defined(OPENSSL_EXTRA) && !defined(NO_SHA256) && \
|
||||
defined(NO_OLD_SHA256_NAMES) && !defined(HAVE_FIPS)
|
||||
defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)
|
||||
unsigned char input[] =
|
||||
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
|
||||
unsigned char output[] =
|
||||
|
@@ -119,7 +119,7 @@ typedef WOLFSSL_SHA256_CTX SHA256_CTX;
|
||||
#define SHA256_Init wolfSSL_SHA256_Init
|
||||
#define SHA256_Update wolfSSL_SHA256_Update
|
||||
#define SHA256_Final wolfSSL_SHA256_Final
|
||||
#if defined(NO_OLD_SHA256_NAMES) && !defined(HAVE_FIPS)
|
||||
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)
|
||||
/* SHA256 is only available in non-fips mode because of SHA256 enum in FIPS
|
||||
* build. */
|
||||
#define SHA256 wolfSSL_SHA256
|
||||
@@ -148,8 +148,8 @@ 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
|
||||
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)
|
||||
/* SHA384 is only available in non-fips mode because of SHA384 enum in FIPS
|
||||
* build. */
|
||||
#define SHA384 wolfSSL_SHA384
|
||||
#endif
|
||||
@@ -177,8 +177,8 @@ 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
|
||||
#if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)
|
||||
/* SHA512 is only available in non-fips mode because of SHA512 enum in FIPS
|
||||
* build. */
|
||||
#define SHA512 wolfSSL_SHA512
|
||||
#endif
|
||||
|
@@ -1639,8 +1639,8 @@ extern void uITRON4_free(void *p) ;
|
||||
|
||||
#if defined(NO_OLD_WC_NAMES) || defined(OPENSSL_EXTRA)
|
||||
/* added to have compatibility with SHA256() */
|
||||
#if !defined(NO_OLD_SHA256_NAMES) && !defined(HAVE_FIPS)
|
||||
#define NO_OLD_SHA256_NAMES
|
||||
#if !defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)
|
||||
#define NO_OLD_SHA_NAMES
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@@ -62,11 +62,12 @@
|
||||
#include <wolfssl/wolfcrypt/async.h>
|
||||
#endif
|
||||
|
||||
#if !defined(NO_OLD_SHA_NAMES)
|
||||
#define SHA WC_SHA
|
||||
#endif
|
||||
|
||||
#ifndef NO_OLD_WC_NAMES
|
||||
#define Sha wc_Sha
|
||||
#if !defined(OPENSSL_EXTRA)
|
||||
#define SHA WC_SHA
|
||||
#endif
|
||||
#define SHA_BLOCK_SIZE WC_SHA_BLOCK_SIZE
|
||||
#define SHA_DIGEST_SIZE WC_SHA_DIGEST_SIZE
|
||||
#define SHA_PAD_SIZE WC_SHA_PAD_SIZE
|
||||
|
@@ -81,7 +81,7 @@
|
||||
#define SHA256_NOINLINE
|
||||
#endif
|
||||
|
||||
#if !defined(NO_OLD_SHA256_NAMES)
|
||||
#if !defined(NO_OLD_SHA_NAMES)
|
||||
#define SHA256 WC_SHA256
|
||||
#endif
|
||||
|
||||
|
@@ -71,6 +71,10 @@
|
||||
#define SHA512_NOINLINE
|
||||
#endif
|
||||
|
||||
#if !defined(NO_OLD_SHA_NAMES)
|
||||
#define SHA512 WC_SHA512
|
||||
#endif
|
||||
|
||||
#if !defined(NO_OLD_WC_NAMES)
|
||||
#define Sha512 wc_Sha512
|
||||
#define SHA512_BLOCK_SIZE WC_SHA512_BLOCK_SIZE
|
||||
@@ -123,6 +127,10 @@ WOLFSSL_API int wc_Sha512Copy(wc_Sha512* src, wc_Sha512* dst);
|
||||
#ifndef HAVE_FIPS /* avoid redefinition of structs */
|
||||
|
||||
#if !defined(NO_OLD_SHA_NAMES)
|
||||
#define SHA384 WC_SHA384
|
||||
#endif
|
||||
|
||||
#if !defined(NO_OLD_WC_NAMES)
|
||||
#define Sha384 wc_Sha384
|
||||
#define SHA384_BLOCK_SIZE WC_SHA384_BLOCK_SIZE
|
||||
#define SHA384_DIGEST_SIZE WC_SHA384_DIGEST_SIZE
|
||||
|
Reference in New Issue
Block a user