xref: /freebsd-src/crypto/openssl/doc/man7/provider.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery=pod
2*b077aed3SPierre Pronchery
3*b077aed3SPierre Pronchery=head1 NAME
4*b077aed3SPierre Pronchery
5*b077aed3SPierre Proncheryprovider - OpenSSL operation implementation providers
6*b077aed3SPierre Pronchery
7*b077aed3SPierre Pronchery=head1 SYNOPSIS
8*b077aed3SPierre Pronchery
9*b077aed3SPierre Pronchery=for openssl generic
10*b077aed3SPierre Pronchery
11*b077aed3SPierre Pronchery#include <openssl/provider.h>
12*b077aed3SPierre Pronchery
13*b077aed3SPierre Pronchery=head1 DESCRIPTION
14*b077aed3SPierre Pronchery
15*b077aed3SPierre Pronchery=head2 General
16*b077aed3SPierre Pronchery
17*b077aed3SPierre ProncheryThis page contains information useful to provider authors.
18*b077aed3SPierre Pronchery
19*b077aed3SPierre ProncheryA I<provider>, in OpenSSL terms, is a unit of code that provides one
20*b077aed3SPierre Proncheryor more implementations for various operations for diverse algorithms
21*b077aed3SPierre Proncherythat one might want to perform.
22*b077aed3SPierre Pronchery
23*b077aed3SPierre ProncheryAn I<operation> is something one wants to do, such as encryption and
24*b077aed3SPierre Proncherydecryption, key derivation, MAC calculation, signing and verification,
25*b077aed3SPierre Proncheryetc.
26*b077aed3SPierre Pronchery
27*b077aed3SPierre ProncheryAn I<algorithm> is a named method to perform an operation.
28*b077aed3SPierre ProncheryVery often, the algorithms revolve around cryptographic operations,
29*b077aed3SPierre Proncherybut may also revolve around other types of operation, such as managing
30*b077aed3SPierre Proncherycertain types of objects.
31*b077aed3SPierre Pronchery
32*b077aed3SPierre ProncherySee L<crypto(7)> for further details.
33*b077aed3SPierre Pronchery
34*b077aed3SPierre Pronchery=head2 Provider
35*b077aed3SPierre Pronchery
36*b077aed3SPierre ProncheryA I<provider> offers an initialization function, as a set of base
37*b077aed3SPierre Proncheryfunctions in the form of an L<OSSL_DISPATCH(3)> array, and by extension,
38*b077aed3SPierre Proncherya set of L<OSSL_ALGORITHM(3)>s (see L<openssl-core.h(7)>).
39*b077aed3SPierre ProncheryIt may be a dynamically loadable module, or may be built-in, in
40*b077aed3SPierre ProncheryOpenSSL libraries or in the application.
41*b077aed3SPierre ProncheryIf it's a dynamically loadable module, the initialization function
42*b077aed3SPierre Proncherymust be named C<OSSL_provider_init> and must be exported.
43*b077aed3SPierre ProncheryIf it's built-in, the initialization function may have any name.
44*b077aed3SPierre Pronchery
45*b077aed3SPierre ProncheryThe initialization function must have the following signature:
46*b077aed3SPierre Pronchery
47*b077aed3SPierre Pronchery int NAME(const OSSL_CORE_HANDLE *handle,
48*b077aed3SPierre Pronchery          const OSSL_DISPATCH *in, const OSSL_DISPATCH **out,
49*b077aed3SPierre Pronchery          void **provctx);
50*b077aed3SPierre Pronchery
51*b077aed3SPierre ProncheryI<handle> is the OpenSSL library object for the provider, and works
52*b077aed3SPierre Proncheryas a handle for everything the OpenSSL libraries need to know about
53*b077aed3SPierre Proncherythe provider.
54*b077aed3SPierre ProncheryFor the provider itself, it is passed to some of the functions given in the
55*b077aed3SPierre Proncherydispatch array I<in>.
56*b077aed3SPierre Pronchery
57*b077aed3SPierre ProncheryI<in> is a dispatch array of base functions offered by the OpenSSL
58*b077aed3SPierre Proncherylibraries, and the available functions are further described in
59*b077aed3SPierre ProncheryL<provider-base(7)>.
60*b077aed3SPierre Pronchery
61*b077aed3SPierre ProncheryI<*out> must be assigned a dispatch array of base functions that the
62*b077aed3SPierre Proncheryprovider offers to the OpenSSL libraries.
63*b077aed3SPierre ProncheryThe functions that may be offered are further described in
64*b077aed3SPierre ProncheryL<provider-base(7)>, and they are the central means of communication
65*b077aed3SPierre Proncherybetween the OpenSSL libraries and the provider.
66*b077aed3SPierre Pronchery
67*b077aed3SPierre ProncheryI<*provctx> should be assigned a provider specific context to allow
68*b077aed3SPierre Proncherythe provider multiple simultaneous uses.
69*b077aed3SPierre ProncheryThis pointer will be passed to various operation functions offered by
70*b077aed3SPierre Proncherythe provider.
71*b077aed3SPierre Pronchery
72*b077aed3SPierre ProncheryNote that the provider will not be made available for applications to use until
73*b077aed3SPierre Proncherythe initialization function has completed and returned successfully.
74*b077aed3SPierre Pronchery
75*b077aed3SPierre ProncheryOne of the functions the provider offers to the OpenSSL libraries is
76*b077aed3SPierre Proncherythe central mechanism for the OpenSSL libraries to get access to
77*b077aed3SPierre Proncheryoperation implementations for diverse algorithms.
78*b077aed3SPierre ProncheryIts referred to with the number B<OSSL_FUNC_PROVIDER_QUERY_OPERATION>
79*b077aed3SPierre Proncheryand has the following signature:
80*b077aed3SPierre Pronchery
81*b077aed3SPierre Pronchery const OSSL_ALGORITHM *provider_query_operation(void *provctx,
82*b077aed3SPierre Pronchery                                                int operation_id,
83*b077aed3SPierre Pronchery                                                const int *no_store);
84*b077aed3SPierre Pronchery
85*b077aed3SPierre ProncheryI<provctx> is the provider specific context that was passed back by
86*b077aed3SPierre Proncherythe initialization function.
87*b077aed3SPierre Pronchery
88*b077aed3SPierre ProncheryI<operation_id> is an operation identity (see L</Operations> below).
89*b077aed3SPierre Pronchery
90*b077aed3SPierre ProncheryI<no_store> is a flag back to the OpenSSL libraries which, when
91*b077aed3SPierre Proncherynonzero, signifies that the OpenSSL libraries will not store a
92*b077aed3SPierre Proncheryreference to the returned data in their internal store of
93*b077aed3SPierre Proncheryimplementations.
94*b077aed3SPierre Pronchery
95*b077aed3SPierre ProncheryThe returned L<OSSL_ALGORITHM(3)> is the foundation of any OpenSSL
96*b077aed3SPierre Proncherylibrary API that uses providers for their implementation, most
97*b077aed3SPierre Proncherycommonly in the I<fetching> type of functions
98*b077aed3SPierre Pronchery(see L<crypto(7)/ALGORITHM FETCHING>).
99*b077aed3SPierre Pronchery
100*b077aed3SPierre Pronchery=head2 Operations
101*b077aed3SPierre Pronchery
102*b077aed3SPierre ProncheryOperations are referred to with numbers, via macros with names
103*b077aed3SPierre Proncherystarting with C<OSSL_OP_>.
104*b077aed3SPierre Pronchery
105*b077aed3SPierre ProncheryWith each operation comes a set of defined function types that a
106*b077aed3SPierre Proncheryprovider may or may not offer, depending on its needs.
107*b077aed3SPierre Pronchery
108*b077aed3SPierre ProncheryCurrently available operations are:
109*b077aed3SPierre Pronchery
110*b077aed3SPierre Pronchery=over 4
111*b077aed3SPierre Pronchery
112*b077aed3SPierre Pronchery=item Digests
113*b077aed3SPierre Pronchery
114*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
115*b077aed3SPierre ProncheryB<EVP_MD>.
116*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_DIGEST>.
117*b077aed3SPierre ProncheryThe functions the provider can offer are described in
118*b077aed3SPierre ProncheryL<provider-digest(7)>.
119*b077aed3SPierre Pronchery
120*b077aed3SPierre Pronchery=item Symmetric ciphers
121*b077aed3SPierre Pronchery
122*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
123*b077aed3SPierre ProncheryB<EVP_CIPHER>.
124*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_CIPHER>.
125*b077aed3SPierre ProncheryThe functions the provider can offer are described in
126*b077aed3SPierre ProncheryL<provider-cipher(7)>.
127*b077aed3SPierre Pronchery
128*b077aed3SPierre Pronchery=item Message Authentication Code (MAC)
129*b077aed3SPierre Pronchery
130*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
131*b077aed3SPierre ProncheryB<EVP_MAC>.
132*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_MAC>.
133*b077aed3SPierre ProncheryThe functions the provider can offer are described in
134*b077aed3SPierre ProncheryL<provider-mac(7)>.
135*b077aed3SPierre Pronchery
136*b077aed3SPierre Pronchery=item Key Derivation Function (KDF)
137*b077aed3SPierre Pronchery
138*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
139*b077aed3SPierre ProncheryB<EVP_KDF>.
140*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_KDF>.
141*b077aed3SPierre ProncheryThe functions the provider can offer are described in
142*b077aed3SPierre ProncheryL<provider-kdf(7)>.
143*b077aed3SPierre Pronchery
144*b077aed3SPierre Pronchery=item Key Exchange
145*b077aed3SPierre Pronchery
146*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
147*b077aed3SPierre ProncheryB<EVP_KEYEXCH>.
148*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_KEYEXCH>.
149*b077aed3SPierre ProncheryThe functions the provider can offer are described in
150*b077aed3SPierre ProncheryL<provider-keyexch(7)>.
151*b077aed3SPierre Pronchery
152*b077aed3SPierre Pronchery=item Asymmetric Ciphers
153*b077aed3SPierre Pronchery
154*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
155*b077aed3SPierre ProncheryB<EVP_ASYM_CIPHER>.
156*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_ASYM_CIPHER>.
157*b077aed3SPierre ProncheryThe functions the provider can offer are described in
158*b077aed3SPierre ProncheryL<provider-asym_cipher(7)>.
159*b077aed3SPierre Pronchery
160*b077aed3SPierre Pronchery=item Asymmetric Key Encapsulation
161*b077aed3SPierre Pronchery
162*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is B<EVP_KEM>.
163*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_KEM>.
164*b077aed3SPierre ProncheryThe functions the provider can offer are described in L<provider-kem(7)>.
165*b077aed3SPierre Pronchery
166*b077aed3SPierre Pronchery=item Encoding
167*b077aed3SPierre Pronchery
168*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
169*b077aed3SPierre ProncheryB<OSSL_ENCODER>.
170*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_ENCODER>.
171*b077aed3SPierre ProncheryThe functions the provider can offer are described in
172*b077aed3SPierre ProncheryL<provider-encoder(7)>.
173*b077aed3SPierre Pronchery
174*b077aed3SPierre Pronchery=item Decoding
175*b077aed3SPierre Pronchery
176*b077aed3SPierre ProncheryIn the OpenSSL libraries, the corresponding method object is
177*b077aed3SPierre ProncheryB<OSSL_DECODER>.
178*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_DECODER>.
179*b077aed3SPierre ProncheryThe functions the provider can offer are described in
180*b077aed3SPierre ProncheryL<provider-decoder(7)>.
181*b077aed3SPierre Pronchery
182*b077aed3SPierre Pronchery=item Random Number Generation
183*b077aed3SPierre Pronchery
184*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_RAND>.
185*b077aed3SPierre ProncheryThe functions the provider can offer for random number generation are described
186*b077aed3SPierre Proncheryin L<provider-rand(7)>.
187*b077aed3SPierre Pronchery
188*b077aed3SPierre Pronchery=item Key Management
189*b077aed3SPierre Pronchery
190*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_KEYMGMT>.
191*b077aed3SPierre ProncheryThe functions the provider can offer for key management are described in
192*b077aed3SPierre ProncheryL<provider-keymgmt(7)>.
193*b077aed3SPierre Pronchery
194*b077aed3SPierre Pronchery=item Signing and Signature Verification
195*b077aed3SPierre Pronchery
196*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_SIGNATURE>.
197*b077aed3SPierre ProncheryThe functions the provider can offer for digital signatures are described in
198*b077aed3SPierre ProncheryL<provider-signature(7)>.
199*b077aed3SPierre Pronchery
200*b077aed3SPierre Pronchery=item Store Management
201*b077aed3SPierre Pronchery
202*b077aed3SPierre ProncheryThe number for this operation is B<OSSL_OP_STORE>.
203*b077aed3SPierre ProncheryThe functions the provider can offer for store management are described in
204*b077aed3SPierre ProncheryL<provider-storemgmt(7)>.
205*b077aed3SPierre Pronchery
206*b077aed3SPierre Pronchery=back
207*b077aed3SPierre Pronchery
208*b077aed3SPierre Pronchery=head3 Algorithm naming
209*b077aed3SPierre Pronchery
210*b077aed3SPierre ProncheryAlgorithm names are case insensitive. Any particular algorithm can have multiple
211*b077aed3SPierre Proncheryaliases associated with it. The canonical OpenSSL naming scheme follows this
212*b077aed3SPierre Proncheryformat:
213*b077aed3SPierre Pronchery
214*b077aed3SPierre ProncheryALGNAME[VERSION?][-SUBNAME[VERSION?]?][-SIZE?][-MODE?]
215*b077aed3SPierre Pronchery
216*b077aed3SPierre ProncheryVERSION is only present if there are multiple versions of an algorithm (e.g.
217*b077aed3SPierre ProncheryMD2, MD4, MD5).  It may be omitted if there is only one version.
218*b077aed3SPierre Pronchery
219*b077aed3SPierre ProncherySUBNAME may be present where multiple algorithms are combined together,
220*b077aed3SPierre Proncherye.g. MD5-SHA1.
221*b077aed3SPierre Pronchery
222*b077aed3SPierre ProncherySIZE is only present if multiple versions of an algorithm exist with different
223*b077aed3SPierre Proncherysizes (e.g. AES-128-CBC, AES-256-CBC)
224*b077aed3SPierre Pronchery
225*b077aed3SPierre ProncheryMODE is only present where applicable.
226*b077aed3SPierre Pronchery
227*b077aed3SPierre ProncheryOther aliases may exist for example where standards bodies or common practice
228*b077aed3SPierre Proncheryuse alternative names or names that OpenSSL has used historically.
229*b077aed3SPierre Pronchery
230*b077aed3SPierre Pronchery=head1 OPENSSL PROVIDERS
231*b077aed3SPierre Pronchery
232*b077aed3SPierre ProncheryOpenSSL provides a number of its own providers. These are the default, base,
233*b077aed3SPierre Proncheryfips, legacy and null providers. See L<crypto(7)> for an overview of these
234*b077aed3SPierre Proncheryproviders.
235*b077aed3SPierre Pronchery
236*b077aed3SPierre Pronchery=head1 SEE ALSO
237*b077aed3SPierre Pronchery
238*b077aed3SPierre ProncheryL<EVP_DigestInit_ex(3)>, L<EVP_EncryptInit_ex(3)>,
239*b077aed3SPierre ProncheryL<OSSL_LIB_CTX(3)>,
240*b077aed3SPierre ProncheryL<EVP_set_default_properties(3)>,
241*b077aed3SPierre ProncheryL<EVP_MD_fetch(3)>,
242*b077aed3SPierre ProncheryL<EVP_CIPHER_fetch(3)>,
243*b077aed3SPierre ProncheryL<EVP_KEYMGMT_fetch(3)>,
244*b077aed3SPierre ProncheryL<openssl-core.h(7)>,
245*b077aed3SPierre ProncheryL<provider-base(7)>,
246*b077aed3SPierre ProncheryL<provider-digest(7)>,
247*b077aed3SPierre ProncheryL<provider-cipher(7)>,
248*b077aed3SPierre ProncheryL<provider-keyexch(7)>
249*b077aed3SPierre Pronchery
250*b077aed3SPierre Pronchery=head1 HISTORY
251*b077aed3SPierre Pronchery
252*b077aed3SPierre ProncheryThe concept of providers and everything surrounding them was
253*b077aed3SPierre Proncheryintroduced in OpenSSL 3.0.
254*b077aed3SPierre Pronchery
255*b077aed3SPierre Pronchery=head1 COPYRIGHT
256*b077aed3SPierre Pronchery
257*b077aed3SPierre ProncheryCopyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
258*b077aed3SPierre Pronchery
259*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
260*b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
261*b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
262*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
263*b077aed3SPierre Pronchery
264*b077aed3SPierre Pronchery=cut
265