]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add 'openssl info' item for the Windows install context
authorRichard Levitte <levitte@openssl.org>
Tue, 15 Oct 2024 10:22:52 +0000 (12:22 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 16 Oct 2024 17:29:53 +0000 (19:29 +0200)
This information is already present as an 'openssl version' item.

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

apps/info.c
crypto/info.c
doc/man1/openssl-info.pod.in
doc/man3/OpenSSL_version.pod
include/openssl/crypto.h.in

index f3a1a2b107332e2c3807001c90fec47988faeb78..5a469eed9695dc3bc6e9ced7b06a1c25d0031a72 100644 (file)
@@ -14,7 +14,7 @@
 typedef enum OPTION_choice {
     OPT_COMMON,
     OPT_CONFIGDIR, OPT_ENGINESDIR, OPT_MODULESDIR, OPT_DSOEXT, OPT_DIRNAMESEP,
-    OPT_LISTSEP, OPT_SEEDS, OPT_CPUSETTINGS
+    OPT_LISTSEP, OPT_SEEDS, OPT_CPUSETTINGS, OPT_WINDOWSCONTEXT
 } OPTION_CHOICE;
 
 const OPTIONS info_options[] = {
@@ -32,6 +32,7 @@ const OPTIONS info_options[] = {
     {"listsep", OPT_LISTSEP, '-', "List separator character"},
     {"seeds", OPT_SEEDS, '-', "Seed sources"},
     {"cpusettings", OPT_CPUSETTINGS, '-', "CPU settings info"},
+    {"windowscontext", OPT_WINDOWSCONTEXT, '-', "Windows install context"},
     {NULL}
 };
 
@@ -85,6 +86,10 @@ opthelp:
             type = OPENSSL_INFO_CPU_SETTINGS;
             dirty++;
             break;
+        case OPT_WINDOWSCONTEXT:
+            type = OPENSSL_INFO_WINDOWS_CONTEXT;
+            dirty++;
+            break;
         }
     }
     if (!opt_check_rest_arg(NULL))
index 153460a71f27bd8b662136e68714bdc92b1c376d..ad31c9ec31fe23377c79e1ab53f8236789de38e7 100644 (file)
@@ -243,6 +243,8 @@ const char *OPENSSL_info(int t)
         if (ossl_cpu_info_str[0] != '\0')
             return ossl_cpu_info_str + strlen(CPUINFO_PREFIX);
         break;
+    case OPENSSL_INFO_WINDOWS_CONTEXT:
+        return ossl_get_wininstallcontext();
     default:
         break;
     }
index 0e91bb28ee10d3b68e6c63dd7546f80ba909b6f4..90c6676079f6327bf0b1426bee244d51a7d3e57e 100644 (file)
@@ -73,6 +73,10 @@ Outputs the randomness seed sources.
 
 Outputs the OpenSSL CPU settings info.
 
+=item B<-windowscontext>
+
+Outputs the Windows install context.
+
 =back
 
 =head1 HISTORY
index e1cf16e2a109b992a59147a4ca8028493c8764c0..8227c7850063d3581c45d7dd91153f7e7e8f9b39 100644 (file)
@@ -211,6 +211,15 @@ automatically configured but may be set via an environment variable.
 The value has the same syntax as the environment variable.
 For x86 the string looks like C<OPENSSL_ia32cap=0x123:0x456>.
 
+=item OPENSSL_INFO_WINDOWS_CONTEXT
+
+The Windows install context.
+The Windows install context is used to compute the OpenSSL registry key name
+on Windows.  The full registry key is
+C<SOFTWARE\WOW6432Node\OpenSSL-{major}.{minor}-{context}>, where C<{major}>,
+C<{minor}> and C<{context}> are OpenSSL's major version number, minor version
+number and the Windows install context, respectively.
+
 =back
 
 For an unknown I<t>, NULL is returned.
index a2f67c1e625bc5cee44f94fef79ee13c9efbded1..101719ab5b3a8132ba1c1361915c5414df036167 100644 (file)
@@ -186,6 +186,7 @@ const char *OPENSSL_info(int type);
 # define OPENSSL_INFO_LIST_SEPARATOR            1006
 # define OPENSSL_INFO_SEED_SOURCE               1007
 # define OPENSSL_INFO_CPU_SETTINGS              1008
+# define OPENSSL_INFO_WINDOWS_CONTEXT           1009
 
 int OPENSSL_issetugid(void);