1b077aed3SPierre Pronchery=pod 2b077aed3SPierre Pronchery{- OpenSSL::safe::output_do_not_edit_headers(); -} 3b077aed3SPierre Pronchery 4b077aed3SPierre Pronchery=head1 NAME 5b077aed3SPierre Pronchery 6b077aed3SPierre Proncheryopenssl-fipsinstall - perform FIPS configuration installation 7b077aed3SPierre Pronchery 8b077aed3SPierre Pronchery=head1 SYNOPSIS 9b077aed3SPierre Pronchery 10b077aed3SPierre ProncheryB<openssl fipsinstall> 11b077aed3SPierre Pronchery[B<-help>] 12b077aed3SPierre Pronchery[B<-in> I<configfilename>] 13b077aed3SPierre Pronchery[B<-out> I<configfilename>] 14b077aed3SPierre Pronchery[B<-module> I<modulefilename>] 15b077aed3SPierre Pronchery[B<-provider_name> I<providername>] 16b077aed3SPierre Pronchery[B<-section_name> I<sectionname>] 17b077aed3SPierre Pronchery[B<-verify>] 18b077aed3SPierre Pronchery[B<-mac_name> I<macname>] 19b077aed3SPierre Pronchery[B<-macopt> I<nm>:I<v>] 20b077aed3SPierre Pronchery[B<-noout>] 21b077aed3SPierre Pronchery[B<-quiet>] 22b077aed3SPierre Pronchery[B<-no_conditional_errors>] 23b077aed3SPierre Pronchery[B<-no_security_checks>] 24b077aed3SPierre Pronchery[B<-self_test_onload>] 25b077aed3SPierre Pronchery[B<-corrupt_desc> I<selftest_description>] 26b077aed3SPierre Pronchery[B<-corrupt_type> I<selftest_type>] 27b077aed3SPierre Pronchery[B<-config> I<parent_config>] 28b077aed3SPierre Pronchery 29b077aed3SPierre Pronchery=head1 DESCRIPTION 30b077aed3SPierre Pronchery 31b077aed3SPierre ProncheryThis command is used to generate a FIPS module configuration file. 32b077aed3SPierre ProncheryThis configuration file can be used each time a FIPS module is loaded 33b077aed3SPierre Proncheryin order to pass data to the FIPS module self tests. The FIPS module always 34b077aed3SPierre Proncheryverifies its MAC, but optionally only needs to run the KAT's once, 35b077aed3SPierre Proncheryat installation. 36b077aed3SPierre Pronchery 37b077aed3SPierre ProncheryThe generated configuration file consists of: 38b077aed3SPierre Pronchery 39b077aed3SPierre Pronchery=over 4 40b077aed3SPierre Pronchery 41b077aed3SPierre Pronchery=item - A MAC of the FIPS module file. 42b077aed3SPierre Pronchery 43b077aed3SPierre Pronchery=item - A test status indicator. 44b077aed3SPierre Pronchery 45b077aed3SPierre ProncheryThis indicates if the Known Answer Self Tests (KAT's) have successfully run. 46b077aed3SPierre Pronchery 47b077aed3SPierre Pronchery=item - A MAC of the status indicator. 48b077aed3SPierre Pronchery 49b077aed3SPierre Pronchery=item - A control for conditional self tests errors. 50b077aed3SPierre Pronchery 51b077aed3SPierre ProncheryBy default if a continuous test (e.g a key pair test) fails then the FIPS module 52b077aed3SPierre Proncherywill enter an error state, and no services or cryptographic algorithms will be 53b077aed3SPierre Proncheryable to be accessed after this point. 54b077aed3SPierre ProncheryThe default value of '1' will cause the fips module error state to be entered. 55b077aed3SPierre ProncheryIf the value is '0' then the module error state will not be entered. 56b077aed3SPierre ProncheryRegardless of whether the error state is entered or not, the current operation 57b077aed3SPierre Pronchery(e.g. key generation) will return an error. The user is responsible for retrying 58b077aed3SPierre Proncherythe operation if the module error state is not entered. 59b077aed3SPierre Pronchery 60b077aed3SPierre Pronchery=item - A control to indicate whether run-time security checks are done. 61b077aed3SPierre Pronchery 62b077aed3SPierre ProncheryThis indicates if run-time checks related to enforcement of security parameters 63b077aed3SPierre Proncherysuch as minimum security strength of keys and approved curve names are used. 64b077aed3SPierre ProncheryThe default value of '1' will perform the checks. 65b077aed3SPierre ProncheryIf the value is '0' the checks are not performed and FIPS compliance must 66b077aed3SPierre Proncherybe done by procedures documented in the relevant Security Policy. 67b077aed3SPierre Pronchery 68b077aed3SPierre Pronchery=back 69b077aed3SPierre Pronchery 70b077aed3SPierre ProncheryThis file is described in L<fips_config(5)>. 71b077aed3SPierre Pronchery 72b077aed3SPierre Pronchery=head1 OPTIONS 73b077aed3SPierre Pronchery 74b077aed3SPierre Pronchery=over 4 75b077aed3SPierre Pronchery 76b077aed3SPierre Pronchery=item B<-help> 77b077aed3SPierre Pronchery 78b077aed3SPierre ProncheryPrint a usage message. 79b077aed3SPierre Pronchery 80b077aed3SPierre Pronchery=item B<-module> I<filename> 81b077aed3SPierre Pronchery 82b077aed3SPierre ProncheryFilename of the FIPS module to perform an integrity check on. 83b077aed3SPierre ProncheryThe path provided in the filename is used to load the module when it is 84b077aed3SPierre Proncheryactivated, and this overrides the environment variable B<OPENSSL_MODULES>. 85b077aed3SPierre Pronchery 86b077aed3SPierre Pronchery=item B<-out> I<configfilename> 87b077aed3SPierre Pronchery 88b077aed3SPierre ProncheryFilename to output the configuration data to; the default is standard output. 89b077aed3SPierre Pronchery 90b077aed3SPierre Pronchery=item B<-in> I<configfilename> 91b077aed3SPierre Pronchery 92b077aed3SPierre ProncheryInput filename to load configuration data from. 93b077aed3SPierre ProncheryMust be used if the B<-verify> option is specified. 94b077aed3SPierre Pronchery 95b077aed3SPierre Pronchery=item B<-verify> 96b077aed3SPierre Pronchery 97b077aed3SPierre ProncheryVerify that the input configuration file contains the correct information. 98b077aed3SPierre Pronchery 99b077aed3SPierre Pronchery=item B<-provider_name> I<providername> 100b077aed3SPierre Pronchery 101b077aed3SPierre ProncheryName of the provider inside the configuration file. 102b077aed3SPierre ProncheryThe default value is C<fips>. 103b077aed3SPierre Pronchery 104b077aed3SPierre Pronchery=item B<-section_name> I<sectionname> 105b077aed3SPierre Pronchery 106b077aed3SPierre ProncheryName of the section inside the configuration file. 107b077aed3SPierre ProncheryThe default value is C<fips_sect>. 108b077aed3SPierre Pronchery 109b077aed3SPierre Pronchery=item B<-mac_name> I<name> 110b077aed3SPierre Pronchery 111b077aed3SPierre ProncherySpecifies the name of a supported MAC algorithm which will be used. 112b077aed3SPierre ProncheryThe MAC mechanisms that are available will depend on the options 113b077aed3SPierre Proncheryused when building OpenSSL. 114b077aed3SPierre ProncheryTo see the list of supported MAC's use the command 115b077aed3SPierre ProncheryC<openssl list -mac-algorithms>. The default is B<HMAC>. 116b077aed3SPierre Pronchery 117b077aed3SPierre Pronchery=item B<-macopt> I<nm>:I<v> 118b077aed3SPierre Pronchery 119b077aed3SPierre ProncheryPasses options to the MAC algorithm. 120b077aed3SPierre ProncheryA comprehensive list of controls can be found in the EVP_MAC implementation 121b077aed3SPierre Proncherydocumentation. 122b077aed3SPierre ProncheryCommon control strings used for this command are: 123b077aed3SPierre Pronchery 124b077aed3SPierre Pronchery=over 4 125b077aed3SPierre Pronchery 126b077aed3SPierre Pronchery=item B<key>:I<string> 127b077aed3SPierre Pronchery 128b077aed3SPierre ProncherySpecifies the MAC key as an alphanumeric string (use if the key contains 129b077aed3SPierre Proncheryprintable characters only). 130b077aed3SPierre ProncheryThe string length must conform to any restrictions of the MAC algorithm. 131b077aed3SPierre ProncheryA key must be specified for every MAC algorithm. 132b077aed3SPierre ProncheryIf no key is provided, the default that was specified when OpenSSL was 133b077aed3SPierre Proncheryconfigured is used. 134b077aed3SPierre Pronchery 135b077aed3SPierre Pronchery=item B<hexkey>:I<string> 136b077aed3SPierre Pronchery 137b077aed3SPierre ProncherySpecifies the MAC key in hexadecimal form (two hex digits per byte). 138b077aed3SPierre ProncheryThe key length must conform to any restrictions of the MAC algorithm. 139b077aed3SPierre ProncheryA key must be specified for every MAC algorithm. 140b077aed3SPierre ProncheryIf no key is provided, the default that was specified when OpenSSL was 141b077aed3SPierre Proncheryconfigured is used. 142b077aed3SPierre Pronchery 143b077aed3SPierre Pronchery=item B<digest>:I<string> 144b077aed3SPierre Pronchery 145b077aed3SPierre ProncheryUsed by HMAC as an alphanumeric string (use if the key contains printable 146b077aed3SPierre Proncherycharacters only). 147b077aed3SPierre ProncheryThe string length must conform to any restrictions of the MAC algorithm. 148b077aed3SPierre ProncheryTo see the list of supported digests, use the command 149b077aed3SPierre ProncheryC<openssl list -digest-commands>. 150b077aed3SPierre ProncheryThe default digest is SHA-256. 151b077aed3SPierre Pronchery 152b077aed3SPierre Pronchery=back 153b077aed3SPierre Pronchery 154b077aed3SPierre Pronchery=item B<-noout> 155b077aed3SPierre Pronchery 156b077aed3SPierre ProncheryDisable logging of the self tests. 157b077aed3SPierre Pronchery 158b077aed3SPierre Pronchery=item B<-no_conditional_errors> 159b077aed3SPierre Pronchery 160b077aed3SPierre ProncheryConfigure the module to not enter an error state if a conditional self test 161b077aed3SPierre Proncheryfails as described above. 162b077aed3SPierre Pronchery 163b077aed3SPierre Pronchery=item B<-no_security_checks> 164b077aed3SPierre Pronchery 165b077aed3SPierre ProncheryConfigure the module to not perform run-time security checks as described above. 166b077aed3SPierre Pronchery 167b077aed3SPierre Pronchery=item B<-self_test_onload> 168b077aed3SPierre Pronchery 169b077aed3SPierre ProncheryDo not write the two fields related to the "test status indicator" and 170b077aed3SPierre Pronchery"MAC status indicator" to the output configuration file. Without these fields 171b077aed3SPierre Proncherythe self tests KATS will run each time the module is loaded. This option could be 172b077aed3SPierre Proncheryused for cross compiling, since the self tests need to run at least once on each 173b077aed3SPierre Proncherytarget machine. Once the self tests have run on the target machine the user 174b077aed3SPierre Proncherycould possibly then add the 2 fields into the configuration using some other 175b077aed3SPierre Proncherymechanism. 176b077aed3SPierre Pronchery 177b077aed3SPierre Pronchery=item B<-quiet> 178b077aed3SPierre Pronchery 179b077aed3SPierre ProncheryDo not output pass/fail messages. Implies B<-noout>. 180b077aed3SPierre Pronchery 181b077aed3SPierre Pronchery=item B<-corrupt_desc> I<selftest_description>, 182b077aed3SPierre ProncheryB<-corrupt_type> I<selftest_type> 183b077aed3SPierre Pronchery 184b077aed3SPierre ProncheryThe corrupt options can be used to test failure of one or more self tests by 185b077aed3SPierre Proncheryname. 186b077aed3SPierre ProncheryEither option or both may be used to select the tests to corrupt. 187b077aed3SPierre ProncheryRefer to the entries for B<st-desc> and B<st-type> in L<OSSL_PROVIDER-FIPS(7)> for 188b077aed3SPierre Proncheryvalues that can be used. 189b077aed3SPierre Pronchery 190b077aed3SPierre Pronchery=item B<-config> I<parent_config> 191b077aed3SPierre Pronchery 192b077aed3SPierre ProncheryTest that a FIPS provider can be loaded from the specified configuration file. 193b077aed3SPierre ProncheryA previous call to this application needs to generate the extra configuration 194b077aed3SPierre Proncherydata that is included by the base C<parent_config> configuration file. 195b077aed3SPierre ProncherySee L<config(5)> for further information on how to set up a provider section. 196b077aed3SPierre ProncheryAll other options are ignored if '-config' is used. 197b077aed3SPierre Pronchery 198b077aed3SPierre Pronchery=back 199b077aed3SPierre Pronchery 200b077aed3SPierre Pronchery=head1 NOTES 201b077aed3SPierre Pronchery 202b077aed3SPierre ProncherySelf tests results are logged by default if the options B<-quiet> and B<-noout> 203b077aed3SPierre Proncheryare not specified, or if either of the options B<-corrupt_desc> or 204b077aed3SPierre ProncheryB<-corrupt_type> are used. 205b077aed3SPierre ProncheryIf the base configuration file is set up to autoload the fips module, then the 206b077aed3SPierre Proncheryfips module will be loaded and self tested BEFORE the fipsinstall application 207b077aed3SPierre Proncheryhas a chance to set up its own self test callback. As a result of this the self 208b077aed3SPierre Proncherytest output and the options B<-corrupt_desc> and B<-corrupt_type> will be ignored. 209b077aed3SPierre ProncheryFor normal usage the base configuration file should use the default provider 210b077aed3SPierre Proncherywhen generating the fips configuration file. 211b077aed3SPierre Pronchery 212b077aed3SPierre Pronchery=head1 EXAMPLES 213b077aed3SPierre Pronchery 214b077aed3SPierre ProncheryCalculate the mac of a FIPS module F<fips.so> and run a FIPS self test 215b077aed3SPierre Proncheryfor the module, and save the F<fips.cnf> configuration file: 216b077aed3SPierre Pronchery 217b077aed3SPierre Pronchery openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips 218b077aed3SPierre Pronchery 219b077aed3SPierre ProncheryVerify that the configuration file F<fips.cnf> contains the correct info: 220b077aed3SPierre Pronchery 221b077aed3SPierre Pronchery openssl fipsinstall -module ./fips.so -in fips.cnf -provider_name fips -verify 222b077aed3SPierre Pronchery 223b077aed3SPierre ProncheryCorrupt any self tests which have the description C<SHA1>: 224b077aed3SPierre Pronchery 225b077aed3SPierre Pronchery openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips \ 226b077aed3SPierre Pronchery -corrupt_desc 'SHA1' 227b077aed3SPierre Pronchery 228b077aed3SPierre ProncheryValidate that the fips module can be loaded from a base configuration file: 229b077aed3SPierre Pronchery 230b077aed3SPierre Pronchery export OPENSSL_CONF_INCLUDE=<path of configuration files> 231b077aed3SPierre Pronchery export OPENSSL_MODULES=<provider-path> 232b077aed3SPierre Pronchery openssl fipsinstall -config' 'default.cnf' 233b077aed3SPierre Pronchery 234b077aed3SPierre Pronchery 235b077aed3SPierre Pronchery=head1 SEE ALSO 236b077aed3SPierre Pronchery 237b077aed3SPierre ProncheryL<config(5)>, 238b077aed3SPierre ProncheryL<fips_config(5)>, 239b077aed3SPierre ProncheryL<OSSL_PROVIDER-FIPS(7)>, 240b077aed3SPierre ProncheryL<EVP_MAC(3)> 241b077aed3SPierre Pronchery 242*0d0c8621SEnji Cooper=head1 HISTORY 243*0d0c8621SEnji Cooper 244*0d0c8621SEnji CooperThe B<openssl-fipsinstall> application was added in OpenSSL 3.0. 245*0d0c8621SEnji Cooper 246b077aed3SPierre Pronchery=head1 COPYRIGHT 247b077aed3SPierre Pronchery 248b077aed3SPierre ProncheryCopyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. 249b077aed3SPierre Pronchery 250b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 251b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 252b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 253b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 254b077aed3SPierre Pronchery 255b077aed3SPierre Pronchery=cut 256