Blame SOURCES/0034.fipsinstall_disable.patch

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