descrip.mms.tmpl: Add a target to install the FIPS module config
authorRichard Levitte <levitte@openssl.org>
Tue, 29 Sep 2020 16:31:58 +0000 (18:31 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 8 Oct 2020 09:29:23 +0000 (11:29 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13032)

Configurations/descrip.mms.tmpl

index b30d08b53a2db66ed1d0a1003ee1688c0ea24d12..a2f3293c5466d72496975c1c79614287e234ca65 100644 (file)
@@ -121,6 +121,13 @@ SHLIB_TARGET={- $target{shared_target} -}
 
 LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @libs) -}
 SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
+FIPSMODULENAME={- # We do some extra checking here, as there should be only one
+                  my @fipsmodules =
+                      grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+                             && $unified_info{attributes}->{modules}->{$_}->{fips} }
+                      @{$unified_info{modules}};
+                  die "More that one FIPS module" if scalar @fipsmodules > 1;
+                  join(", ", map { basename platform->dso($_) } @fipsmodules) -}
 MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{modules}}) -}
 PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
 SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
@@ -539,6 +546,18 @@ install_docs : install_html_docs
 
 uninstall_docs : uninstall_html_docs
 
+install_fips: install_sw
+       @ WRITE SYS$OUTPUT "*** Installing FIPS module configuration"
+       @ WRITE SYS$OUTPUT "fipsinstall $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf"
+       openssl fipsinstall -
+               -module ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']$(FIPSMODULENAME) -
+               -out ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']$(FIPSMODULENAME).cnf -
+               -macopt "key:$(FIPSKEY)"
+
+uninstall_fips: uninstall_sw
+       @ WRITE SYS$OUTPUT "*** Uninstalling FIPS module configuration"
+       DELETE ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']$(FIPSMODULENAME).cnf;*
+
 install_ssldirs : check_INSTALLTOP
         - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
         IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -