Blame SOURCES/0034.fipsinstall_disable.patch

bf760f
diff -up openssl-3.0.0/apps/fipsinstall.c.xxx openssl-3.0.0/apps/fipsinstall.c
bf760f
--- openssl-3.0.0/apps/fipsinstall.c.xxx	2021-11-22 13:09:28.232560235 +0100
bf760f
+++ openssl-3.0.0/apps/fipsinstall.c	2021-11-22 13:12:22.272058910 +0100
bf760f
@@ -311,6 +311,9 @@ int fipsinstall_main(int argc, char **ar
bf760f
     EVP_MAC *mac = NULL;
bf760f
     CONF *conf = NULL;
bf760f
 
bf760f
+    BIO_printf(bio_err, "This command is not enabled in the Red Hat Enterprise Linux OpenSSL build, please consult Red Hat documentation to learn how to enable FIPS mode\n");
bf760f
+    return 1;
bf760f
+
bf760f
     if ((opts = sk_OPENSSL_STRING_new_null()) == NULL)
bf760f
         goto end;
bf760f
 
bf760f
diff -up openssl-3.0.0/doc/man1/openssl.pod.xxx openssl-3.0.0/doc/man1/openssl.pod
bf760f
--- openssl-3.0.0/doc/man1/openssl.pod.xxx	2021-11-22 13:18:51.081406990 +0100
bf760f
+++ openssl-3.0.0/doc/man1/openssl.pod	2021-11-22 13:19:02.897508738 +0100
bf760f
@@ -158,10 +158,6 @@ Engine (loadable module) information and
bf760f
 
bf760f
 Error Number to Error String Conversion.
bf760f
 
bf760f
-=item B<fipsinstall>
bf760f
-
bf760f
-FIPS configuration installation.
bf760f
-
bf760f
 =item B<gendsa>
bf760f
 
bf760f
 Generation of DSA Private Key from Parameters. Superseded by
bf760f
diff -up openssl-3.0.0/doc/man5/config.pod.xxx openssl-3.0.0/doc/man5/config.pod
bf760f
--- openssl-3.0.0/doc/man5/config.pod.xxx	2021-11-22 13:24:51.359509501 +0100
bf760f
+++ openssl-3.0.0/doc/man5/config.pod	2021-11-22 13:26:02.360121820 +0100
bf760f
@@ -573,7 +573,6 @@ configuration files using that syntax wi
bf760f
 =head1 SEE ALSO
bf760f
 
bf760f
 L<openssl-x509(1)>, L<openssl-req(1)>, L<openssl-ca(1)>,
bf760f
-L<openssl-fipsinstall(1)>,
bf760f
 L<ASN1_generate_nconf(3)>,
bf760f
 L<EVP_set_default_properties(3)>,
bf760f
 L<CONF_modules_load(3)>,
bf760f
diff -up openssl-3.0.0/doc/man5/fips_config.pod.xxx openssl-3.0.0/doc/man5/fips_config.pod
bf760f
--- openssl-3.0.0/doc/man5/fips_config.pod.xxx	2021-11-22 13:21:13.812636065 +0100
bf760f
+++ openssl-3.0.0/doc/man5/fips_config.pod	2021-11-22 13:24:12.278172847 +0100
bf760f
@@ -6,106 +6,10 @@ fips_config - OpenSSL FIPS configuration
bf760f
 
bf760f
 =head1 DESCRIPTION
bf760f
 
bf760f
-A separate configuration file, using the OpenSSL L<config(5)> syntax,
bf760f
-is used to hold information about the FIPS module. This includes a digest
bf760f
-of the shared library file, and status about the self-testing.
bf760f
-This data is used automatically by the module itself for two
bf760f
-purposes:
bf760f
-
bf760f
-=over 4
bf760f
-
bf760f
-=item - Run the startup FIPS self-test known answer tests (KATS).
bf760f
-
bf760f
-This is normally done once, at installation time, but may also be set up to
bf760f
-run each time the module is used.
bf760f
-
bf760f
-=item - Verify the module's checksum.
bf760f
-
bf760f
-This is done each time the module is used.
bf760f
-
bf760f
-=back
bf760f
-
bf760f
-This file is generated by the L<openssl-fipsinstall(1)> program, and
bf760f
-used internally by the FIPS module during its initialization.
bf760f
-
bf760f
-The following options are supported. They should all appear in a section
bf760f
-whose name is identified by the B<fips> option in the B<providers>
bf760f
-section, as described in L<config(5)/Provider Configuration Module>.
bf760f
-
bf760f
-=over 4
bf760f
-
bf760f
-=item B<activate>
bf760f
-
bf760f
-If present, the module is activated. The value assigned to this name is not
bf760f
-significant.
bf760f
-
bf760f
-=item B<install-version>
bf760f
-
bf760f
-A version number for the fips install process. Should be 1.
bf760f
-
bf760f
-=item B<conditional-errors>
bf760f
-
bf760f
-The FIPS module normally enters an internal error mode if any self test fails.
bf760f
-Once this error mode is active, no services or cryptographic algorithms are
bf760f
-accessible from this point on.
bf760f
-Continuous tests are a subset of the self tests (e.g., a key pair test during key
bf760f
-generation, or the CRNG output test).
bf760f
-Setting this value to C<0> allows the error mode to not be triggered if any
bf760f
-continuous test fails. The default value of C<1> will trigger the error mode.
bf760f
-Regardless of the value, the operation (e.g., key generation) that called the
bf760f
-continuous test will return an error code if its continuous test fails. The
bf760f
-operation may then be retried if the error mode has not been triggered.
bf760f
-
bf760f
-=item B<security-checks>
bf760f
-
bf760f
-This indicates if run-time checks related to enforcement of security parameters
bf760f
-such as minimum security strength of keys and approved curve names are used.
bf760f
-A value of '1' will perform the checks, otherwise if the value is '0' the checks
bf760f
-are not performed and FIPS compliance must be done by procedures documented in
bf760f
-the relevant Security Policy.
bf760f
-
bf760f
-=item B<module-mac>
bf760f
-
bf760f
-The calculated MAC of the FIPS provider file.
bf760f
-
bf760f
-=item B<install-status>
bf760f
-
bf760f
-An indicator that the self-tests were successfully run.
bf760f
-This should only be written after the module has
bf760f
-successfully passed its self tests during installation.
bf760f
-If this field is not present, then the self tests will run when the module
bf760f
-loads.
bf760f
-
bf760f
-=item B<install-mac>
bf760f
-
bf760f
-A MAC of the value of the B<install-status> option, to prevent accidental
bf760f
-changes to that value.
bf760f
-It is written-to at the same time as B<install-status> is updated.
bf760f
-
bf760f
-=back
bf760f
-
bf760f
-For example:
bf760f
-
bf760f
- [fips_sect]
bf760f
- activate = 1
bf760f
- install-version = 1
bf760f
- conditional-errors = 1
bf760f
- security-checks = 1
bf760f
- module-mac = 41:D0:FA:C2:5D:41:75:CD:7D:C3:90:55:6F:A4:DC
bf760f
- install-mac = FE:10:13:5A:D3:B4:C7:82:1B:1E:17:4C:AC:84:0C
bf760f
- install-status = INSTALL_SELF_TEST_KATS_RUN
bf760f
-
bf760f
-=head1 NOTES
bf760f
-
bf760f
-When using the FIPS provider, it is recommended that the
bf760f
-B<config_diagnostics> option is enabled to prevent accidental use of
bf760f
-non-FIPS validated algorithms via broken or mistaken configuration.
bf760f
-See L<config(5)>.
bf760f
-
bf760f
-=head1 SEE ALSO
bf760f
-
bf760f
-L<config(5)>
bf760f
-L<openssl-fipsinstall(1)>
bf760f
+This command is disabled in Red Hat Enterprise Linux. The FIPS provider is
bf760f
+automatically loaded when the system is booted in FIPS mode, or when the
bf760f
+environment variable B<OPENSSL_FORCE_FIPS_MODE> is set. See the documentation
bf760f
+for more information.
bf760f
 
bf760f
 =head1 COPYRIGHT
bf760f
 
bf760f
diff -up openssl-3.0.0/doc/man7/OSSL_PROVIDER-FIPS.pod.xxx openssl-3.0.0/doc/man7/OSSL_PROVIDER-FIPS.pod
bf760f
--- openssl-3.0.0/doc/man7/OSSL_PROVIDER-FIPS.pod.xxx	2021-11-22 13:18:13.850086386 +0100
bf760f
+++ openssl-3.0.0/doc/man7/OSSL_PROVIDER-FIPS.pod	2021-11-22 13:18:24.607179038 +0100
bf760f
@@ -388,7 +388,6 @@ A simple self test callback is shown bel
bf760f
 
bf760f
 =head1 SEE ALSO
bf760f
 
bf760f
-L<openssl-fipsinstall(1)>,
bf760f
 L<fips_config(5)>,
bf760f
 L<OSSL_SELF_TEST_set_callback(3)>,
bf760f
 L<OSSL_SELF_TEST_new(3)>,
bf760f
diff -up openssl-3.0.1/doc/man1/openssl-fipsinstall.pod.in.embed-hmac openssl-3.0.1/doc/man1/openssl-fipsinstall.pod.in
bf760f
--- openssl-3.0.1/doc/man1/openssl-fipsinstall.pod.in.embed-hmac	2022-01-11 13:26:33.279906225 +0100
bf760f
+++ openssl-3.0.1/doc/man1/openssl-fipsinstall.pod.in	2022-01-11 13:33:18.757994419 +0100
bf760f
@@ -8,236 +8,11 @@ openssl-fipsinstall - perform FIPS confi
bf760f
 =head1 SYNOPSIS
bf760f
 
bf760f
 B<openssl fipsinstall>
bf760f
-[B<-help>]
bf760f
-[B<-in> I<configfilename>]
bf760f
-[B<-out> I<configfilename>]
bf760f
-[B<-module> I<modulefilename>]
bf760f
-[B<-provider_name> I<providername>]
bf760f
-[B<-section_name> I<sectionname>]
bf760f
-[B<-verify>]
bf760f
-[B<-mac_name> I<macname>]
bf760f
-[B<-macopt> I<nm>:I<v>]
bf760f
-[B<-noout>]
bf760f
-[B<-quiet>]
bf760f
-[B<-no_conditional_errors>]
bf760f
-[B<-no_security_checks>]
bf760f
-[B<-self_test_onload>]
bf760f
-[B<-corrupt_desc> I<selftest_description>]
bf760f
-[B<-corrupt_type> I<selftest_type>]
bf760f
-[B<-config> I<parent_config>]
bf760f
 
bf760f
 =head1 DESCRIPTION
bf760f
-
bf760f
-This command is used to generate a FIPS module configuration file.
bf760f
-This configuration file can be used each time a FIPS module is loaded
bf760f
-in order to pass data to the FIPS module self tests. The FIPS module always
bf760f
-verifies its MAC, but optionally only needs to run the KAT's once,
bf760f
-at installation.
bf760f
-
bf760f
-The generated configuration file consists of:
bf760f
-
bf760f
-=over 4
bf760f
-
bf760f
-=item - A MAC of the FIPS module file.
bf760f
-
bf760f
-=item - A test status indicator.
bf760f
-
bf760f
-This indicates if the Known Answer Self Tests (KAT's) have successfully run.
bf760f
-
bf760f
-=item - A MAC of the status indicator.
bf760f
-
bf760f
-=item - A control for conditional self tests errors.
bf760f
-
bf760f
-By default if a continuous test (e.g a key pair test) fails then the FIPS module
bf760f
-will enter an error state, and no services or cryptographic algorithms will be
bf760f
-able to be accessed after this point.
bf760f
-The default value of '1' will cause the fips module error state to be entered.
bf760f
-If the value is '0' then the module error state will not be entered.
bf760f
-Regardless of whether the error state is entered or not, the current operation
bf760f
-(e.g. key generation) will return an error. The user is responsible for retrying
bf760f
-the operation if the module error state is not entered.
bf760f
-
bf760f
-=item - A control to indicate whether run-time security checks are done.
bf760f
-
bf760f
-This indicates if run-time checks related to enforcement of security parameters
bf760f
-such as minimum security strength of keys and approved curve names are used.
bf760f
-The default value of '1' will perform the checks.
bf760f
-If the value is '0' the checks are not performed and FIPS compliance must
bf760f
-be done by procedures documented in the relevant Security Policy.
bf760f
-
bf760f
-=back
bf760f
-
bf760f
-This file is described in L<fips_config(5)>.
bf760f
-
bf760f
-=head1 OPTIONS
bf760f
-
bf760f
-=over 4
bf760f
-
bf760f
-=item B<-help>
bf760f
-
bf760f
-Print a usage message.
bf760f
-
bf760f
-=item B<-module> I<filename>
bf760f
-
bf760f
-Filename of the FIPS module to perform an integrity check on.
bf760f
-The path provided in the filename is used to load the module when it is
bf760f
-activated, and this overrides the environment variable B<OPENSSL_MODULES>.
bf760f
-
bf760f
-=item B<-out> I<configfilename>
bf760f
-
bf760f
-Filename to output the configuration data to; the default is standard output.
bf760f
-
bf760f
-=item B<-in> I<configfilename>
bf760f
-
bf760f
-Input filename to load configuration data from.
bf760f
-Must be used if the B<-verify> option is specified.
bf760f
-
bf760f
-=item B<-verify>
bf760f
-
bf760f
-Verify that the input configuration file contains the correct information.
bf760f
-
bf760f
-=item B<-provider_name> I<providername>
bf760f
-
bf760f
-Name of the provider inside the configuration file.
bf760f
-The default value is C<fips>.
bf760f
-
bf760f
-=item B<-section_name> I<sectionname>
bf760f
-
bf760f
-Name of the section inside the configuration file.
bf760f
-The default value is C<fips_sect>.
bf760f
-
bf760f
-=item B<-mac_name> I<name>
bf760f
-
bf760f
-Specifies the name of a supported MAC algorithm which will be used.
bf760f
-The MAC mechanisms that are available will depend on the options
bf760f
-used when building OpenSSL.
bf760f
-To see the list of supported MAC's use the command
bf760f
-C<openssl list -mac-algorithms>.  The default is B<HMAC>.
bf760f
-
bf760f
-=item B<-macopt> I<nm>:I<v>
bf760f
-
bf760f
-Passes options to the MAC algorithm.
bf760f
-A comprehensive list of controls can be found in the EVP_MAC implementation
bf760f
-documentation.
bf760f
-Common control strings used for this command are:
bf760f
-
bf760f
-=over 4
bf760f
-
bf760f
-=item B<key>:I<string>
bf760f
-
bf760f
-Specifies the MAC key as an alphanumeric string (use if the key contains
bf760f
-printable characters only).
bf760f
-The string length must conform to any restrictions of the MAC algorithm.
bf760f
-A key must be specified for every MAC algorithm.
bf760f
-If no key is provided, the default that was specified when OpenSSL was
bf760f
-configured is used.
bf760f
-
bf760f
-=item B<hexkey>:I<string>
bf760f
-
bf760f
-Specifies the MAC key in hexadecimal form (two hex digits per byte).
bf760f
-The key length must conform to any restrictions of the MAC algorithm.
bf760f
-A key must be specified for every MAC algorithm.
bf760f
-If no key is provided, the default that was specified when OpenSSL was
bf760f
-configured is used.
bf760f
-
bf760f
-=item B<digest>:I<string>
bf760f
-
bf760f
-Used by HMAC as an alphanumeric string (use if the key contains printable
bf760f
-characters only).
bf760f
-The string length must conform to any restrictions of the MAC algorithm.
bf760f
-To see the list of supported digests, use the command
bf760f
-C<openssl list -digest-commands>.
bf760f
-The default digest is SHA-256.
bf760f
-
bf760f
-=back
bf760f
-
bf760f
-=item B<-noout>
bf760f
-
bf760f
-Disable logging of the self tests.
bf760f
-
bf760f
-=item B<-no_conditional_errors>
bf760f
-
bf760f
-Configure the module to not enter an error state if a conditional self test
bf760f
-fails as described above.
bf760f
-
bf760f
-=item B<-no_security_checks>
bf760f
-
bf760f
-Configure the module to not perform run-time security checks as described above.
bf760f
-
bf760f
-=item B<-self_test_onload>
bf760f
-
bf760f
-Do not write the two fields related to the "test status indicator" and
bf760f
-"MAC status indicator" to the output configuration file. Without these fields
bf760f
-the self tests KATS will run each time the module is loaded. This option could be
bf760f
-used for cross compiling, since the self tests need to run at least once on each
bf760f
-target machine. Once the self tests have run on the target machine the user
bf760f
-could possibly then add the 2 fields into the configuration using some other
bf760f
-mechanism.
bf760f
-
bf760f
-=item B<-quiet>
bf760f
-
bf760f
-Do not output pass/fail messages. Implies B<-noout>.
bf760f
-
bf760f
-=item B<-corrupt_desc> I<selftest_description>,
bf760f
-B<-corrupt_type> I<selftest_type>
bf760f
-
bf760f
-The corrupt options can be used to test failure of one or more self tests by
bf760f
-name.
bf760f
-Either option or both may be used to select the tests to corrupt.
bf760f
-Refer to the entries for B<st-desc> and B<st-type> in L<OSSL_PROVIDER-FIPS(7)> for
bf760f
-values that can be used.
bf760f
-
bf760f
-=item B<-config> I<parent_config>
bf760f
-
bf760f
-Test that a FIPS provider can be loaded from the specified configuration file.
bf760f
-A previous call to this application needs to generate the extra configuration
bf760f
-data that is included by the base C<parent_config> configuration file.
bf760f
-See L<config(5)> for further information on how to set up a provider section.
bf760f
-All other options are ignored if '-config' is used.
bf760f
-
bf760f
-=back
bf760f
-
bf760f
-=head1 NOTES
bf760f
-
bf760f
-Self tests results are logged by default if the options B<-quiet> and B<-noout>
bf760f
-are not specified, or if either of the options B<-corrupt_desc> or
bf760f
-B<-corrupt_type> are used.
bf760f
-If the base configuration file is set up to autoload the fips module, then the
bf760f
-fips module will be loaded and self tested BEFORE the fipsinstall application
bf760f
-has a chance to set up its own self test callback. As a result of this the self
bf760f
-test output and the options B<-corrupt_desc> and B<-corrupt_type> will be ignored.
bf760f
-For normal usage the base configuration file should use the default provider
bf760f
-when generating the fips configuration file.
bf760f
-
bf760f
-=head1 EXAMPLES
bf760f
-
bf760f
-Calculate the mac of a FIPS module F<fips.so> and run a FIPS self test
bf760f
-for the module, and save the F<fips.cnf> configuration file:
bf760f
-
bf760f
- openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips
bf760f
-
bf760f
-Verify that the configuration file F<fips.cnf> contains the correct info:
bf760f
-
bf760f
- openssl fipsinstall -module ./fips.so -in fips.cnf  -provider_name fips -verify
bf760f
-
bf760f
-Corrupt any self tests which have the description C<SHA1>:
bf760f
-
bf760f
- openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips \
bf760f
-         -corrupt_desc 'SHA1'
bf760f
-
bf760f
-Validate that the fips module can be loaded from a base configuration file:
bf760f
-
bf760f
- export OPENSSL_CONF_INCLUDE=<path of configuration files>
bf760f
- export OPENSSL_MODULES=<provider-path>
bf760f
- openssl fipsinstall -config' 'default.cnf'
bf760f
-
bf760f
-
bf760f
-=head1 SEE ALSO
bf760f
-
bf760f
-L<config(5)>,
bf760f
-L<fips_config(5)>,
bf760f
-L<OSSL_PROVIDER-FIPS(7)>,
bf760f
-L<EVP_MAC(3)>
bf760f
+This command is disabled.
bf760f
+Please consult Red Hat Enterprise Linux documentation to learn how to correctly
bf760f
+enable FIPS mode on Red Hat Enterprise
bf760f
 
bf760f
 =head1 COPYRIGHT
bf760f