VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.7/doc/man7/OSSL_PROVIDER-FIPS.pod@ 107278

最後變更 在這個檔案從107278是 104078,由 vboxsync 提交於 11 月 前

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

檔案大小: 12.1 KB
 
1=pod
2
3=head1 NAME
4
5OSSL_PROVIDER-FIPS - OpenSSL FIPS provider
6
7=head1 DESCRIPTION
8
9The OpenSSL FIPS provider is a special provider that conforms to the Federal
10Information Processing Standards (FIPS) specified in FIPS 140-3. This 'module'
11contains an approved set of cryptographic algorithms that is validated by an
12accredited testing laboratory.
13
14=head2 Properties
15
16The implementations in this provider specifically have these properties
17defined:
18
19=over 4
20
21=item "provider=fips"
22
23=item "fips=yes"
24
25=back
26
27It may be used in a property query string with fetching functions such as
28L<EVP_MD_fetch(3)> or L<EVP_CIPHER_fetch(3)>, as well as with other
29functions that take a property query string, such as
30L<EVP_PKEY_CTX_new_from_name(3)>.
31
32To be FIPS compliant, it is mandatory to include C<fips=yes> as
33part of all property queries. This ensures that only FIPS approved
34implementations are used for cryptographic operations. The C<fips=yes>
35query may also include other non-crypto support operations that
36are not in the FIPS provider, such as asymmetric key encoders, see
37L<OSSL_PROVIDER-default(7)/Asymmetric Key Management>.
38
39It is not mandatory to include C<provider=fips> as part of your property
40query. Including C<provider=fips> in your property query guarantees
41that the OpenSSL FIPS provider is used for cryptographic operations
42rather than other FIPS capable providers.
43
44=head2 Provider parameters
45
46See L<provider-base(7)/Provider parameters> for a list of base parameters.
47Additionally the OpenSSL FIPS provider also supports the following gettable
48parameters:
49
50=over 4
51
52=item "security-checks" (B<OSSL_OSSL_PROV_PARAM_SECURITY_CHECKS>) <unsigned integer>
53
54For further information refer to the L<openssl-fipsinstall(1)> option
55B<-no_security_checks>.
56
57=back
58
59=head1 OPERATIONS AND ALGORITHMS
60
61The OpenSSL FIPS provider supports these operations and algorithms:
62
63=head2 Hashing Algorithms / Message Digests
64
65=over 4
66
67=item SHA1, see L<EVP_MD-SHA1(7)>
68
69=item SHA2, see L<EVP_MD-SHA2(7)>
70
71=item SHA3, see L<EVP_MD-SHA3(7)>
72
73=item KECCAK-KMAC, see L<EVP_MD-KECCAK-KMAC(7)>
74
75=back
76
77=head2 Symmetric Ciphers
78
79=over 4
80
81=item AES, see L<EVP_CIPHER-AES(7)>
82
83=item DES-EDE3 (TripleDES), see L<EVP_CIPHER-DES(7)>
84
85=back
86
87=head2 Message Authentication Code (MAC)
88
89=over 4
90
91=item CMAC, see L<EVP_MAC-CMAC(7)>
92
93=item GMAC, see L<EVP_MAC-GMAC(7)>
94
95=item HMAC, see L<EVP_MAC-HMAC(7)>
96
97=item KMAC, see L<EVP_MAC-KMAC(7)>
98
99=back
100
101=head2 Key Derivation Function (KDF)
102
103=over 4
104
105=item HKDF, see L<EVP_KDF-HKDF(7)>
106
107=item TLS13-KDF, see L<EVP_KDF-TLS13_KDF(7)>
108
109=item SSKDF, see L<EVP_KDF-SS(7)>
110
111=item PBKDF2, see L<EVP_KDF-PBKDF2(7)>
112
113=item SSHKDF, see L<EVP_KDF-SSHKDF(7)>
114
115=item TLS1-PRF, see L<EVP_KDF-TLS1_PRF(7)>
116
117=item KBKDF, see L<EVP_KDF-KB(7)>
118
119=item X942KDF-ASN1, see L<EVP_KDF-X942-ASN1(7)>
120
121=item X942KDF-CONCAT, see L<EVP_KDF-X942-CONCAT(7)>
122
123=item X963KDF, see L<EVP_KDF-X963(7)>
124
125=back
126
127=head2 Key Exchange
128
129=over 4
130
131=item DH, see L<EVP_KEYEXCH-DH(7)>
132
133=item ECDH, see L<EVP_KEYEXCH-ECDH(7)>
134
135=item X25519, see L<EVP_KEYEXCH-X25519(7)>
136
137=item X448, see L<EVP_KEYEXCH-X448(7)>
138
139=back
140
141=head2 Asymmetric Signature
142
143=over 4
144
145=item RSA, see L<EVP_SIGNATURE-RSA(7)>
146
147=item X25519, see L<EVP_SIGNATURE-ED25519(7)>
148
149=item X448, see L<EVP_SIGNATURE-ED448(7)>
150
151=item HMAC, see L<EVP_SIGNATURE-HMAC(7)>
152
153=item CMAC, see L<EVP_SIGNATURE-CMAC(7)>
154
155=back
156
157=head2 Asymmetric Cipher
158
159=over 4
160
161=item RSA, see L<EVP_ASYM_CIPHER-RSA(7)>
162
163=back
164
165=head2 Asymmetric Key Encapsulation
166
167=over 4
168
169=item RSA, see L<EVP_KEM-RSA(7)>
170
171=back
172
173=head2 Asymmetric Key Management
174
175=over 4
176
177=item DH, see L<EVP_KEYMGMT-DH(7)>
178
179=item DHX, see L<EVP_KEYMGMT-DHX(7)>
180
181=item DSA, see L<EVP_KEYMGMT-DSA(7)>
182
183=item RSA, see L<EVP_KEYMGMT-RSA(7)>
184
185=item EC, see L<EVP_KEYMGMT-EC(7)>
186
187=item X25519, see L<EVP_KEYMGMT-X25519(7)>
188
189=item X448, see L<EVP_KEYMGMT-X448(7)>
190
191=back
192
193=head2 Random Number Generation
194
195=over 4
196
197=item CTR-DRBG, see L<EVP_RAND-CTR-DRBG(7)>
198
199=item HASH-DRBG, see L<EVP_RAND-HASH-DRBG(7)>
200
201=item HMAC-DRBG, see L<EVP_RAND-HMAC-DRBG(7)>
202
203=item TEST-RAND, see L<EVP_RAND-TEST-RAND(7)>
204
205TEST-RAND is an unapproved algorithm.
206
207=back
208
209=head1 SELF TESTING
210
211One of the requirements for the FIPS module is self testing. An optional callback
212mechanism is available to return information to the user using
213L<OSSL_SELF_TEST_set_callback(3)>.
214
215The parameters passed to the callback are described in L<OSSL_SELF_TEST_new(3)>
216
217The OpenSSL FIPS module uses the following mechanism to provide information
218about the self tests as they run.
219This is useful for debugging if a self test is failing.
220The callback also allows forcing any self test to fail, in order to check that
221it operates correctly on failure.
222Note that all self tests run even if a self test failure occurs.
223
224The FIPS module passes the following type(s) to OSSL_SELF_TEST_onbegin().
225
226=over 4
227
228=item "Module_Integrity" (B<OSSL_SELF_TEST_TYPE_MODULE_INTEGRITY>)
229
230Uses HMAC SHA256 on the module file to validate that the module has not been
231modified. The integrity value is compared to a value written to a configuration
232file during installation.
233
234=item "Install_Integrity" (B<OSSL_SELF_TEST_TYPE_INSTALL_INTEGRITY>)
235
236Uses HMAC SHA256 on a fixed string to validate that the installation process
237has already been performed and the self test KATS have already been tested,
238The integrity value is compared to a value written to a configuration
239file after successfully running the self tests during installation.
240
241=item "KAT_Cipher" (B<OSSL_SELF_TEST_TYPE_KAT_CIPHER>)
242
243Known answer test for a symmetric cipher.
244
245=item "KAT_AsymmetricCipher" (B<OSSL_SELF_TEST_TYPE_KAT_ASYM_CIPHER>)
246
247Known answer test for a asymmetric cipher.
248
249=item "KAT_Digest" (B<OSSL_SELF_TEST_TYPE_KAT_DIGEST>)
250
251Known answer test for a digest.
252
253=item "KAT_Signature" (B<OSSL_SELF_TEST_TYPE_KAT_SIGNATURE>)
254
255Known answer test for a signature.
256
257=item "PCT_Signature" (B<OSSL_SELF_TEST_TYPE_PCT_SIGNATURE>)
258
259Pairwise Consistency check for a signature.
260
261=item "KAT_KDF" (B<OSSL_SELF_TEST_TYPE_KAT_KDF>)
262
263Known answer test for a key derivation function.
264
265=item "KAT_KA" (B<OSSL_SELF_TEST_TYPE_KAT_KA>)
266
267Known answer test for key agreement.
268
269=item "DRBG" (B<OSSL_SELF_TEST_TYPE_DRBG>)
270
271Known answer test for a Deterministic Random Bit Generator.
272
273=item "Conditional_PCT" (B<OSSL_SELF_TEST_TYPE_PCT>)
274
275Conditional test that is run during the generation of key pairs.
276
277=item "Continuous_RNG_Test" (B<OSSL_SELF_TEST_TYPE_CRNG>)
278
279Continuous random number generator test.
280
281=back
282
283The "Module_Integrity" self test is always run at startup.
284The "Install_Integrity" self test is used to check if the self tests have
285already been run at installation time. If they have already run then the
286self tests are not run on subsequent startups.
287All other self test categories are run once at installation time, except for the
288"Pairwise_Consistency_Test".
289
290There is only one instance of the "Module_Integrity" and "Install_Integrity"
291self tests. All other self tests may have multiple instances.
292
293
294The FIPS module passes the following descriptions(s) to OSSL_SELF_TEST_onbegin().
295
296=over 4
297
298=item "HMAC" (B<OSSL_SELF_TEST_DESC_INTEGRITY_HMAC>)
299
300"Module_Integrity" and "Install_Integrity" use this.
301
302=item "RSA" (B<OSSL_SELF_TEST_DESC_PCT_RSA_PKCS1>)
303
304=item "ECDSA" (B<OSSL_SELF_TEST_DESC_PCT_ECDSA>)
305
306=item "DSA" (B<OSSL_SELF_TEST_DESC_PCT_DSA>)
307
308Key generation tests used with the "Pairwise_Consistency_Test" type.
309
310=item "RSA_Encrypt" (B<OSSL_SELF_TEST_DESC_ASYM_RSA_ENC>)
311
312=item "RSA_Decrypt" (B<OSSL_SELF_TEST_DESC_ASYM_RSA_DEC>)
313
314"KAT_AsymmetricCipher" uses this to indicate an encrypt or decrypt KAT.
315
316=item "AES_GCM" (B<OSSL_SELF_TEST_DESC_CIPHER_AES_GCM>)
317
318=item "AES_ECB_Decrypt" (B<OSSL_SELF_TEST_DESC_CIPHER_AES_ECB>)
319
320=item "TDES" (B<OSSL_SELF_TEST_DESC_CIPHER_TDES>)
321
322Symmetric cipher tests used with the "KAT_Cipher" type.
323
324=item "SHA1" (B<OSSL_SELF_TEST_DESC_MD_SHA1>)
325
326=item "SHA2" (B<OSSL_SELF_TEST_DESC_MD_SHA2>)
327
328=item "SHA3" (B<OSSL_SELF_TEST_DESC_MD_SHA3>)
329
330Digest tests used with the "KAT_Digest" type.
331
332=item "DSA" (B<OSSL_SELF_TEST_DESC_SIGN_DSA>)
333
334=item "RSA" (B<OSSL_SELF_TEST_DESC_SIGN_RSA>)
335
336=item "ECDSA" (B<OSSL_SELF_TEST_DESC_SIGN_ECDSA>)
337
338Signature tests used with the "KAT_Signature" type.
339
340=item "ECDH" (B<OSSL_SELF_TEST_DESC_KA_ECDH>)
341
342=item "DH" (B<OSSL_SELF_TEST_DESC_KA_DH>)
343
344Key agreement tests used with the "KAT_KA" type.
345
346=item "HKDF" (B<OSSL_SELF_TEST_DESC_KDF_HKDF>)
347
348=item "TLS13_KDF_EXTRACT" (B<OSSL_SELF_TEST_DESC_KDF_TLS13_EXTRACT>)
349
350=item "TLS13_KDF_EXPAND" (B<OSSL_SELF_TEST_DESC_KDF_TLS13_EXPAND>)
351
352=item "SSKDF" (B<OSSL_SELF_TEST_DESC_KDF_SSKDF>)
353
354=item "X963KDF" (B<OSSL_SELF_TEST_DESC_KDF_X963KDF>)
355
356=item "X942KDF" (B<OSSL_SELF_TEST_DESC_KDF_X942KDF>)
357
358=item "PBKDF2" (B<OSSL_SELF_TEST_DESC_KDF_PBKDF2>)
359
360=item "SSHKDF" (B<OSSL_SELF_TEST_DESC_KDF_SSHKDF>)
361
362=item "TLS12_PRF" (B<OSSL_SELF_TEST_DESC_KDF_TLS12_PRF>)
363
364=item "KBKDF" (B<OSSL_SELF_TEST_DESC_KDF_KBKDF>)
365
366Key Derivation Function tests used with the "KAT_KDF" type.
367
368=item "CTR" (B<OSSL_SELF_TEST_DESC_DRBG_CTR>)
369
370=item "HASH" (B<OSSL_SELF_TEST_DESC_DRBG_HASH>)
371
372=item "HMAC" (B<OSSL_SELF_TEST_DESC_DRBG_HMAC>)
373
374DRBG tests used with the "DRBG" type.
375
376= item "RNG" (B<OSSL_SELF_TEST_DESC_RNG>)
377
378"Continuous_RNG_Test" uses this.
379
380=back
381
382=head1 EXAMPLES
383
384A simple self test callback is shown below for illustrative purposes.
385
386 #include <openssl/self_test.h>
387
388 static OSSL_CALLBACK self_test_cb;
389
390 static int self_test_cb(const OSSL_PARAM params[], void *arg)
391 {
392 int ret = 0;
393 const OSSL_PARAM *p = NULL;
394 const char *phase = NULL, *type = NULL, *desc = NULL;
395
396 p = OSSL_PARAM_locate_const(params, OSSL_PROV_PARAM_SELF_TEST_PHASE);
397 if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING)
398 goto err;
399 phase = (const char *)p->data;
400
401 p = OSSL_PARAM_locate_const(params, OSSL_PROV_PARAM_SELF_TEST_DESC);
402 if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING)
403 goto err;
404 desc = (const char *)p->data;
405
406 p = OSSL_PARAM_locate_const(params, OSSL_PROV_PARAM_SELF_TEST_TYPE);
407 if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING)
408 goto err;
409 type = (const char *)p->data;
410
411 /* Do some logging */
412 if (strcmp(phase, OSSL_SELF_TEST_PHASE_START) == 0)
413 BIO_printf(bio_out, "%s : (%s) : ", desc, type);
414 if (strcmp(phase, OSSL_SELF_TEST_PHASE_PASS) == 0
415 || strcmp(phase, OSSL_SELF_TEST_PHASE_FAIL) == 0)
416 BIO_printf(bio_out, "%s\n", phase);
417
418 /* Corrupt the SHA1 self test during the 'corrupt' phase by returning 0 */
419 if (strcmp(phase, OSSL_SELF_TEST_PHASE_CORRUPT) == 0
420 && strcmp(desc, OSSL_SELF_TEST_DESC_MD_SHA1) == 0) {
421 BIO_printf(bio_out, "%s %s", phase, desc);
422 return 0;
423 }
424 ret = 1;
425 err:
426 return ret;
427 }
428
429=head1 NOTES
430
431Some released versions of OpenSSL do not include a validated
432FIPS provider. To determine which versions have undergone
433the validation process, please refer to the
434L<OpenSSL Downloads page|https://www.openssl.org/source/>. If you
435require FIPS-approved functionality, it is essential to build your FIPS
436provider using one of the validated versions listed there. Normally,
437it is possible to utilize a FIPS provider constructed from one of the
438validated versions alongside F<libcrypto> and F<libssl> compiled from any
439release within the same major release series. This flexibility enables
440you to address bug fixes and CVEs that fall outside the FIPS boundary.
441
442The FIPS provider in OpenSSL 3.1 includes some non-FIPS validated algorithms,
443consequently the property query C<fips=yes> is mandatory for applications that
444want to operate in a FIPS approved manner. The algorithms are:
445
446=over 4
447
448=item Triple DES ECB
449
450=item Triple DES CBC
451
452=item EdDSA
453
454=back
455
456=head1 SEE ALSO
457
458L<openssl-fipsinstall(1)>,
459L<fips_config(5)>,
460L<OSSL_SELF_TEST_set_callback(3)>,
461L<OSSL_SELF_TEST_new(3)>,
462L<OSSL_PARAM(3)>,
463L<openssl-core.h(7)>,
464L<openssl-core_dispatch.h(7)>,
465L<provider(7)>,
466L<https://www.openssl.org/source/>
467
468=head1 HISTORY
469
470This functionality was added in OpenSSL 3.0.
471
472=head1 COPYRIGHT
473
474Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
475
476Licensed under the Apache License 2.0 (the "License"). You may not use
477this file except in compliance with the License. You can obtain a copy
478in the file LICENSE in the source distribution or at
479L<https://www.openssl.org/source/license.html>.
480
481=cut
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette