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.
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;
return ossl_cpu_info_str;
else
return "CPUINFO: N/A";
- case OPENSSL_WININSTALLCONTEXT:
+ case OPENSSL_WINCTX:
return ossl_get_wininstallcontext();
}
return "not available";
# 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
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;
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;
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;
*/
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
# 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);
/*