]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Update defaults to install keys against major.minor
authorNeil Horman <nhorman@openssl.org>
Thu, 27 Jun 2024 15:12:23 +0000 (11:12 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 9 Jul 2024 08:01:44 +0000 (04:01 -0400)
we want patch level updates to use the same keys, so only create the key
against the major.minor version

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24450)

crypto/defaults.c
test/recipes/02-test_windows_registry.t

index f9bd077686a8fe770f45e692a3ecba11c1ce6379..27c051508ed8a0fc51b0464237a0e7bbd6ed0653 100644 (file)
@@ -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;
 
index ceb6d99694592f5d3ccb4ca15238f2dceb50272d..3029b151e8645923017bfd16b91b166bc3757eff 100644 (file)
@@ -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 *//;