From 5b689181853ca6d240d756cd7d65678124838b11 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias St. Pierre" Date: Thu, 7 Jan 2021 18:47:01 +0100 Subject: Configure/Makefile: separate install of the FIPS module Fixes #13693 Co-authored-by: Richard Levitte Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/13684) --- Configurations/unix-Makefile.tmpl | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'Configurations/unix-Makefile.tmpl') diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index 9d5bfe0bd1..778c198972 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -164,12 +164,21 @@ INSTALL_ENGINES={- && $unified_info{attributes}->{modules}->{$_}->{engine} } @{$unified_info{modules}})) -} +INSTALL_FIPS={- + join(" \\\n" . ' ' x 16, + fill_lines(" ", $COLUMNS - 16, + map { platform->dso($_) } + grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} + && $unified_info{attributes}->{modules}->{$_}->{fips} } + @{$unified_info{modules}})) +-} INSTALL_MODULES={- join(" \\\n" . ' ' x 16, fill_lines(" ", $COLUMNS - 16, map { platform->dso($_) } grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} - && !$unified_info{attributes}->{modules}->{$_}->{engine} } + && !$unified_info{attributes}->{modules}->{$_}->{engine} + && !$unified_info{attributes}->{modules}->{$_}->{fips} } @{$unified_info{modules}})) -} INSTALL_PROGRAMS={- @@ -585,7 +594,15 @@ install_docs: install_man_docs install_html_docs uninstall_docs: uninstall_man_docs uninstall_html_docs $(RM) -r $(DESTDIR)$(DOCDIR) -install_fips: install_sw +install_fips: + @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) + @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR) + @$(ECHO) "*** Installing FIPS module" + @$(ECHO) "install $(INSTALL_FIPS) -> $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)" + @cp "$(INSTALL_FIPS)" $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new + @chmod 755 $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new + @mv -f $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new \ + $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME) @$(ECHO) "*** Installing FIPS module configuration" @$(ECHO) "fipsinstall $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf" @$(PERL) $(BLDDIR)/util/wrap.pl $(BLDDIR)/apps/openssl fipsinstall \ @@ -593,9 +610,11 @@ install_fips: install_sw -out $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf \ -macopt 'hexkey:$(FIPSKEY)' -uninstall_fips: uninstall_sw +uninstall_fips: @$(ECHO) "*** Uninstalling FIPS module configuration" $(RM) $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf + @$(ECHO) "*** Uninstalling FIPS module" + $(RM) $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME) install_ssldirs: @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs -- cgit v1.2.3