From 40ef4b4ae576550b1e0ed5996075a7c150fa36c9 Mon Sep 17 00:00:00 2001 From: xicilion Date: Thu, 22 Feb 2024 12:23:28 +0800 Subject: [PATCH] openssl, bugfix: BIGNUM is processed incorrectly under WIN64. --- openssl/include/crypto/bn_conf.h | 12 ++++++------ openssl/include/openssl/configuration.h | 15 ++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/openssl/include/crypto/bn_conf.h b/openssl/include/crypto/bn_conf.h index a5e5d4873..45259a0cb 100644 --- a/openssl/include/crypto/bn_conf.h +++ b/openssl/include/crypto/bn_conf.h @@ -22,13 +22,13 @@ /* Should we define BN_DIV2W here? */ /* Only one for the following should be defined */ -#if defined(__i386__) || defined(_M_IX86) || defined(__arm__) -#undef SIXTY_FOUR_BIT_LONG -#define THIRTY_TWO_BIT + +#ifdef _WIN64 +# define SIXTY_FOUR_BIT +#elif defined(__i386__) || defined(_M_IX86) || defined(__arm__) +# define THIRTY_TWO_BIT #else -#define SIXTY_FOUR_BIT_LONG -#undef THIRTY_TWO_BIT +# define SIXTY_FOUR_BIT_LONG #endif -#undef SIXTY_FOUR_BIT #endif diff --git a/openssl/include/openssl/configuration.h b/openssl/include/openssl/configuration.h index 91d8b0299..09a113fb0 100644 --- a/openssl/include/openssl/configuration.h +++ b/openssl/include/openssl/configuration.h @@ -157,16 +157,13 @@ extern "C" { # undef I386_ONLY # if !defined(OPENSSL_SYS_UEFI) -# if defined(__i386__) || defined(_M_IX86) || defined(__arm__) -# define BN_LLONG -# undef SIXTY_FOUR_BIT_LONG -# undef SIXTY_FOUR_BIT -# define THIRTY_TWO_BIT +# ifdef _WIN64 +# define SIXTY_FOUR_BIT +# elif defined(__i386__) || defined(_M_IX86) || defined(__arm__) +# define BN_LLONG +# define THIRTY_TWO_BIT # else -# undef BN_LLONG -# define SIXTY_FOUR_BIT_LONG -# undef SIXTY_FOUR_BIT -# undef THIRTY_TWO_BIT +# define SIXTY_FOUR_BIT_LONG # endif # endif