Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Build cryptography against embedded OpenSSL for FIPS Windows Agent" #34748

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitlab/package_build/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
-e AGENT_FLAVOR=${AGENT_FLAVOR}
-e OMNIBUS_SOFTWARE_VERSION="${OMNIBUS_SOFTWARE_VERSION}"
-e OMNIBUS_RUBY_VERSION="${OMNIBUS_RUBY_VERSION}"
-e PYTHONUTF8=1
${WINBUILDIMAGE}
powershell -C "c:\mnt\tasks\winbuildscripts\Build-AgentPackages.ps1 -BuildOutOfSource 1 -InstallDeps 1 -CheckGoVersion 1 -BuildUpgrade 1"
- If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" }
Expand Down
26 changes: 2 additions & 24 deletions omnibus/config/software/datadog-agent-integrations-py3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@
# This is intended as a temporary kludge while we make a decision on how to handle the multiplicity
# of openssl copies in a more general way while keeping risk low.
if fips_mode?
if linux_target?
block "Patch cryptography's openssl linking" do
block "Patch cryptography's openssl linking" do
if linux_target?
# We delete the libraries shipped with the wheel and replace references to those names
# in the binary that references it using patchelf
cryptography_folder = "#{site_packages_path}/cryptography"
Expand All @@ -284,28 +284,6 @@
shellout! "patchelf --add-rpath #{install_dir}/embedded/lib #{so_to_patch}"
FileUtils.rm([libssl_match, libcrypto_match])
end
elsif windows_target?
dll_folder = File.join(install_dir, "embedded3", "DLLS")
# Build the cryptography library in this case so that it gets linked to Agent's OpenSSL
# We first need to copy some files around (we need the .lib files for building)
copy File.join(install_dir, "embedded3", "lib", "libssl.dll.a"),
File.join(dll_folder, "libssl-3-x64.lib")
copy File.join(install_dir, "embedded3", "lib", "libcrypto.dll.a"),
File.join(dll_folder, "libcrypto-3-x64.lib")

command "#{python} -m pip install --force-reinstall --no-deps --no-binary cryptography cryptography==43.0.1",
env: {
"OPENSSL_LIB_DIR" => dll_folder,
"OPENSSL_INCLUDE_DIR" => File.join(install_dir, "embedded3", "include"),
"OPENSSL_LIBS" => "libssl-3-x64:libcrypto-3-x64",
}
# Python extensions on windows require this to find their DLL dependencies,
# we abuse the `.pth` loading system to inject it
block "Inject dll path for Python extensions" do
File.open(File.join(install_dir, "embedded3", "lib", "site-packages", "add-dll-directory.pth"), "w") do |f|
f.puts 'import os; os.add_dll_directory(os.path.abspath(os.path.join(__file__, "..", "..", "DLLS")))'
end
end
end
end

Expand Down
Loading