From b5ff99a017f0a06e9dfbaa92313e5dcaab185b89 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 28 Dec 2018 09:22:36 -0800 Subject: [PATCH 1/2] Fixes for a few minor build errors where HAVE_FIPS and HAVE_FIPS_VERSION are not checked. --- wolfssl/wolfcrypt/ecc.h | 3 ++- wolfssl/wolfcrypt/error-crypt.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wolfssl/wolfcrypt/ecc.h b/wolfssl/wolfcrypt/ecc.h index 21bf637ec..6790233ed 100644 --- a/wolfssl/wolfcrypt/ecc.h +++ b/wolfssl/wolfcrypt/ecc.h @@ -31,7 +31,8 @@ #ifdef HAVE_ECC -#if defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) +#if defined(HAVE_FIPS) && \ + defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) #include #endif /* HAVE_FIPS_VERSION >= 2 */ diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index 2581a30b5..c8e93a826 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -28,9 +28,10 @@ #include -#ifdef HAVE_FIPS +#if defined(HAVE_FIPS) && \ + defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION < 2) #include -#endif /* HAVE_FIPS */ +#endif /* HAVE_FIPS V1 */ #ifdef __cplusplus extern "C" { From fb0eb55f281c772e6d2dc96ef5bedcb70b608808 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 28 Dec 2018 09:36:13 -0800 Subject: [PATCH 2/2] Improved FIPS version check logic for error-crypt.h. --- wolfssl/wolfcrypt/error-crypt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfssl/wolfcrypt/error-crypt.h b/wolfssl/wolfcrypt/error-crypt.h index c8e93a826..7553102ea 100644 --- a/wolfssl/wolfcrypt/error-crypt.h +++ b/wolfssl/wolfcrypt/error-crypt.h @@ -29,7 +29,7 @@ #include #if defined(HAVE_FIPS) && \ - defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION < 2) + (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2)) #include #endif /* HAVE_FIPS V1 */