Resolve armasm fips wrappers and sanity

pull/7295/head
kaleb-himes 2024-04-09 11:41:41 -06:00
parent 0d83d0d199
commit 71e83cdd19
3 changed files with 48 additions and 6 deletions

View File

@ -35,13 +35,28 @@
#if !defined(NO_AES) && defined(WOLFSSL_ARMASM)
#if defined(HAVE_FIPS) && !defined(FIPS_NO_WRAPPERS)
#define FIPS_NO_WRAPPERS
#if FIPS_VERSION3_LT(6,0,0) && defined(HAVE_FIPS)
#undef HAVE_FIPS
#else
#if defined(HAVE_FIPS) && FIPS_VERSION3_GE(6,0,0)
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
#define FIPS_NO_WRAPPERS
#endif
#endif
#ifndef WOLFSSL_ARMASM_NO_HW_CRYPTO
#include <wolfssl/wolfcrypt/aes.h>
#if FIPS_VERSION3_GE(6,0,0)
const unsigned int wolfCrypt_FIPS_aes_ro_sanity[2] =
{ 0x1a2b3c4d, 0x00000002 };
int wolfCrypt_FIPS_AES_sanity(void)
{
return 0;
}
#endif
#include <wolfssl/wolfcrypt/logging.h>
#ifdef NO_INLINE
#include <wolfssl/wolfcrypt/misc.h>

View File

@ -29,11 +29,24 @@
#ifdef WOLFSSL_ARMASM
#if !defined(NO_SHA256) || defined(WOLFSSL_SHA224)
#ifdef HAVE_FIPS
#undef HAVE_FIPS
#if FIPS_VERSION3_LT(6,0,0) && defined(HAVE_FIPS)
#undef HAVE_FIPS
#else
#if defined(HAVE_FIPS) && FIPS_VERSION3_GE(6,0,0)
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
#define FIPS_NO_WRAPPERS
#endif
#endif
#include <wolfssl/wolfcrypt/sha256.h>
#if FIPS_VERSION3_GE(6,0,0)
const unsigned int wolfCrypt_FIPS_sha256_ro_sanity[2] =
{ 0x1a2b3c4d, 0x00000014 };
int wolfCrypt_FIPS_SHA256_sanity(void)
{
return 0;
}
#endif
#include <wolfssl/wolfcrypt/logging.h>
#include <wolfssl/wolfcrypt/error-crypt.h>

View File

@ -28,11 +28,25 @@
#ifdef WOLFSSL_ARMASM
#if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
#ifdef HAVE_FIPS
#undef HAVE_FIPS
#if FIPS_VERSION3_LT(6,0,0) && defined(HAVE_FIPS)
#undef HAVE_FIPS
#else
#if defined(HAVE_FIPS) && FIPS_VERSION3_GE(6,0,0)
/* set NO_WRAPPERS before headers, use direct internal f()s not wrappers */
#define FIPS_NO_WRAPPERS
#endif
#endif
#include <wolfssl/wolfcrypt/sha512.h>
#if FIPS_VERSION3_GE(6,0,0)
const unsigned int wolfCrypt_FIPS_sha512_ro_sanity[2] =
{ 0x1a2b3c4d, 0x00000015 };
int wolfCrypt_FIPS_SHA512_sanity(void)
{
return 0;
}
#endif
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/hash.h>