- name: config
working-directory: _build
run: |
- perl ..\Configure --banner=Configured no-makedepend ${{ matrix.platform.config }}
+ perl ..\Configure --banner=Configured no-makedepend -DWININSTALLCONTEXT=openssl ${{ matrix.platform.config }}
perl configdata.pm --dump
- name: build
working-directory: _build
with:
url: "https://download.sysinternals.com/files/Coreinfo.zip"
target: _build/coreinfo/
+ - name: Gather openssl version info
+ working-directory: _build
+ run: |
+ echo "OSSL_VERSION=$(apps/openssl.exe version -v | awk '{print $2}' | sed -e's/-.*$//')" >> $GITHUB_ENV
+ - name: Set registry keys
+ working-directory: _build
+ run: |
+ echo $OSSL_VERSION
+ reg.exe add HKLM\SOFTWARE\OpenSSL-$OSSL_VERSION-openssl /v OPENSSLDIR /t REG_EXPAND_SZ /d TESTOPENSSLDIR /reg:32
+ reg.exe add HKLM\SOFTWARE\OpenSSL-$OSSL_VERSION-openssl /v ENGINESDIR /t REG_EXPAND_SZ /d TESTOPENSSLDIR /reg:32
+ reg.exe add HKLM\SOFTWARE\OpenSSL-$OSSL_VERSION-openssl /v MODULESDIR /t REG_EXPAND_SZ /d TESTOPENSSLDIR /reg:32
+ reg.exe query HKLM\SOFTWARE\OpenSSL-$OSSL_VERSION-openssl /v OPENSSLDIR /reg:32
- name: get cpu info
working-directory: _build
continue-on-error: true
- name: config
working-directory: _build
run: |
- perl ..\Configure --banner=Configured enable-demos no-makedepend no-shared no-fips enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-trace enable-crypto-mdebug VC-WIN64A-masm
+ perl ..\Configure --banner=Configured enable-demos no-makedepend no-shared no-fips enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-trace enable-crypto-mdebug -DWININSTALLCONTEXT=openssl VC-WIN64A-masm
perl configdata.pm --dump
- name: build
working-directory: _build
- name: config
working-directory: _build
run: |
- perl ..\Configure --banner=Configured enable-demos no-makedepend no-bulk no-deprecated no-fips no-asm no-threads -DOPENSSL_SMALL_FOOTPRINT
+ perl ..\Configure --banner=Configured enable-demos no-makedepend no-bulk no-deprecated no-fips no-asm no-threads -DOPENSSL_SMALL_FOOTPRINT -DWININSTALLCONTEXT=openssl
perl configdata.pm --dump
- name: build
working-directory: _build
--- /dev/null
+#! /usr/bin/env perl
+# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+
+use OpenSSL::Test;
+use OpenSSL::Test::Utils;
+use OpenSSL::Test qw/:DEFAULT bldtop_file data_file srctop_file cmdstr/;
+
+setup("test_windows_registry");
+
+plan skip_all => "Windows registry tests are only available on windows"
+ if $^O !~ /(MSWin)/;
+
+my $actual;
+my $expect;
+
+my @tempout = run(app(["openssl", "version", "-w"]), capture => 1);
+my $context = "@tempout";
+$context =~ s/^.*: //;
+
+
+@tempout = run(app(["openssl", "version", "-v"]), capture => 1);
+my $version = "@tempout";
+$version =~ s/^OpenSSL //;
+$version =~ s/-.*\n//;
+
+my $regkey = "HKLM\\SOFTWARE\\OpenSSL-".$version."-".$context;
+$regkey =~ s/\n//g;
+print "REGKEY IS $regkey\n";
+
+my $exit = run(cmd(["reg.exe", "query", $regkey, "/v", "OPENSSLDIR", "/reg:32"]));
+
+plan skip_all => "Skipping test as registry keys aren't set"
+ if $exit == 0;
+
+plan tests => 3;
+
+my @expectossldir = run(cmd(["reg.exe", "query", $regkey, "/reg:32", "/t", "REG_EXPAND_SZ", "/v", "OPENSSLDIR"]), capture => 1);
+
+my @expectengdir = run(cmd(["reg.exe", "query", $regkey, "/reg:32", "/t", "REG_EXPAND_SZ", "/v", "ENGINESDIR"]), capture => 1);
+
+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);
+
+print "@osslversion";
+$expect = "@expectossldir";
+$actual = "@osslversion";
+$expect =~ s/HKEY_LOCAL_MACHINE.*\n*//;
+$expect =~ s/\n//g;
+$expect =~ s/.*REG_EXPAND_SZ *//;
+$expect =~ s/ .*$//;
+$actual =~ s/OPENSSLDIR: *//;
+
+ok(grep(/$expect/,$actual), "Confirming version output for openssldir from registry");
+
+my @osslengineout = run(app(["openssl", "version", "-e"]), capture => 1);
+
+$expect = "@expectengdir";
+$actual = "@osslengineout";
+$expect =~ s/HKEY_LOCAL_MACHINE.*\n*//;
+$expect =~ s/\n//g;
+$expect =~ s/.*REG_EXPAND_SZ *//;
+$expect =~ s/ .*$//;
+$actual =~ s/ENGINESDIR: *//;
+
+ok(grep(/$expect/, $actual) == 1, "Confirming version output for enginesdir from registry");
+
+my @osslmoduleout = run(app(["openssl", "version", "-m"]), capture => 1);
+
+$expect = "@expectmoddir";
+$actual = "@osslmoduleout";
+$expect =~ s/HKEY_LOCAL_MACHINE.*\n*//;
+$expect =~ s/\n//g;
+$expect =~ s/.*REG_EXPAND_SZ *//;
+$expect =~ s/ .*$//;
+$actual =~ s/MODULESSDIR: *//;
+ok(grep(/$expect/, $actual) == 1, "Confirming version output for modulesdir from registry");
+
+