Skip to content

Commit fbaabbe

Browse files
Merge pull request wolfSSL#8230 from douzzer/20241126-FIPS-OPENSSL_COEXIST
20241126-FIPS-OPENSSL_COEXIST
2 parents e9a4f7d + b65d3ff commit fbaabbe

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

wolfcrypt/test/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24986,7 +24986,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t openssl_test(void)
2498624986

2498724987
#if defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2)
2498824988
/* Expect failure with MD5 + HMAC when using FIPS 140-3. */
24989-
if (HMAC(EVP_md5(), "JefeJefeJefeJefe", 16, (byte*)c.input, (int)c.inLen,
24989+
if (wolfSSL_HMAC(wolfSSL_EVP_md5(), "JefeJefeJefeJefe", 16, (byte*)c.input, (int)c.inLen,
2499024990
hash, 0) != NULL)
2499124991
#else
2499224992
if (wolfSSL_HMAC(wolfSSL_EVP_md5(), "JefeJefeJefeJefe", 16, (byte*)c.input, (int)c.inLen,

wolfssl/ssl.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
#include <openssl/hmac.h>
118118
#include <openssl/bn.h>
119119
#include <openssl/crypto.h>
120+
121+
#if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \
122+
FIPS_VERSION3_GE(5,2,0))
120123
#include <openssl/aes.h>
121124
#include <openssl/blowfish.h>
122125
#include <openssl/camellia.h>
@@ -163,6 +166,10 @@
163166
#include <openssl/rc5.h>
164167
#include <openssl/ripemd.h>
165168
#include <openssl/rsa.h>
169+
#if defined(HAVE_FIPS_VERSION) && FIPS_VERSION3_LT(7,0,0)
170+
/* clear conflicting name */
171+
#undef RSA_PKCS1_PADDING_SIZE
172+
#endif
166173
#include <openssl/seed.h>
167174
#include <openssl/self_test.h>
168175
#include <openssl/sha.h>
@@ -173,6 +180,8 @@
173180
#include <openssl/txt_db.h>
174181
#include <openssl/ui.h>
175182
#include <openssl/whrlpool.h>
183+
#endif /* !HAVE_SELFTEST && (!HAVE_FIPS || FIPS_VERSION3_GE(5,2,0)) */
184+
176185
#endif
177186

178187
#elif (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))

wolfssl/wolfcrypt/settings.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3660,6 +3660,11 @@ extern void uITRON4_free(void *p) ;
36603660
#ifndef NO_OLD_WC_NAMES
36613661
#define NO_OLD_WC_NAMES
36623662
#endif
3663+
#if defined(HAVE_SELFTEST) || \
3664+
(defined(HAVE_FIPS) && FIPS_VERSION3_LT(5,0,0))
3665+
/* old FIPS needs this remapping. */
3666+
#define Sha3 wc_Sha3
3667+
#endif
36633668
#endif
36643669

36653670
#if defined(NO_OLD_WC_NAMES) || defined(OPENSSL_EXTRA)

0 commit comments

Comments
 (0)