openssl-fipsinstall.pod.in 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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<-no_conditional_errors>]
  19. [B<-corrupt_desc> I<selftest_description>]
  20. [B<-corrupt_type> I<selftest_type>]
  21. [B<-config> I<parent_config>]
  22. =head1 DESCRIPTION
  23. This command is used to generate a FIPS module configuration file.
  24. This configuration file can be used each time a FIPS module is loaded
  25. in order to pass data to the FIPS module self tests. The FIPS module always
  26. verifies its MAC, but only needs to run the KAT's once,
  27. at installation.
  28. The generated configuration file consists of:
  29. =over 4
  30. =item - A MAC of the FIPS module file.
  31. =item - A test status indicator.
  32. This indicates if the Known Answer Self Tests (KAT's) have successfully run.
  33. =item - A MAC of the status indicator.
  34. =item - A control for conditional self tests errors.
  35. By default if a continuous test (e.g a key pair test) fails then the FIPS module
  36. will enter an error state, and no services or cryptographic algorithms will be
  37. able to be accessed after this point.
  38. The default value of '1' will cause the fips module error state to be entered.
  39. If the value is '0' then the module error state will not be entered.
  40. Regardless of whether the error state is entered or not, the current operation
  41. (e.g. key generation) will return an error. The user is responsible for retrying
  42. the operation if the module error state is not entered.
  43. =back
  44. This file is described in L<fips_config(5)>.
  45. =head1 OPTIONS
  46. =over 4
  47. =item B<-help>
  48. Print a usage message.
  49. =item B<-module> I<filename>
  50. Filename of the FIPS module to perform an integrity check on.
  51. The path provided in the filename is used to load the module when it is
  52. activated, and this overrides the environment variable B<OPENSSL_MODULES>.
  53. =item B<-out> I<configfilename>
  54. Filename to output the configuration data to; the default is standard output.
  55. =item B<-in> I<configfilename>
  56. Input filename to load configuration data from. Used with the B<-verify> option.
  57. Standard input is used if the filename is C<->.
  58. =item B<-verify>
  59. Verify that the input configuration file contains the correct information.
  60. =item B<-provider_name> I<providername>
  61. Name of the provider inside the configuration file.
  62. The default value is C<fips>.
  63. =item B<-section_name> I<sectionname>
  64. Name of the section inside the configuration file.
  65. The default value is C<fips_sect>.
  66. =item B<-mac_name> I<name>
  67. Specifies the name of a supported MAC algorithm which will be used.
  68. The MAC mechanisms that are available will depend on the options
  69. used when building OpenSSL.
  70. To see the list of supported MAC's use the command
  71. C<openssl list -mac-algorithms>. The default is B<HMAC>.
  72. =item B<-macopt> I<nm>:I<v>
  73. Passes options to the MAC algorithm.
  74. A comprehensive list of controls can be found in the EVP_MAC implementation
  75. documentation.
  76. Common control strings used for this command are:
  77. =over 4
  78. =item B<key>:I<string>
  79. Specifies the MAC key as an alphanumeric string (use if the key contains
  80. printable characters only).
  81. The string length must conform to any restrictions of the MAC algorithm.
  82. A key must be specified for every MAC algorithm.
  83. If no key is provided, the default that was specified when OpenSSL was
  84. configured is used.
  85. =item B<hexkey>:I<string>
  86. Specifies the MAC key in hexadecimal form (two hex digits per byte).
  87. The key length must conform to any restrictions of the MAC algorithm.
  88. A key must be specified for every MAC algorithm.
  89. If no key is provided, the default that was specified when OpenSSL was
  90. configured is used.
  91. =item B<digest>:I<string>
  92. Used by HMAC as an alphanumeric string (use if the key contains printable
  93. characters only).
  94. The string length must conform to any restrictions of the MAC algorithm.
  95. To see the list of supported digests, use the command
  96. C<openssl list -digest-commands>.
  97. The default digest is SHA-256.
  98. =back
  99. =item B<-noout>
  100. Disable logging of the self tests.
  101. =item B<-no_conditional_errors>
  102. Configure the module to not enter an error state if a conditional self test
  103. fails as described above.
  104. =item B<-quiet>
  105. Do not output pass/fail messages. Implies B<-noout>.
  106. =item B<-corrupt_desc> I<selftest_description>,
  107. B<-corrupt_type> I<selftest_type>
  108. The corrupt options can be used to test failure of one or more self tests by
  109. name.
  110. Either option or both may be used to select the tests to corrupt.
  111. Refer to the entries for B<st-desc> and B<st-type> in L<OSSL_PROVIDER-FIPS(7)> for
  112. values that can be used.
  113. =item B<-config> I<parent_config>
  114. Test that a FIPS provider can be loaded from the specified configuration file.
  115. A previous call to this application needs to generate the extra configuration
  116. data that is included by the base C<parent_config> configuration file.
  117. See L<config(5)> for further information on how to set up a provider section.
  118. All other options are ignored if '-config' is used.
  119. =back
  120. =head1 EXAMPLES
  121. Calculate the mac of a FIPS module F<fips.so> and run a FIPS self test
  122. for the module, and save the F<fips.cnf> configuration file:
  123. openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips \
  124. -section_name fipsinstall -mac_name HMAC -macopt digest:SHA256 \
  125. -macopt hexkey:000102030405060708090A0B0C0D0E0F10111213
  126. Verify that the configuration file F<fips.cnf> contains the correct info:
  127. openssl fipsinstall -module ./fips.so -in fips.cnf -provider_name fips \
  128. -section_name fips_install -mac_name HMAC -macopt digest:SHA256 \
  129. -macopt hexkey:000102030405060708090A0B0C0D0E0F10111213 -verify
  130. Corrupt any self tests which have the description C<SHA1>:
  131. openssl fipsinstall -module ./fips.so -out fips.cnf -provider_name fips \
  132. -section_name fipsinstall -mac_name HMAC -macopt digest:SHA256 \
  133. -macopt hexkey:000102030405060708090A0B0C0D0E0F10111213 \
  134. -corrupt_desc 'SHA1'
  135. Validate that the fips module can be loaded from a base configuration file:
  136. export OPENSSL_CONF_INCLUDE=<path of configuration files>
  137. export OPENSSL_MODULES=<provider-path>
  138. openssl fipsinstall -config' 'default.cnf'
  139. =head1 SEE ALSO
  140. L<config(5)>,
  141. L<fips_config(5)>,
  142. L<OSSL_PROVIDER-FIPS(7)>,
  143. L<EVP_MAC(3)>
  144. =head1 COPYRIGHT
  145. Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
  146. Licensed under the Apache License 2.0 (the "License"). You may not use
  147. this file except in compliance with the License. You can obtain a copy
  148. in the file LICENSE in the source distribution or at
  149. L<https://www.openssl.org/source/license.html>.
  150. =cut