Fixes for defaults code

Fix up some indenting, and ensure that the run_once routines don't get
defined if OSSL_WINCTX isn't defined to avoid compiler errors

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24450)
This commit is contained in:
Neil Horman 2024-06-26 11:52:22 -04:00
parent 290452f2bd
commit bf74cf35cf
3 changed files with 11 additions and 10 deletions

View File

@ -135,8 +135,6 @@ A summary table of behavior on Windows platforms
|Defined | Undefined |OpenSSL returns errors on module/conf load| |Defined | Undefined |OpenSSL returns errors on module/conf load|
|Undefined | N/A |OpenSSL uses build time defaults | |Undefined | N/A |OpenSSL uses build time defaults |
Special notes for Universal Windows Platform builds, aka `VC-*-UWP` Special notes for Universal Windows Platform builds, aka `VC-*-UWP`
------------------------------------------------------------------- -------------------------------------------------------------------

View File

@ -18,7 +18,10 @@
typedef enum OPTION_choice { typedef enum OPTION_choice {
OPT_COMMON, OPT_COMMON,
OPT_B, OPT_D, OPT_E, OPT_M, OPT_F, OPT_O, OPT_P, OPT_V, OPT_A, OPT_R, OPT_C, OPT_W OPT_B, OPT_D, OPT_E, OPT_M, OPT_F, OPT_O, OPT_P, OPT_V, OPT_A, OPT_R, OPT_C
#if defined(_WIN32)
,OPT_W
#endif
} OPTION_CHOICE; } OPTION_CHOICE;
const OPTIONS version_options[] = { const OPTIONS version_options[] = {

View File

@ -13,14 +13,14 @@
#include "internal/cryptlib.h" #include "internal/cryptlib.h"
#include "internal/e_os.h" #include "internal/e_os.h"
#if defined(_WIN32) #if defined(_WIN32) && defined(OSSL_WINCTX)
# define TOSTR(x) #x # define TOSTR(x) #x
# define MAKESTR(x) TOSTR(x) # define MAKESTR(x) TOSTR(x)
# define NOQUOTE(x) x # define NOQUOTE(x) x
#if defined(OSSL_WINCTX) # if defined(OSSL_WINCTX)
# define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## NOQUOTE(OPENSSL_VERSION_STR) ##"-"## MAKESTR(OSSL_WINCTX) # define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## NOQUOTE(OPENSSL_VERSION_STR) ##"-"## MAKESTR(OSSL_WINCTX)
#endif # endif
/** /**
* @brief The directory where OpenSSL is installed. * @brief The directory where OpenSSL is installed.
@ -63,7 +63,7 @@ static char *modulesdirptr = NULL;
static char *get_windows_regdirs(char *dst, LPCTSTR valuename) static char *get_windows_regdirs(char *dst, LPCTSTR valuename)
{ {
char *retval = NULL; char *retval = NULL;
#ifdef REGISTY_KEY # ifdef REGISTRY_KEY
DWORD keysize; DWORD keysize;
DWORD ktype; DWORD ktype;
HKEY hkey; HKEY hkey;
@ -104,7 +104,7 @@ static char *get_windows_regdirs(char *dst, LPCTSTR valuename)
out: out:
OPENSSL_free(tempstr); OPENSSL_free(tempstr);
RegCloseKey(hkey); RegCloseKey(hkey);
#endif # endif /* REGISTRY_KEY */
return retval; return retval;
} }
@ -135,7 +135,7 @@ DEFINE_RUN_ONCE_STATIC(do_defaults_setup)
return 1; return 1;
} }
#endif #endif /* defined(_WIN32) && defined(OSSL_WINCTX) */
/** /**
* @brief Get the directory where OpenSSL is installed. * @brief Get the directory where OpenSSL is installed.