openssl-fipsinstall.pod.in 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. =pod
  2. {- OpenSSL::safe::output_do_not_edit_headers(); -}
  3. =head1 NAME
  4. openssl-fipsinstall - perform FIPS configuration installation
  5. =head1 SYNOPSIS
  6. B<openssl fipsinstall>
  7. [B<-help>]
  8. [B<-in> I<configfilename>]
  9. [B<-out> I<configfilename>]
  10. [B<-module> I<modulefilename>]
  11. [B<-provider_name> I<providername>]
  12. [B<-section_name> I<sectionname>]
  13. [B<-verify>]
  14. [B<-mac_name> I<macname>]
  15. [B<-macopt> I<nm>:I<v>]
  16. [B<-noout>]
  17. [B<-quiet>]
  18. [B<-pedantic>]
  19. [B<-no_conditional_errors>]
  20. [B<-no_security_checks>]
  21. [B<-ems_check>]
  22. [B<-no_drbg_truncated_digests>]
  23. [B<-self_test_onload>]
  24. [B<-self_test_oninstall>]
  25. [B<-corrupt_desc> I<selftest_description>]
  26. [B<-corrupt_type> I<selftest_type>]
  27. [B<-config> I<parent_config>]
  28. =head1 DESCRIPTION
  29. This command is used to generate a FIPS module configuration file.
  30. This configuration file can be used each time a FIPS module is loaded
  31. in order to pass data to the FIPS module self tests. The FIPS module always
  32. verifies its MAC, but optionally only needs to run the KAT's once,
  33. at installation.
  34. The generated configuration file consists of:
  35. =over 4
  36. =item - A MAC of the FIPS module file.
  37. =item - A test status indicator.
  38. This indicates if the Known Answer Self Tests (KAT's) have successfully run.
  39. =item - A MAC of the status indicator.
  40. =item - A control for conditional self tests errors.
  41. By default if a continuous test (e.g a key pair test) fails then the FIPS module
  42. will enter an error state, and no services or cryptographic algorithms will be
  43. able to be accessed after this point.
  44. The default value of '1' will cause the fips module error state to be entered.
  45. If the value is '0' then the module error state will not be entered.
  46. Regardless of whether the error state is entered or not, the current operation
  47. (e.g. key generation) will return an error. The user is responsible for retrying
  48. the operation if the module error state is not entered.
  49. =item - A control to indicate whether run-time security checks are done.
  50. This indicates if run-time checks related to enforcement of security parameters
  51. such as minimum security strength of keys and approved curve names are used.
  52. The default value of '1' will perform the checks.
  53. If the value is '0' the checks are not performed and FIPS compliance must
  54. be done by procedures documented in the relevant Security Policy.
  55. =back
  56. This file is described in L<fips_config(5)>.
  57. =head1 OPTIONS
  58. =over 4
  59. =item B<-help>
  60. Print a usage message.
  61. =item B<-module> I<filename>
  62. Filename of the FIPS module to perform an integrity check on.
  63. The path provided in the filename is used to load the module when it is
  64. activated, and this overrides the environment variable B<OPENSSL_MODULES>.
  65. =item B<-out> I<configfilename>
  66. Filename to output the configuration data to; the default is standard output.
  67. =item B<-in> I<configfilename>
  68. Input filename to load configuration data from.
  69. Must be used if the B<-verify> option is specified.
  70. =item B<-verify>
  71. Verify that the input configuration file contains the correct information.
  72. =item B<-provider_name> I<providername>
  73. Name of the provider inside the configuration file.
  74. The default value is C<fips>.
  75. =item B<-section_name> I<sectionname>
  76. Name of the section inside the configuration file.
  77. The default value is C<fips_sect>.
  78. =item B<-mac_name> I<name>
  79. Specifies the name of a supported MAC algorithm which will be used.
  80. The MAC mechanisms that are available will depend on the options
  81. used when building OpenSSL.
  82. To see the list of supported MAC's use the command
  83. C<openssl list -mac-algorithms>. The default is B<HMAC>.
  84. =item B<-macopt> I<nm>:I<v>
  85. Passes options to the MAC algorithm.
  86. A comprehensive list of controls can be found in the EVP_MAC implementation
  87. documentation.
  88. Common control strings used for this command are:
  89. =over 4
  90. =item B<key>:I<string>
  91. Specifies the MAC key as an alphanumeric string (use if the key contains
  92. printable characters only).
  93. The string length must conform to any restrictions of the MAC algorithm.
  94. A key must be specified for every MAC algorithm.
  95. If no key is provided, the default that was specified when OpenSSL was
  96. configured is used.
  97. =item B<hexkey>:I<string>
  98. Specifies the MAC key in hexadecimal form (two hex digits per byte).
  99. The key length must conform to any restrictions of the MAC algorithm.
  100. A key must be specified for every MAC algorithm.
  101. If no key is provided, the default that was specified when OpenSSL was
  102. configured is used.
  103. =item B<digest>:I<string>
  104. Used by HMAC as an alphanumeric string (use if the key contains printable
  105. characters only).
  106. The string length must conform to any restrictions of the MAC algorithm.
  107. To see the list of supported digests, use the command
  108. C<openssl list -digest-commands>.
  109. The default digest is SHA-256.
  110. =back
  111. =item B<-noout>
  112. Disable logging of the self tests.
  113. =item B<-pedantic>
  114. Configure the module so that it is strictly FIPS compliant rather
  115. than being backwards compatible. This enables conditional errors,
  116. security checks etc. Note that any previous configuration options will
  117. be overwritten and any subsequent configuration options that violate
  118. FIPS compliance will result in an error.
  119. =item B<-no_conditional_errors>
  120. Configure the module to not enter an error state if a conditional self test
  121. fails as described above.
  122. =item B<-no_security_checks>
  123. Configure the module to not perform run-time security checks as described above.
  124. Enabling the configuration option "no-fips-securitychecks" provides another way to
  125. turn off the check at compile time.
  126. =item B<-ems_check>
  127. Configure the module to enable a run-time Extended Master Secret (EMS) check
  128. when using the TLS1_PRF KDF algorithm. This check is disabled by default.
  129. See RFC 7627 for information related to EMS.
  130. =item B<-no_drbg_truncated_digests>
  131. Configure the module to not allow truncated digests to be used with Hash and
  132. HMAC DRBGs. See FIPS 140-3 IG D.R for details.
  133. =item B<-self_test_onload>
  134. Do not write the two fields related to the "test status indicator" and
  135. "MAC status indicator" to the output configuration file. Without these fields
  136. the self tests KATS will run each time the module is loaded. This option could be
  137. used for cross compiling, since the self tests need to run at least once on each
  138. target machine. Once the self tests have run on the target machine the user
  139. could possibly then add the 2 fields into the configuration using some other
  140. mechanism.
  141. This is the default.
  142. =item B<-self_test_oninstall>
  143. The converse of B<-self_test_oninstall>. The two fields related to the
  144. "test status indicator" and "MAC status indicator" are written to the
  145. output configuration file.
  146. =item B<-quiet>
  147. Do not output pass/fail messages. Implies B<-noout>.
  148. =item B<-corrupt_desc> I<selftest_description>,
  149. B<-corrupt_type> I<selftest_type>
  150. The corrupt options can be used to test failure of one or more self tests by
  151. name.
  152. Either option or both may be used to select the tests to corrupt.
  153. Refer to the entries for B<st-desc> and B<st-type> in L<OSSL_PROVIDER-FIPS(7)> for
  154. values that can be used.
  155. =item B<-config> I<parent_config>
  156. Test that a FIPS provider can be loaded from the specified configuration file.
  157. A previous call to this application needs to generate the extra configuration
  158. data that is included by the base C<parent_config> configuration file.
  159. See L<config(5)> for further information on how to set up a provider section.
  160. All other options are ignored if '-config' is used.
  161. =back
  162. =head1 NOTES
  163. Self tests results are logged by default if the options B<-quiet> and B<-noout>
  164. are not specified, or if either of the options B<-corrupt_desc> or
  165. B<-corrupt_type> are used.
  166. If the base configuration file is set up to autoload the fips module, then the
  167. fips module will be loaded and self tested BEFORE the fipsinstall application
  168. has a chance to set up its own self test callback. As a result of this the self
  169. test output and the options B<-corrupt_desc> and B<-corrupt_type> will be ignored.
  170. For normal usage the base configuration file should use the default provider
  171. when generating the fips configuration file.
  172. The B<-self_test_oninstall> option was added and the
  173. B<-self_test_onload> option was made the default in OpenSSL 3.1.
  174. The command and all remaining options were added in OpenSSL 3.0.
  175. =head1 EXAMPLES
  176. Calculate the mac of a FIPS module F<fips.so> and run a FIPS self test
  177. for the module, and save the F<fips.cnf> configuration file:
  178. openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips
  179. Verify that the configuration file F<fips.cnf> contains the correct info:
  180. openssl fipsinstall -module ./fips.so -in fips.cnf -provider_name fips -verify
  181. Corrupt any self tests which have the description C<SHA1>:
  182. openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips \
  183. -corrupt_desc 'SHA1'
  184. Validate that the fips module can be loaded from a base configuration file:
  185. export OPENSSL_CONF_INCLUDE=<path of configuration files>
  186. export OPENSSL_MODULES=<provider-path>
  187. openssl fipsinstall -config' 'default.cnf'
  188. =head1 SEE ALSO
  189. L<config(5)>,
  190. L<fips_config(5)>,
  191. L<OSSL_PROVIDER-FIPS(7)>,
  192. L<EVP_MAC(3)>
  193. =head1 COPYRIGHT
  194. Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
  195. Licensed under the Apache License 2.0 (the "License"). You may not use
  196. this file except in compliance with the License. You can obtain a copy
  197. in the file LICENSE in the source distribution or at
  198. L<https://www.openssl.org/source/license.html>.
  199. =cut