Skip to content

Commit 005ce08

Browse files
authored
Merge pull request #8794 from kareem-wolfssl/multiFixes
Add missing DH_MAX_SIZE define for FIPS, correct wolfssl.rc FILETYPE to VFT_DLL
2 parents be5b62b + 08f063d commit 005ce08

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

IDE/WIN-SRTP-KDF-140-3/wolfssl-fips.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ VS_VERSION_INFO VERSIONINFO
6060
FILEFLAGS 0x0L
6161
#endif
6262
FILEOS 0x40004L
63-
FILETYPE 0x7L
63+
FILETYPE VFT_DLL
6464
FILESUBTYPE 0x0L
6565
BEGIN
6666
BLOCK "StringFileInfo"

IDE/WIN10/wolfssl-fips.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ VS_VERSION_INFO VERSIONINFO
6060
FILEFLAGS 0x0L
6161
#endif
6262
FILEOS 0x40004L
63-
FILETYPE 0x7L
63+
FILETYPE VFT_DLL
6464
FILESUBTYPE 0x0L
6565
BEGIN
6666
BLOCK "StringFileInfo"

wolfssl.rc

6 Bytes
Binary file not shown.

wolfssl/wolfcrypt/settings.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4128,6 +4128,32 @@ extern void uITRON4_free(void *p) ;
41284128
#undef WOLFSSL_DH_EXTRA
41294129
#endif
41304130

4131+
/* FIPS 140-3 does not have this definition in wolfCrypt dh.h, but OpenSSL dh.h depends on it.
4132+
* Define it here as well if needed, as we want to avoid modifying dh.h in FIPS. */
4133+
#ifndef DH_MAX_SIZE
4134+
#ifdef USE_FAST_MATH
4135+
/* FP implementation support numbers up to FP_MAX_BITS / 2 bits. */
4136+
#define DH_MAX_SIZE (FP_MAX_BITS / 2)
4137+
#if defined(WOLFSSL_MYSQL_COMPATIBLE) && DH_MAX_SIZE < 8192
4138+
#error "MySQL needs FP_MAX_BITS at least at 16384"
4139+
#endif
4140+
#elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
4141+
/* SP implementation supports numbers of SP_INT_BITS bits. */
4142+
#define DH_MAX_SIZE (((SP_INT_BITS + 7) / 8) * 8)
4143+
#if defined(WOLFSSL_MYSQL_COMPATIBLE) && DH_MAX_SIZE < 8192
4144+
#error "MySQL needs SP_INT_BITS at least at 8192"
4145+
#endif
4146+
#else
4147+
#ifdef WOLFSSL_MYSQL_COMPATIBLE
4148+
/* Integer maths is dynamic but we only go up to 8192 bits. */
4149+
#define DH_MAX_SIZE 8192
4150+
#else
4151+
/* Integer maths is dynamic but we only go up to 4096 bits. */
4152+
#define DH_MAX_SIZE 4096
4153+
#endif
4154+
#endif
4155+
#endif
4156+
41314157
/* wc_Sha512.devId isn't available before FIPS 5.1 */
41324158
#if defined(HAVE_FIPS) && FIPS_VERSION_LT(5,1)
41334159
#define NO_SHA2_CRYPTO_CB

0 commit comments

Comments
 (0)