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