]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fixes for defaults code
authorNeil Horman <nhorman@openssl.org>
Wed, 26 Jun 2024 15:52:22 +0000 (11:52 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 9 Jul 2024 08:01:44 +0000 (04:01 -0400)
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)

NOTES-WINDOWS.md
apps/version.c
crypto/defaults.c

index f7984cda0c1256cd4c062019d6fb991fa9708030..21c82e8a7659e3aaee6f95f1ee826c6bf0c2d868 100644 (file)
@@ -132,11 +132,9 @@ A summary table of behavior on Windows platforms
 |`OSSL_WINCTX`|Registry key|OpenSSL Behavior                          |
 |-------------|------------|------------------------------------------|
 |Defined      | Defined    |OpenSSL Reads Paths from Registry         |
-|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          |
 
-
-
 Special notes for Universal Windows Platform builds, aka `VC-*-UWP`
 -------------------------------------------------------------------
 
index 4da8d2744717a70a1b149271606f55ab7ad734ce..efd23a40643774ccbd518712b4945ebcb6625c27 100644 (file)
 
 typedef enum OPTION_choice {
     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;
 
 const OPTIONS version_options[] = {
index 2735efc63a94d1e53f8483ca66ecd976cf3d5584..f9bd077686a8fe770f45e692a3ecba11c1ce6379 100644 (file)
 #include "internal/cryptlib.h"
 #include "internal/e_os.h"
 
-#if defined(_WIN32)
+#if defined(_WIN32) && defined(OSSL_WINCTX)
 
 # define TOSTR(x) #x
 # define MAKESTR(x) TOSTR(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)
-#endif
+# endif
 
 /**
  * @brief The directory where OpenSSL is installed.
@@ -63,7 +63,7 @@ static char *modulesdirptr = NULL;
 static char *get_windows_regdirs(char *dst, LPCTSTR valuename)
 {
     char *retval = NULL;
-#ifdef REGISTY_KEY
+# ifdef REGISTRY_KEY
     DWORD keysize;
     DWORD ktype;
     HKEY hkey;
@@ -104,7 +104,7 @@ static char *get_windows_regdirs(char *dst, LPCTSTR valuename)
 out:
     OPENSSL_free(tempstr);
     RegCloseKey(hkey);
-#endif
+# endif /* REGISTRY_KEY */
     return retval;
 }
 
@@ -135,7 +135,7 @@ DEFINE_RUN_ONCE_STATIC(do_defaults_setup)
 
     return 1;
 }
-#endif
+#endif /* defined(_WIN32) && defined(OSSL_WINCTX) */
 
 /**
  * @brief Get the directory where OpenSSL is installed.