Skip to content

Commit

Permalink
Configure/Makefile: don't generate a fresh fipsmodule.cnf when instal…
Browse files Browse the repository at this point in the history
…ling it

There is already a `providers/fipsmodule.cnf` target which is required by
the tests. Instead of creating another fipsmodule.cnf, the `install_fips`
target simply copies that configuration file to its final destination.

This commit also restores the minimal dependencies to build the `install_fips`
target immediately after configuring, which was broken after the removal
of the `install_sw` dependency.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#13684)
  • Loading branch information
mspncp committed Apr 29, 2021
1 parent 5b68918 commit 4e28270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions Configurations/unix-Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ install_docs: install_man_docs install_html_docs
uninstall_docs: uninstall_man_docs uninstall_html_docs
$(RM) -r $(DESTDIR)$(DOCDIR)

install_fips:
install_fips: build_sw providers/fipsmodule.cnf
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)
@$(ECHO) "*** Installing FIPS module"
Expand All @@ -604,11 +604,8 @@ install_fips:
@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 \
-module $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME) \
-out $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf \
-macopt 'hexkey:$(FIPSKEY)'
@$(ECHO) "install providers/fipsmodule.cnf -> $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf"
@cp providers/fipsmodule.cnf $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf

uninstall_fips:
@$(ECHO) "*** Uninstalling FIPS module configuration"
Expand Down
9 changes: 3 additions & 6 deletions Configurations/windows-makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ install_docs: install_html_docs

uninstall_docs: uninstall_html_docs

install_fips:
install_fips: build_sw providers\fipsmodule.cnf
# @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
@$(PERL) $(SRCDIR)\util\mkdir-p.pl $(MODULESDIR)
@$(ECHO) "*** Installing FIPS module"
Expand All @@ -486,11 +486,8 @@ install_fips:
@move /Y $(MODULESDIR)\$(FIPSMODULENAME).new \
$(MODULESDIR)\$(FIPSMODULENAME)
@$(ECHO) "*** Installing FIPS module configuration"
@$(ECHO) "fipsinstall $(OPENSSLDIR)\fipsmodule.cnf"
@$(PERL) "$(BLDDIR)\util\wrap.pl" "$(BLDDIR)\apps\openssl" fipsinstall \
-module "$(MODULESDIR)\$(FIPSMODULENAME)" \
-out "$(OPENSSLDIR)\fipsmodule.cnf" \
-macopt "hexkey:$(FIPSKEY)"
@$(ECHO) "install providers\fipsmodule.cnf -> $(OPENSSLDIR)\fipsmodule.cnf"
@copy providers\fipsmodule.cnf "$(OPENSSLDIR)\fipsmodule.cnf"

uninstall_fips:
@$(ECHO) "*** Uninstalling FIPS module configuration"
Expand Down

0 comments on commit 4e28270

Please sign in to comment.