diff --git a/crypto/defaults.c b/crypto/defaults.c index f9bd077686..27c051508e 100644 --- a/crypto/defaults.c +++ b/crypto/defaults.c @@ -19,7 +19,7 @@ # define MAKESTR(x) TOSTR(x) # define NOQUOTE(x) x # if defined(OSSL_WINCTX) -# define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## NOQUOTE(OPENSSL_VERSION_STR) ##"-"## MAKESTR(OSSL_WINCTX) +# define REGISTRY_KEY "SOFTWARE\\WOW6432Node\\OpenSSL" ##"-"## MAKESTR(OPENSSL_VERSION_MAJOR) ##"."## MAKESTR(OPENSSL_VERSION_MINOR) ##"-"## MAKESTR(OSSL_WINCTX) # endif /** @@ -28,7 +28,7 @@ static char openssldir[MAX_PATH + 1]; /** - * @brief The pointer to the opennsldir buffer + * @brief The pointer to the openssldir buffer */ static char *openssldirptr = NULL; diff --git a/test/recipes/02-test_windows_registry.t b/test/recipes/02-test_windows_registry.t index ceb6d99694..3029b151e8 100644 --- a/test/recipes/02-test_windows_registry.t +++ b/test/recipes/02-test_windows_registry.t @@ -27,7 +27,7 @@ $context =~ s/^.*: //; @tempout = run(app(["openssl", "version", "-v"]), capture => 1); my $version = "@tempout"; $version =~ s/^OpenSSL //; -$version =~ s/-.*\n//; +$version =~ s/(^[0-9]+\.[0-9]+)(.*$)/\1/; my $regkey = "HKLM\\SOFTWARE\\OpenSSL-".$version."-".$context; $regkey =~ s/\n//g; @@ -46,11 +46,11 @@ my @expectengdir = run(cmd(["reg.exe", "query", $regkey, "/reg:32", "/t", "REG_E my @expectmoddir = run(cmd(["reg.exe", "query", $regkey, "/reg:32", "/t", "REG_EXPAND_SZ", "/v", "MODULESDIR"]), capture => 1); -my @osslversion = run(app(["openssl", "version", "-d"]), capture => 1); +my @ossldir = run(app(["openssl", "version", "-d"]), capture => 1); -print "@osslversion"; +print "@ossldir"; $expect = "@expectossldir"; -$actual = "@osslversion"; +$actual = "@ossldir"; $expect =~ s/HKEY_LOCAL_MACHINE.*\n*//; $expect =~ s/\n//g; $expect =~ s/.*REG_EXPAND_SZ *//;