]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Change WININSTALLCONTEXT to OSSL_WINCTX
authorNeil Horman <nhorman@openssl.org>
Fri, 7 Jun 2024 17:36:46 +0000 (13:36 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 9 Jul 2024 08:01:44 +0000 (04:01 -0400)
Make it more in line with other command line defines, and a bit shorter

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/cversion.c
crypto/defaults.c
include/openssl/crypto.h.in

index e218f28bee7683eb23aea10e02e5df80525aec66..f19bcab4f64a5214f1543f8f1872aa9c1eba1c9e 100644 (file)
@@ -130,19 +130,22 @@ defaults can be overridden by registry keys.  This is done because it is common
 practice for windows based installers to allow users to place the installation
 tree at various locations not defined at build time.  The following keys:
 
-    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL\OPENSSLDIR`
-    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL\ENGINESDIR`
-    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL\MODULESDIR`
+    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL-<version>-<ctx>\OPENSSLDIR`
+    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL-<version>-<ctx>\ENGINESDIR`
+    `\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\OpenSSL-<version>-<ctx>\MODULESDIR`
 
 Can be administratively set, and openssl will take the paths found there as the
-values for OPENSSLDIR, ENGINESDIR and MODULESDIR respectively.  If unset, the
-build time defaults will be used.
+values for OPENSSLDIR, ENGINESDIR and MODULESDIR respectively.
 
 To enable the reading of registry keys from windows builds, add
-`-DWININSTALLCONTEXT=<string>`to the Configure command line.  Without setting
-this, the library defaults back to reporing the build time defaults without
-checking the registry.  Note that if you wish to have a private set of registry
-keys for your application, you should set `OPENSSL_VERSION` to a unique value
+`-DOPENSSL_WINCTX=<string>`to the Configure command line.  This define is used
+at build time to construct library build specific registry key paths of the
+format:
+`\\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432node\OpenSSL-<version>-<ctx>`
+Where `<version>` is the semantic major.minor.patch version of the library being
+built, and `<ctx>` is the value specified by `-DOPENSSL_WINCTX`.  This allows
+for multiple openssl builds to be created and installed on a single system, in
+which each library can use its own set of registry keys.
 
 Note the installer available at <https://github.com/openssl/installer> will set
 these keys when the installer is run.
index 50ae1388be03b473d84332722c9b33ffe3c7c353..278afe8bf9344542d34e18cf5b873d8009bf976a 100644 (file)
@@ -136,7 +136,7 @@ opthelp:
     if (cpuinfo)
         printf("%s\n", OpenSSL_version(OPENSSL_CPU_INFO));
     if (windows)
-       printf("WININSTALLCONTEXT: %s\n", OpenSSL_version(OPENSSL_WININSTALLCONTEXT));
+       printf("OSSL_WINCTX: %s\n", OpenSSL_version(OPENSSL_WINCTX));
     ret = 0;
  end:
     return ret;
index d3f193a9efb4cc44072e13a9534b19bb829635c1..219479f19a3f5ac6e0cc70090ef6dbd5f069f49a 100644 (file)
@@ -70,7 +70,7 @@ const char *OpenSSL_version(int t)
             return ossl_cpu_info_str;
         else
             return "CPUINFO: N/A";
-    case OPENSSL_WININSTALLCONTEXT:
+    case OPENSSL_WINCTX:
        return ossl_get_wininstallcontext();
     }
     return "not available";
index e882d35c1f3f9a76457ee4cb7dc8ef4908402193..56f2cb417a2635df9e3d28a8ff599c74225480bb 100644 (file)
@@ -18,8 +18,8 @@
 # define TOSTR(x) #x
 # define MAKESTR(x) TOSTR(x)
 # define NOQUOTE(x) x
-#if defined(WININSTALLCONTEXT)
-# define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## NOQUOTE(OPENSSL_VERSION_STR) ##"-"## MAKESTR(WININSTALLCONTEXT)
+#if defined(OSSL_WINCTX)
+# define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## NOQUOTE(OPENSSL_VERSION_STR) ##"-"## MAKESTR(OSSL_WINCTX)
 #else
 # define REGISTRY_KEY "NONE"
 #endif
@@ -117,7 +117,7 @@ DEFINE_RUN_ONCE_STATIC(do_defaults_setup)
 const char *ossl_get_openssldir(void)
 {
 #if defined(_WIN32)
-# if defined(WININSTALLCONTEXT)
+# if defined(OSSL_WINCTX)
     if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup))
         return NULL;
     return (const char *)openssldir;
@@ -141,7 +141,7 @@ const char *ossl_get_openssldir(void)
 const char *ossl_get_enginesdir(void)
 {
 #if defined(_WIN32)
-# if defined(WININSTALLCONTEXT)
+# if defined(OSSL_WINCTX)
     if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup))
         return NULL;
     return (const char *)enginesdir;
@@ -165,7 +165,7 @@ const char *ossl_get_enginesdir(void)
 const char *ossl_get_modulesdir(void)
 {
 #if defined(_WIN32)
-# if definied (WININSTALLCONTEXT)
+# if defined (OSSL_WINCTX)
     if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup))
         return NULL;
     return (const char *)modulesdir;
@@ -188,8 +188,8 @@ const char *ossl_get_modulesdir(void)
  */
 const char *ossl_get_wininstallcontext(void)
 {
-#if defined(_WIN32) && defined (WININSTALLCONTEXT)
-       return MAKESTR(WININSTALLCONTEXT);
+#if defined(_WIN32) && defined (OSSL_WINCTX)
+       return MAKESTR(OSSL_WINCTX);
 #else
        return "";
 #endif
index ee92bf61d227492cad9d95a1739fd0476df5ede3..99041cce065e209b5a1b1332fd9bfbd23e963433 100644 (file)
@@ -170,7 +170,7 @@ const char *OpenSSL_version(int type);
 # define OPENSSL_FULL_VERSION_STRING    7
 # define OPENSSL_MODULES_DIR            8
 # define OPENSSL_CPU_INFO               9
-# define OPENSSL_WININSTALLCONTEXT     10
+# define OPENSSL_WINCTX                10
 
 const char *OPENSSL_info(int type);
 /*