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

Update config options - FIPS provider for OpenSSL #1896

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
19 changes: 18 additions & 1 deletion config/software/openssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
if version.satisfies?("< 3.0.0")
configure_args += ["--with-fipsdir=#{install_dir}/embedded", "fips"] if fips_mode?
else
configure_args += ["-enable-fips"] if fips_mode?
configure_args += ["enable-fips"] if fips_mode?
end

configure_cmd =
Expand Down Expand Up @@ -205,4 +205,21 @@
command "sudo /usr/sbin/slibclean", env: env
end
make "install", env: env

if fips_mode?
# running the make install_fips step to install the FIPS provider
# make "install_fips", env: env

fips_cnf_file = "#{install_dir}/embedded/ssl/fipsmodule.cnf"
fips_module_file = "#{install_dir}/embedded/lib/ossl-modules/fips.#{windows? ? "dll" : "so"}"

# Running the `openssl fipsinstall -out fipsmodule.cnf -module fips.so` command
command "#{install_dir}/embedded/bin/openssl fipsinstall -out #{fips_cnf_file} -module #{fips_module_file}"

# Updating the openssl.cnf file to enable the fips provider
command "sed -i -e 's|# .include fipsmodule.cnf|.include #{fips_cnf_file}|g' #{install_dir}/embedded/ssl/openssl.cnf"
command "sed -i -e 's|# fips = fips_sect|fips = fips_sect|g' #{install_dir}/embedded/ssl/openssl.cnf"
end

# command "#{install_dir}/embedded/bin/openssl list -providers"
end