From 3fbadedc1e67446e3b722f16a05d024743d66dd6 Mon Sep 17 00:00:00 2001 From: Dmitry Misharov Date: Mon, 30 Nov 2026 16:41:09 +0100 Subject: [PATCH] Install the validated FIPS 3.5.9 module The OpenSSL FIPS Provider 3.5.9 completed FIPS 140-3 validation (certificate #5586), so it replaces 3.1.2 as the validated module the VS installers offer. 3.5.9 builds on Windows without the 3.1.2 patches: the libdir and wincrypt fixes are upstream, and the /Z7 patch only served the parallel jom build. The module is now built unpatched with nmake, as the Jenkins release pipeline does, so the patches and their pre-commit exclusion go. Test comments no longer name the module version; tests/config.yaml holds it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test-installer.yml | 36 ++------ .pre-commit-config.yaml | 4 - tests/config.yaml | 4 +- tests/conftest.py | 2 +- tests/test_gui.py | 10 +-- tests/test_signed.py | 2 +- tests/test_silent_install.py | 4 +- ...Z7-compiler-flag-to-enable-parallel-.patch | 87 ------------------- .../0001-win-Fix-warning-build-issue.patch | 28 ------ ...002-windows-makefile-libdir-absolute.patch | 39 --------- windows-installer/README.md | 1 + .../installer_automatization.ps1 | 8 +- windows-installer/openssl.aip | 2 +- 13 files changed, 22 insertions(+), 205 deletions(-) delete mode 100644 windows-installer/0001-3.1-Windows-Use-Z7-compiler-flag-to-enable-parallel-.patch delete mode 100644 windows-installer/0001-win-Fix-warning-build-issue.patch delete mode 100644 windows-installer/0002-windows-makefile-libdir-absolute.patch diff --git a/.github/workflows/test-installer.yml b/.github/workflows/test-installer.yml index 17fd73a..df73303 100644 --- a/.github/workflows/test-installer.yml +++ b/.github/workflows/test-installer.yml @@ -48,10 +48,10 @@ permissions: contents: read env: - # The NIST-validated FIPS module is built once per architecture from this ref - # and shared by every installer flavor of that architecture via the `fips` - # job's artifact. - FIPS_REF: openssl-3.1.2 + # The NIST-validated FIPS module (FIPS 140-3 certificate #5586) is built once + # per architecture from this ref and shared by every installer flavor of that + # architecture via the `fips` job's artifact. + FIPS_REF: openssl-3.5.9 # Visual Studio Enterprise and Perl are preinstalled on the hosted Windows # runners, but the VS version and path differ between images (VS 2026 under @@ -116,18 +116,6 @@ jobs: path: openssl-fips persist-credentials: false - - name: Apply Windows build patches to FIPS source - if: steps.fips_cache.outputs.cache-hit != 'true' && env.FIPS_REF == 'openssl-3.1.2' - shell: pwsh - working-directory: openssl-fips - run: | - git apply --verbose "$env:GITHUB_WORKSPACE\windows-installer\0001-win-Fix-warning-build-issue.patch" - if ($LASTEXITCODE -ne 0) { throw "patch 0001 failed" } - git apply --verbose "$env:GITHUB_WORKSPACE\windows-installer\0002-windows-makefile-libdir-absolute.patch" - if ($LASTEXITCODE -ne 0) { throw "patch 0002 failed" } - git apply --verbose "$env:GITHUB_WORKSPACE\windows-installer\0001-3.1-Windows-Use-Z7-compiler-flag-to-enable-parallel-.patch" - if ($LASTEXITCODE -ne 0) { throw "jom patch failed" } - - name: Locate Visual Studio if: steps.fips_cache.outputs.cache-hit != 'true' shell: pwsh @@ -156,17 +144,9 @@ jobs: Start-Process -FilePath ".\$installer" -ArgumentList '/S' -Wait "C:\Program Files\NASM" | Out-File -FilePath "$env:GITHUB_PATH" -Append - - name: install jom - if: steps.fips_cache.outputs.cache-hit != 'true' - shell: pwsh - run: | - mkdir C:\jom - Invoke-WebRequest -Uri "https://openssl-library.org/ci-deps/jom-1.1.7.exe" -OutFile C:\jom\jom.exe - $expected = (Get-Content "$env:GITHUB_WORKSPACE\.github\ci-deps.json" -Raw | ConvertFrom-Json).'jom-1.1.7.exe' - $actual = (Get-FileHash C:\jom\jom.exe -Algorithm SHA256).Hash - if ($actual -ne $expected) { throw "SHA256 mismatch for jom.exe (expected $expected, got $actual)" } - "C:\jom" | Out-File -FilePath "$env:GITHUB_PATH" -Append - + # Built unpatched with nmake, as the release pipeline does. jom is not + # safe here: 3.5 still compiles with /Zi into shared .pdb files, and the + # result is cached per FIPS_REF, so the serial build runs once. - name: Build FIPS module (${{ matrix.target }}) if: steps.fips_cache.outputs.cache-hit != 'true' shell: cmd @@ -174,7 +154,7 @@ jobs: run: | call "%VCVARS%" perl Configure ${{ matrix.target }} enable-fips no-makedepend - jom /j4 /S + nmake /S - name: Save FIPS build cache if: steps.fips_cache.outputs.cache-hit != 'true' && inputs.pr == '' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 912c213..a0e22ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,3 @@ -# Patch files must remain byte-identical for `git apply`, so skip whitespace -# and EOF-fixing hooks against them. -exclude: '^windows-installer/.*\.patch$' - repos: - repo: https://github.com/asottile/reorder-python-imports rev: v3.16.0 diff --git a/tests/config.yaml b/tests/config.yaml index 536e620..1d1e26b 100644 --- a/tests/config.yaml +++ b/tests/config.yaml @@ -3,8 +3,8 @@ # in .github/workflows/test-installer.yml. fips: - # The current validated module - validated_versions: "3.1.2" + # The current validated module (FIPS 140-3 certificate #5586) + validated_versions: "3.5.9" paths: # x64 and arm64 packages diff --git a/tests/conftest.py b/tests/conftest.py index b3702a1..341b36c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -534,7 +534,7 @@ def repair(info: InstallerInfo) -> None: def supported_fips_type(info: InstallerInfo) -> str: """The FIPS module type a flavor offers: VS installers default to the - validated 3.1.2 module; hybrid installers only offer the current-version + validated module; hybrid installers only offer the current-version module (commit 63b0a77 disabled the validated option there, because the validated module is VC-WIN64A and would drag the VC++ runtime into an otherwise-HybridCRT install).""" diff --git a/tests/test_gui.py b/tests/test_gui.py index 6f50e7a..29832e8 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -305,7 +305,7 @@ def test_fips_requires_app(wizard: Wizard) -> None: @pytest.mark.skipif(os.getenv("CI") == "true", reason="GUI tests require interactive session") def test_fips_module_type_selector_matches_flavor(wizard: Wizard, installer: InstallerInfo) -> None: - """The FIPS module-type selector (validated 3.1.2 vs current) is offered + """The FIPS module-type selector (validated vs current) is offered only by the VS installers. Hybrid installers hide it and silently force the 'current' module (commit 63b0a77): the validated module is VC-WIN64A and would drag the VC++ runtime into an otherwise-HybridCRT install. @@ -321,7 +321,7 @@ def test_fips_module_type_selector_matches_flavor(wizard: Wizard, installer: Ins dlg = _click_and_advance(dlg, app) # components → additional options assert _current_static(dlg) == "Options to install" - # The "Validated module (3.1.2)" radio button; present+visible only on VS. + # The "Validated module ()" radio button; present+visible only on VS. validated = dlg.child_window(title_re="(?i).*validated.*") shown = validated.exists(timeout=5) and validated.is_visible() if installer.flavor == "hybrid": @@ -339,8 +339,8 @@ def test_full_ui_install(wizard: Wizard, installer: InstallerInfo, install_dir: The FIPS module type follows what each flavor offers in the UI: the hybrid installer has only the checkbox (module forced to the current version — the - validated 3.1.2 option is hidden, commit 63b0a77), while the VS installer - also shows the validated/current radio, where we pick the validated 3.1.2 + validated option is hidden, commit 63b0a77), while the VS installer + also shows the validated/current radio, where we pick the validated module. Completion is detected by polling the registry (openssl_product_installed), @@ -365,7 +365,7 @@ def test_full_ui_install(wizard: Wizard, installer: InstallerInfo, install_dir: if installer.flavor == "vs": # VS shows the module-type radio (enabled once FIPS is checked); - # select the validated 3.1.2 module. + # select the validated module. time.sleep(0.5) # let the radio group enable after checking FIPS dlg.child_window(title_re="(?i).*validated.*").click() expected_fips = config["fips"]["validated_versions"] diff --git a/tests/test_signed.py b/tests/test_signed.py index 3884da7..98e69f7 100644 --- a/tests/test_signed.py +++ b/tests/test_signed.py @@ -103,7 +103,7 @@ def installed_artifact(installer: InstallerInfo) -> Iterator[None]: binary the product can ship — then uninstall at session end. Used by tests that walk the install dir. - The FIPS module type follows the flavor: VS lays down the validated 3.1.2 + The FIPS module type follows the flavor: VS lays down the validated module, hybrid the current one. The validated module ships in the hybrid installer too but isn't installed on the supported path; it's the same VC-WIN64A binary the VS run already signature-checks, so nothing is lost.""" diff --git a/tests/test_silent_install.py b/tests/test_silent_install.py index 3adb2aa..95ecfde 100644 --- a/tests/test_silent_install.py +++ b/tests/test_silent_install.py @@ -25,12 +25,12 @@ from conftest import VS_BUILD_NAMES -# The validated FIPS module (3.1.2) is only offered by the VS installers. +# The validated FIPS module is only offered by the VS installers. # Commit 63b0a77 removed the option from the hybrid installers' UI because the # validated module is VC-WIN64A (it would pull the VC++ runtime into an # otherwise-HybridCRT install, deviating from the module's Security Policy). _HYBRID_VALIDATED_SKIP = ( - "validated 3.1.2 FIPS module is not offered in hybrid installers " + "validated FIPS module is not offered in hybrid installers " "(commit 63b0a77 hides the UI option); see test_fips_validated_option_disabled_in_hybrid" ) diff --git a/windows-installer/0001-3.1-Windows-Use-Z7-compiler-flag-to-enable-parallel-.patch b/windows-installer/0001-3.1-Windows-Use-Z7-compiler-flag-to-enable-parallel-.patch deleted file mode 100644 index 05c5be6..0000000 --- a/windows-installer/0001-3.1-Windows-Use-Z7-compiler-flag-to-enable-parallel-.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 34fa3b603557c6e47d6b5203638512f472c7f4f8 Mon Sep 17 00:00:00 2001 -From: Norbert Pocs -Date: Tue, 9 Jun 2026 11:12:54 +0200 -Subject: [PATCH] [3.1] Windows: Use /Z7 compiler flag to enable parallel - builds -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -MSVC compilation on Windows cannot be reliably parallelized -with tools like jom (an nmake replacement) due to contention -on shared .pdb files used for debug info. Writes to a shared -.pdb must be serialized. - -The /FS compiler flag serializes concurrent compiler writes, -but does not resolve contention when the compiler and linker -access the same .pdb file. With shared .pdb files (e.g. app.pdb), -the makefile does not prevent races between the linker and -compilation of multiple targets. - -This can be resolved either by restructuring the makefile -to introduce sentinel dependencies that serialize the conflicting -steps, or by eliminating the shared .pdb entirely. - -This patch takes the latter approach: it replaces /Zi with /Z7, -which embeds debug info directly into each .obj file and avoids -any shared-file contention. /Z7 is supported by all MSVC versions. - -The linker-generated .pdb is unaffected. - -Side effects: object files are slightly larger, and all .pdb files -are now named after their target — the shared app.pdb, ossl_static.pdb, -and dso.pdb no longer exist. - -With this change, jom can be used to parallelize the build. - -Fixes: #9931 - -Signed-off-by: Milan Broz ---- - Configurations/10-main.conf | 6 +++--- - Configurations/windows-makefile.tmpl | 4 +--- - 2 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf -index de3f683126..5f3717d7b3 100644 ---- a/Configurations/10-main.conf -+++ b/Configurations/10-main.conf -@@ -1454,10 +1454,10 @@ my %targets = ( - "UNICODE", "_UNICODE", - "_CRT_SECURE_NO_DEPRECATE", - "_WINSOCK_DEPRECATED_NO_WARNINGS"), -- lib_cflags => add("/Zi /Fdossl_static.pdb"), -+ lib_cflags => add("/Z7"), - lib_defines => add("L_ENDIAN"), -- dso_cflags => "/Zi /Fddso.pdb", -- bin_cflags => "/Zi /Fdapp.pdb", -+ dso_cflags => "/Z7", -+ bin_cflags => "/Z7", - # def_flag made to empty string so a .def file gets generated - shared_defflag => '', - shared_ldflag => "/dll", -diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl -index 504e4bc803..fd32f7fb58 100644 ---- a/Configurations/windows-makefile.tmpl -+++ b/Configurations/windows-makefile.tmpl -@@ -461,7 +461,7 @@ uninstall: uninstall_docs uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips - - libclean: - "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """{.,apps,test,fuzz}/$$1.*"""; } @ARGV" $(SHLIBS) -- -del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb -+ -del /Q /F $(LIBS) libcrypto.* libssl.* - - clean: libclean - {- join("\n\t", map { "-del /Q /F $_" } @HTMLDOCS1) || "\@rem" -} -@@ -557,8 +557,6 @@ install_dev: install_runtime_libs - "$(INSTALLTOP)\include\openssl" - @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)" - @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)" -- @if "$(SHLIBS)"=="" \ -- "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)" - - uninstall_dev: - --- -2.54.0 - diff --git a/windows-installer/0001-win-Fix-warning-build-issue.patch b/windows-installer/0001-win-Fix-warning-build-issue.patch deleted file mode 100644 index d30619f..0000000 --- a/windows-installer/0001-win-Fix-warning-build-issue.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 7af1798ad07ded2e39b0ce60544c382c9919e35d Mon Sep 17 00:00:00 2001 -From: Norbert Pocs -Date: Tue, 17 Feb 2026 02:34:12 -0800 -Subject: [PATCH] win: Fix warning build issue - ---- - test/build_wincrypt_test.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/test/build_wincrypt_test.c b/test/build_wincrypt_test.c -index 5bd75e6a..25fd9d93 100644 ---- a/test/build_wincrypt_test.c -+++ b/test/build_wincrypt_test.c -@@ -22,7 +22,11 @@ - # include - # ifndef X509_NAME - # ifndef PEDANTIC --# warning "wincrypt.h no longer defining X509_NAME before OpenSSL headers" -+# ifdef _MSC_VER -+# pragma message("wincrypt.h no longer defining X509_NAME before OpenSSL headers") -+# else -+# warning "wincrypt.h no longer defining X509_NAME before OpenSSL headers" -+# endif - # endif - # endif - #endif --- -2.53.0.windows.1 diff --git a/windows-installer/0002-windows-makefile-libdir-absolute.patch b/windows-installer/0002-windows-makefile-libdir-absolute.patch deleted file mode 100644 index 2ba03a8..0000000 --- a/windows-installer/0002-windows-makefile-libdir-absolute.patch +++ /dev/null @@ -1,39 +0,0 @@ -From d130c5f74873b3aad74f58bd7d0fdea0fb16397c Mon Sep 17 00:00:00 2001 -From: Norbert Pocs -Date: Thu, 8 Jan 2026 16:11:10 +0100 -Subject: [PATCH] windows-makefile: Don't prefix libdir when it is absolute - path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When --libdir was passed to configuration as an absolute path then -the makefile MODULESDIR_dir became concat(prefix, libdir) creating -an invalid path. - -Fixes: https://github.com/openssl/project/issues/1797 - -Signed-off-by: Norbert Pocs - -Reviewed-by: Saša Nedvědický -Reviewed-by: Richard Levitte -(Merged from https://github.com/openssl/openssl/pull/29579) ---- - Configurations/windows-makefile.tmpl | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl -index 408b571d66..e9f985f855 100644 ---- a/Configurations/windows-makefile.tmpl -+++ b/Configurations/windows-makefile.tmpl -@@ -208,7 +208,7 @@ OPENSSLDIR_dir={- canonpath($openssldir_dir) -} - LIBDIR={- our $libdir = $config{libdir} || "lib"; - file_name_is_absolute($libdir) ? "" : $libdir -} - MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath); -- our $modulesprefix = catdir($prefix,$libdir); -+ our $modulesprefix = file_name_is_absolute($libdir) ? $libdir : catdir($prefix,$libdir); - our ($modulesprefix_dev, $modulesprefix_dir, - $modulesprefix_file) = - splitpath($modulesprefix, 1); --- -2.52.0 diff --git a/windows-installer/README.md b/windows-installer/README.md index 0a1040d..2a9c494 100644 --- a/windows-installer/README.md +++ b/windows-installer/README.md @@ -42,6 +42,7 @@ For HybridCRT flavour to work on older versions than Windows 10, the Universal C * **FIPS provider** * Optionally installs the FIPS provider. You can choose either the FIPS-validated OpenSSL FIPS provider version or the provider that comes with the current library version. + The FIPS-validated version is 3.5.9 ([FIPS 140-3 certificate #5586](https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/5586)). The FIPS provider cannot be installed without the application (`openssl.exe`), as the application is required to generate the `fipsmodule.cnf` file. For the Hybrid CRT variant, only the FIPS provider of the current OpenSSL library version is available (there is no FIPS-validated version). diff --git a/windows-installer/installer_automatization.ps1 b/windows-installer/installer_automatization.ps1 index 456447c..b926049 100644 --- a/windows-installer/installer_automatization.ps1 +++ b/windows-installer/installer_automatization.ps1 @@ -5,7 +5,7 @@ if (-not $opensslInstallVersionBranch) { $versionBranch = $opensslInstallVersionBranch } if (-not $opensslInstallFipsVersionBranch) { - $fipsVersionBranch = "openssl-3.1.2" + $fipsVersionBranch = "openssl-3.5.9" } else { $fipsVersionBranch = $opensslInstallFipsVersionBranch } @@ -33,12 +33,6 @@ function Build-Openssl { ) git clone --depth 1 -b $branch $gitUrl $dir pushd $dir - # 3.1.2 does not build on windows without this patch - # TODO patches do not apply probably because of win style new line - if ($branch -eq "openssl-3.1.2") { - git apply "$PSScriptRoot\0001-win-Fix-warning-build-issue.patch" - git apply "$PSScriptRoot\0002-windows-makefile-libdir-absolute.patch" - } cmd /c '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && perl .\Configure enable-fips $extra_config_options VC-WIN64A' cmd /c '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" && nmake' if ($branch -ne $fipsVersionBranch) { diff --git a/windows-installer/openssl.aip b/windows-installer/openssl.aip index d13c137..d2b1e9d 100644 --- a/windows-installer/openssl.aip +++ b/windows-installer/openssl.aip @@ -787,7 +787,7 @@ - +