xref: /freebsd/crypto/openssl/doc/man7/migration_guide.pod (revision 7937bfbc0ca53fe7cdd0d54414f9296e273a518e)
1=pod
2
3=head1 NAME
4
5migration_guide - OpenSSL migration guide
6
7=head1 SYNOPSIS
8
9See the individual manual pages for details.
10
11=head1 DESCRIPTION
12
13This guide details the changes required to migrate to new versions of OpenSSL.
14Currently this covers OpenSSL 3.0. For earlier versions refer to
15L<https://github.com/openssl/openssl/blob/master/CHANGES.md>.
16For an overview of some of the key concepts introduced in OpenSSL 3.0 see
17L<crypto(7)>.
18
19=head1 OPENSSL 3.0
20
21=head2 Main Changes from OpenSSL 1.1.1
22
23=head3 Major Release
24
25OpenSSL 3.0 is a major release and consequently any application that currently
26uses an older version of OpenSSL will at the very least need to be recompiled in
27order to work with the new version. It is the intention that the large majority
28of applications will work unchanged with OpenSSL 3.0 if those applications
29previously worked with OpenSSL 1.1.1. However this is not guaranteed and some
30changes may be required in some cases. Changes may also be required if
31applications need to take advantage of some of the new features available in
32OpenSSL 3.0 such as the availability of the FIPS module.
33
34=head3 License Change
35
36In previous versions, OpenSSL was licensed under the L<dual OpenSSL and SSLeay
37licenses|https://www.openssl.org/source/license-openssl-ssleay.txt>
38(both licenses apply). From OpenSSL 3.0 this is replaced by the
39L<Apache License v2|https://www.openssl.org/source/apache-license-2.0.txt>.
40
41=head3 Providers and FIPS support
42
43One of the key changes from OpenSSL 1.1.1 is the introduction of the Provider
44concept. Providers collect together and make available algorithm implementations.
45With OpenSSL 3.0 it is possible to specify, either programmatically or via a
46config file, which providers you want to use for any given application.
47OpenSSL 3.0 comes with 5 different providers as standard. Over time third
48parties may distribute additional providers that can be plugged into OpenSSL.
49All algorithm implementations available via providers are accessed through the
50"high level" APIs (for example those functions prefixed with C<EVP>). They cannot
51be accessed using the L</Low Level APIs>.
52
53One of the standard providers available is the FIPS provider. This makes
54available FIPS validated cryptographic algorithms.
55The FIPS provider is disabled by default and needs to be enabled explicitly
56at configuration time using the C<enable-fips> option. If it is enabled,
57the FIPS provider gets built and installed in addition to the other standard
58providers. No separate installation procedure is necessary.
59There is however a dedicated C<install_fips> make target, which serves the
60special purpose of installing only the FIPS provider into an existing
61OpenSSL installation.
62
63Not all algorithms may be available for the application at a particular moment.
64If the application code uses any digest or cipher algorithm via the EVP interface,
65the application should verify the result of the L<EVP_EncryptInit(3)>,
66L<EVP_EncryptInit_ex(3)>, and L<EVP_DigestInit(3)> functions. In case when
67the requested algorithm is not available, these functions will fail.
68
69See also L</Legacy Algorithms> for information on the legacy provider.
70
71See also L</Completing the installation of the FIPS Module> and
72L</Using the FIPS Module in applications>.
73
74=head3 Low Level APIs
75
76OpenSSL has historically provided two sets of APIs for invoking cryptographic
77algorithms: the "high level" APIs (such as the C<EVP> APIs) and the "low level"
78APIs. The high level APIs are typically designed to work across all algorithm
79types. The "low level" APIs are targeted at a specific algorithm implementation.
80For example, the EVP APIs provide the functions L<EVP_EncryptInit_ex(3)>,
81L<EVP_EncryptUpdate(3)> and L<EVP_EncryptFinal(3)> to perform symmetric
82encryption. Those functions can be used with the algorithms AES, CHACHA, 3DES etc.
83On the other hand, to do AES encryption using the low level APIs you would have
84to call AES specific functions such as L<AES_set_encrypt_key(3)>,
85L<AES_encrypt(3)>, and so on. The functions for 3DES are different.
86Use of the low level APIs has been informally discouraged by the OpenSSL
87development team for a long time. However in OpenSSL 3.0 this is made more
88formal. All such low level APIs have been deprecated. You may still use them in
89your applications, but you may start to see deprecation warnings during
90compilation (dependent on compiler support for this). Deprecated APIs may be
91removed from future versions of OpenSSL so you are strongly encouraged to update
92your code to use the high level APIs instead.
93
94This is described in more detail in L</Deprecation of Low Level Functions>
95
96=head3 Legacy Algorithms
97
98Some cryptographic algorithms such as B<MD2> and B<DES> that were available via
99the EVP APIs are now considered legacy and their use is strongly discouraged.
100These legacy EVP algorithms are still available in OpenSSL 3.0 but not by
101default. If you want to use them then you must load the legacy provider.
102This can be as simple as a config file change, or can be done programmatically.
103See L<OSSL_PROVIDER-legacy(7)> for a complete list of algorithms.
104Applications using the EVP APIs to access these algorithms should instead use
105more modern algorithms. If that is not possible then these applications
106should ensure that the legacy provider has been loaded. This can be achieved
107either programmatically or via configuration. See L<crypto(7)> man page for
108more information about providers.
109
110=head3 Engines and "METHOD" APIs
111
112The refactoring to support Providers conflicts internally with the APIs used to
113support engines, including the ENGINE API and any function that creates or
114modifies custom "METHODS" (for example L<EVP_MD_meth_new(3)>,
115L<EVP_CIPHER_meth_new(3)>, L<EVP_PKEY_meth_new(3)>, L<RSA_meth_new(3)>,
116L<EC_KEY_METHOD_new(3)>, etc.). These functions are being deprecated in
117OpenSSL 3.0, and users of these APIs should know that their use can likely
118bypass provider selection and configuration, with unintended consequences.
119This is particularly relevant for applications written to use the OpenSSL 3.0
120FIPS module, as detailed below. Authors and maintainers of external engines are
121strongly encouraged to refactor their code transforming engines into providers
122using the new Provider API and avoiding deprecated methods.
123
124=head3 Support of legacy engines
125
126If openssl is not built without engine support or deprecated API support, engines
127will still work. However, their applicability will be limited.
128
129New algorithms provided via engines will still work.
130
131Engine-backed keys can be loaded via custom B<OSSL_STORE> implementation.
132In this case the B<EVP_PKEY> objects created via L<ENGINE_load_private_key(3)>
133will be considered legacy and will continue to work.
134
135To ensure the future compatibility, the engines should be turned to providers.
136To prefer the provider-based hardware offload, you can specify the default
137properties to prefer your provider.
138
139Setting engine-based or application-based default low-level crypto method such
140as B<RSA_METHOD> or B<EC_KEY_METHOD> is still possible and keys inside the
141default provider will use the engine-based implementation for the crypto
142operations. However B<EVP_PKEY>s created by decoding by using B<OSSL_DECODER>,
143B<PEM_> or B<d2i_> APIs will be provider-based. To create a fully legacy
144B<EVP_PKEY>s L<EVP_PKEY_set1_RSA(3)>, L<EVP_PKEY_set1_EC_KEY(3)> or similar
145functions must be used.
146
147=head3 Versioning Scheme
148
149The OpenSSL versioning scheme has changed with the OpenSSL 3.0 release. The new
150versioning scheme has this format:
151
152MAJOR.MINOR.PATCH
153
154For OpenSSL 1.1.1 and below, different patch levels were indicated by a letter
155at the end of the release version number. This will no longer be used and
156instead the patch level is indicated by the final number in the version. A
157change in the second (MINOR) number indicates that new features may have been
158added. OpenSSL versions with the same major number are API and ABI compatible.
159If the major number changes then API and ABI compatibility is not guaranteed.
160
161For more information, see L<OpenSSL_version(3)>.
162
163=head3 Other major new features
164
165=head4 Certificate Management Protocol (CMP, RFC 4210)
166
167This also covers CRMF (RFC 4211) and HTTP transfer (RFC 6712)
168See L<openssl-cmp(1)> and L<OSSL_CMP_exec_certreq(3)> as starting points.
169
170=head4 HTTP(S) client
171
172A proper HTTP(S) client that supports GET and POST, redirection, plain and
173ASN.1-encoded contents, proxies, and timeouts.
174
175=head4 Key Derivation Function API (EVP_KDF)
176
177This simplifies the process of adding new KDF and PRF implementations.
178
179Previously KDF algorithms had been shoe-horned into using the EVP_PKEY object
180which was not a logical mapping.
181Existing applications that use KDF algorithms using EVP_PKEY
182(scrypt, TLS1 PRF and HKDF) may be slower as they use an EVP_KDF bridge
183internally.
184All new applications should use the new L<EVP_KDF(3)> interface.
185See also L<OSSL_PROVIDER-default(7)/Key Derivation Function (KDF)> and
186L<OSSL_PROVIDER-FIPS(7)/Key Derivation Function (KDF)>.
187
188=head4 Message Authentication Code API (EVP_MAC)
189
190This simplifies the process of adding MAC implementations.
191
192This includes a generic EVP_PKEY to EVP_MAC bridge, to facilitate the continued
193use of MACs through raw private keys in functionality such as
194L<EVP_DigestSign(3)> and L<EVP_DigestVerify(3)>.
195
196All new applications should use the new L<EVP_MAC(3)> interface.
197See also L<OSSL_PROVIDER-default(7)/Message Authentication Code (MAC)>
198and L<OSSL_PROVIDER-FIPS(7)/Message Authentication Code (MAC)>.
199
200=head4 Algorithm Fetching
201
202Using calls to convenience functions such as EVP_sha256() and EVP_aes_256_gcm() may
203incur a performance penalty when using providers.
204Retrieving algorithms from providers involves searching for an algorithm by name.
205This is much slower than directly accessing a method table.
206It is recommended to prefetch algorithms if an algorithm is used many times.
207See L<crypto(7)/Performance>, L<crypto(7)/Explicit fetching> and L<crypto(7)/Implicit fetching>.
208
209=head4 Support for Linux Kernel TLS
210
211In order to use KTLS, support for it must be compiled in using the
212C<enable-ktls> configuration option. It must also be enabled at run time using
213the B<SSL_OP_ENABLE_KTLS> option.
214
215=head4 New Algorithms
216
217=over 4
218
219=item *
220
221KDF algorithms "SINGLE STEP" and "SSH"
222
223See L<EVP_KDF-SS(7)> and L<EVP_KDF-SSHKDF(7)>
224
225=item *
226
227MAC Algorithms "GMAC" and "KMAC"
228
229See L<EVP_MAC-GMAC(7)> and L<EVP_MAC-KMAC(7)>.
230
231=item *
232
233KEM Algorithm "RSASVE"
234
235See L<EVP_KEM-RSA(7)>.
236
237=item *
238
239Cipher Algorithm "AES-SIV"
240
241See L<EVP_EncryptInit(3)/SIV Mode>.
242
243=item *
244
245AES Key Wrap inverse ciphers supported by EVP layer.
246
247The inverse ciphers use AES decryption for wrapping, and AES encryption for
248unwrapping. The algorithms are: "AES-128-WRAP-INV", "AES-192-WRAP-INV",
249"AES-256-WRAP-INV", "AES-128-WRAP-PAD-INV", "AES-192-WRAP-PAD-INV" and
250"AES-256-WRAP-PAD-INV".
251
252=item *
253
254CTS ciphers added to EVP layer.
255
256The algorithms are "AES-128-CBC-CTS", "AES-192-CBC-CTS", "AES-256-CBC-CTS",
257"CAMELLIA-128-CBC-CTS", "CAMELLIA-192-CBC-CTS" and "CAMELLIA-256-CBC-CTS".
258CS1, CS2 and CS3 variants are supported.
259
260=back
261
262=head4 CMS and PKCS#7 updates
263
264=over 4
265
266=item *
267
268Added CAdES-BES signature verification support.
269
270=item *
271
272Added CAdES-BES signature scheme and attributes support (RFC 5126) to CMS API.
273
274=item *
275
276Added AuthEnvelopedData content type structure (RFC 5083) using AES_GCM
277
278This uses the AES-GCM parameter (RFC 5084) for the Cryptographic Message Syntax.
279Its purpose is to support encryption and decryption of a digital envelope that
280is both authenticated and encrypted using AES GCM mode.
281
282=item *
283
284L<PKCS7_get_octet_string(3)> and L<PKCS7_type_is_other(3)> were made public.
285
286=back
287
288=head4 PKCS#12 API updates
289
290The default algorithms for pkcs12 creation with the PKCS12_create() function
291were changed to more modern PBKDF2 and AES based algorithms. The default
292MAC iteration count was changed to PKCS12_DEFAULT_ITER to make it equal
293with the password-based encryption iteration count. The default digest
294algorithm for the MAC computation was changed to SHA-256. The pkcs12
295application now supports -legacy option that restores the previous
296default algorithms to support interoperability with legacy systems.
297
298Added enhanced PKCS#12 APIs which accept a library context B<OSSL_LIB_CTX>
299and (where relevant) a property query. Other APIs which handle PKCS#7 and
300PKCS#8 objects have also been enhanced where required. This includes:
301
302L<PKCS12_add_key_ex(3)>, L<PKCS12_add_safe_ex(3)>, L<PKCS12_add_safes_ex(3)>,
303L<PKCS12_create_ex(3)>, L<PKCS12_decrypt_skey_ex(3)>, L<PKCS12_init_ex(3)>,
304L<PKCS12_item_decrypt_d2i_ex(3)>, L<PKCS12_item_i2d_encrypt_ex(3)>,
305L<PKCS12_key_gen_asc_ex(3)>, L<PKCS12_key_gen_uni_ex(3)>, L<PKCS12_key_gen_utf8_ex(3)>,
306L<PKCS12_pack_p7encdata_ex(3)>, L<PKCS12_pbe_crypt_ex(3)>, L<PKCS12_PBE_keyivgen_ex(3)>,
307L<PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(3)>, L<PKCS5_pbe2_set_iv_ex(3)>,
308L<PKCS5_pbe_set0_algor_ex(3)>, L<PKCS5_pbe_set_ex(3)>, L<PKCS5_pbkdf2_set_ex(3)>,
309L<PKCS5_v2_PBE_keyivgen_ex(3)>, L<PKCS5_v2_scrypt_keyivgen_ex(3)>,
310L<PKCS8_decrypt_ex(3)>, L<PKCS8_encrypt_ex(3)>, L<PKCS8_set0_pbe_ex(3)>.
311
312As part of this change the EVP_PBE_xxx APIs can also accept a library
313context and property query and will call an extended version of the key/IV
314derivation function which supports these parameters. This includes
315L<EVP_PBE_CipherInit_ex(3)>, L<EVP_PBE_find_ex(3)> and L<EVP_PBE_scrypt_ex(3)>.
316
317=head4 PKCS#12 KDF versus FIPS
318
319Unlike in 1.x.y, the PKCS12KDF algorithm used when a PKCS#12 structure
320is created with a MAC that does not work with the FIPS provider as the PKCS12KDF
321is not a FIPS approvable mechanism.
322
323See L<EVP_KDF-PKCS12KDF(7)>, L<PKCS12_create(3)>, L<openssl-pkcs12(1)>,
324L<OSSL_PROVIDER-FIPS(7)>.
325
326=head4 Windows thread synchronization changes
327
328Windows thread synchronization uses read/write primitives (SRWLock) when
329supported by the OS, otherwise CriticalSection continues to be used.
330
331=head4 Trace API
332
333A new generic trace API has been added which provides support for enabling
334instrumentation through trace output. This feature is mainly intended as an aid
335for developers and is disabled by default. To utilize it, OpenSSL needs to be
336configured with the C<enable-trace> option.
337
338If the tracing API is enabled, the application can activate trace output by
339registering BIOs as trace channels for a number of tracing and debugging
340categories. See L<OSSL_trace_enabled(3)>.
341
342=head4 Key validation updates
343
344L<EVP_PKEY_public_check(3)> and L<EVP_PKEY_param_check(3)> now work for
345more key types. This includes RSA, DSA, ED25519, X25519, ED448 and X448.
346Previously (in 1.1.1) they would return -2. For key types that do not have
347parameters then L<EVP_PKEY_param_check(3)> will always return 1.
348
349=head3 Other notable deprecations and changes
350
351=head4 The function code part of an OpenSSL error code is no longer relevant
352
353This code is now always set to zero. Related functions are deprecated.
354
355=head4 STACK and HASH macros have been cleaned up
356
357The type-safe wrappers are declared everywhere and implemented once.
358See L<DEFINE_STACK_OF(3)> and L<DECLARE_LHASH_OF(3)>.
359
360=head4 The RAND_DRBG subsystem has been removed
361
362The new L<EVP_RAND(3)> is a partial replacement: the DRBG callback framework is
363absent. The RAND_DRBG API did not fit well into the new provider concept as
364implemented by EVP_RAND and EVP_RAND_CTX.
365
366=head4 Removed FIPS_mode() and FIPS_mode_set()
367
368These functions are legacy APIs that are not applicable to the new provider
369model. Applications should instead use
370L<EVP_default_properties_is_fips_enabled(3)> and
371L<EVP_default_properties_enable_fips(3)>.
372
373=head4 Key generation is slower
374
375The Miller-Rabin test now uses 64 rounds, which is used for all prime generation,
376including RSA key generation. This affects the time for larger keys sizes.
377
378The default key generation method for the regular 2-prime RSA keys was changed
379to the FIPS186-4 B.3.6 method (Generation of Probable Primes with Conditions
380Based on Auxiliary Probable Primes). This method is slower than the original
381method.
382
383=head4 Change PBKDF2 to conform to SP800-132 instead of the older PKCS5 RFC2898
384
385This checks that the salt length is at least 128 bits, the derived key length is
386at least 112 bits, and that the iteration count is at least 1000.
387For backwards compatibility these checks are disabled by default in the
388default provider, but are enabled by default in the FIPS provider.
389
390To enable or disable the checks see B<OSSL_KDF_PARAM_PKCS5> in
391L<EVP_KDF-PBKDF2(7)>. The parameter can be set using L<EVP_KDF_derive(3)>.
392
393=head4 Enforce a minimum DH modulus size of 512 bits
394
395Smaller sizes now result in an error.
396
397=head4 SM2 key changes
398
399EC EVP_PKEYs with the SM2 curve have been reworked to automatically become
400EVP_PKEY_SM2 rather than EVP_PKEY_EC.
401
402Unlike in previous OpenSSL versions, this means that applications cannot
403call C<EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2)> to get SM2 computations.
404
405Parameter and key generation is also reworked to make it possible
406to generate EVP_PKEY_SM2 parameters and keys. Applications must now generate
407SM2 keys directly and must not create an EVP_PKEY_EC key first. It is no longer
408possible to import an SM2 key with domain parameters other than the SM2 elliptic
409curve ones.
410
411Validation of SM2 keys has been separated from the validation of regular EC
412keys, allowing to improve the SM2 validation process to reject loaded private
413keys that are not conforming to the SM2 ISO standard.
414In particular, a private scalar I<k> outside the range I<< 1 <= k < n-1 >> is
415now correctly rejected.
416
417=head4 EVP_PKEY_set_alias_type() method has been removed
418
419This function made a B<EVP_PKEY> object mutable after it had been set up. In
420OpenSSL 3.0 it was decided that a provided key should not be able to change its
421type, so this function has been removed.
422
423=head4 Functions that return an internal key should be treated as read only
424
425Functions such as L<EVP_PKEY_get0_RSA(3)> behave slightly differently in
426OpenSSL 3.0. Previously they returned a pointer to the low-level key used
427internally by libcrypto. From OpenSSL 3.0 this key may now be held in a
428provider. Calling these functions will only return a handle on the internal key
429where the EVP_PKEY was constructed using this key in the first place, for
430example using a function or macro such as L<EVP_PKEY_assign_RSA(3)>,
431L<EVP_PKEY_set1_RSA(3)>, etc.
432Where the EVP_PKEY holds a provider managed key, then these functions now return
433a cached copy of the key. Changes to the internal provider key that take place
434after the first time the cached key is accessed will not be reflected back in
435the cached copy. Similarly any changes made to the cached copy by application
436code will not be reflected back in the internal provider key.
437
438For the above reasons the keys returned from these functions should typically be
439treated as read-only. To emphasise this the value returned from
440L<EVP_PKEY_get0_RSA(3)>, L<EVP_PKEY_get0_DSA(3)>, L<EVP_PKEY_get0_EC_KEY(3)> and
441L<EVP_PKEY_get0_DH(3)> have been made const. This may break some existing code.
442Applications broken by this change should be modified. The preferred solution is
443to refactor the code to avoid the use of these deprecated functions. Failing
444this the code should be modified to use a const pointer instead.
445The L<EVP_PKEY_get1_RSA(3)>, L<EVP_PKEY_get1_DSA(3)>, L<EVP_PKEY_get1_EC_KEY(3)>
446and L<EVP_PKEY_get1_DH(3)> functions continue to return a non-const pointer to
447enable them to be "freed". However they should also be treated as read-only.
448
449=head4 The public key check has moved from EVP_PKEY_derive() to EVP_PKEY_derive_set_peer()
450
451This may mean result in an error in L<EVP_PKEY_derive_set_peer(3)> rather than
452during L<EVP_PKEY_derive(3)>.
453To disable this check use EVP_PKEY_derive_set_peer_ex(dh, peer, 0).
454
455=head4 The print format has cosmetic changes for some functions
456
457The output from numerous "printing" functions such as L<X509_signature_print(3)>,
458L<X509_print_ex(3)>, L<X509_CRL_print_ex(3)>, and other similar functions has been
459amended such that there may be cosmetic differences between the output
460observed in 1.1.1 and 3.0. This also applies to the B<-text> output from the
461B<openssl x509> and B<openssl crl> applications.
462
463=head4 Interactive mode from the B<openssl> program has been removed
464
465From now on, running it without arguments is equivalent to B<openssl help>.
466
467=head4 The error return values from some control calls (ctrl) have changed
468
469One significant change is that controls which used to return -2 for
470invalid inputs, now return -1 indicating a generic error condition instead.
471
472=head4 DH and DHX key types have different settable parameters
473
474Previously (in 1.1.1) these conflicting parameters were allowed, but will now
475result in errors. See L<EVP_PKEY-DH(7)> for further details. This affects the
476behaviour of L<openssl-genpkey(1)> for DH parameter generation.
477
478=head4 EVP_CIPHER_CTX_set_flags() ordering change
479
480If using a cipher from a provider the B<EVP_CIPH_FLAG_LENGTH_BITS> flag can only
481be set B<after> the cipher has been assigned to the cipher context.
482See L<EVP_EncryptInit(3)/FLAGS> for more information.
483
484=head4 Validation of operation context parameters
485
486Due to move of the implementation of cryptographic operations to the
487providers, validation of various operation parameters can be postponed until
488the actual operation is executed where previously it happened immediately
489when an operation parameter was set.
490
491For example when setting an unsupported curve with
492EVP_PKEY_CTX_set_ec_paramgen_curve_nid() this function call will not fail
493but later keygen operations with the EVP_PKEY_CTX will fail.
494
495=head4 Removal of function code from the error codes
496
497The function code part of the error code is now always set to 0. For that
498reason the ERR_GET_FUNC() macro was removed. Applications must resolve
499the error codes only using the library number and the reason code.
500
501=head4 ChaCha20-Poly1305 cipher does not allow a truncated IV length to be used
502
503In OpenSSL 3.0 setting the IV length to any value other than 12 will result in an
504error.
505Prior to OpenSSL 3.0 the ivlen could be smaller that the required 12 byte length,
506using EVP_CIPHER_CTX_ctrl(ctx, EVP_CRTL_AEAD_SET_IVLEN, ivlen, NULL). This resulted
507in an IV that had leading zero padding.
508
509=head2 Installation and Compilation
510
511Please refer to the INSTALL.md file in the top of the distribution for
512instructions on how to build and install OpenSSL 3.0. Please also refer to the
513various platform specific NOTES files for your specific platform.
514
515=head2 Upgrading from OpenSSL 1.1.1
516
517Upgrading to OpenSSL 3.0 from OpenSSL 1.1.1 should be relatively straight
518forward in most cases. The most likely area where you will encounter problems
519is if you have used low level APIs in your code (as discussed above). In that
520case you are likely to start seeing deprecation warnings when compiling your
521application. If this happens you have 3 options:
522
523=over 4
524
525=item 1.
526
527Ignore the warnings. They are just warnings. The deprecated functions are still present and you may still use them. However be aware that they may be removed from a future version of OpenSSL.
528
529=item 2.
530
531Suppress the warnings. Refer to your compiler documentation on how to do this.
532
533=item 3.
534
535Remove your usage of the low level APIs. In this case you will need to rewrite your code to use the high level APIs instead
536
537=back
538
539=head3 Error code changes
540
541As OpenSSL 3.0 provides a brand new Encoder/Decoder mechanism for working with
542widely used file formats, application code that checks for particular error
543reason codes on key loading failures might need an update.
544
545Password-protected keys may deserve special attention. If only some errors
546are treated as an indicator that the user should be asked about the password again,
547it's worth testing these scenarios and processing the newly relevant codes.
548
549There may be more cases to treat specially, depending on the calling application code.
550
551=head2 Upgrading from OpenSSL 1.0.2
552
553Upgrading to OpenSSL 3.0 from OpenSSL 1.0.2 is likely to be significantly more
554difficult. In addition to the issues discussed above in the section about
555L</Upgrading from OpenSSL 1.1.1>, the main things to be aware of are:
556
557=over 4
558
559=item 1.
560
561The build and installation procedure has changed significantly.
562
563Check the file INSTALL.md in the top of the installation for instructions on how
564to build and install OpenSSL for your platform. Also read the various NOTES
565files in the same directory, as applicable for your platform.
566
567=item 2.
568
569Many structures have been made opaque in OpenSSL 3.0.
570
571The structure definitions have been removed from the public header files and
572moved to internal header files. In practice this means that you can no longer
573stack allocate some structures. Instead they must be heap allocated through some
574function call (typically those function names have a C<_new> suffix to them).
575Additionally you must use "setter" or "getter" functions to access the fields
576within those structures.
577
578For example code that previously looked like this:
579
580 EVP_MD_CTX md_ctx;
581
582 /* This line will now generate compiler errors */
583 EVP_MD_CTX_init(&md_ctx);
584
585The code needs to be amended to look like this:
586
587 EVP_MD_CTX *md_ctx;
588
589 md_ctx = EVP_MD_CTX_new();
590 ...
591 ...
592 EVP_MD_CTX_free(md_ctx);
593
594=item 3.
595
596Support for TLSv1.3 has been added.
597
598This has a number of implications for SSL/TLS applications. See the
599L<TLS1.3 page|https://wiki.openssl.org/index.php/TLS1.3> for further details.
600
601=back
602
603More details about the breaking changes between OpenSSL versions 1.0.2 and 1.1.0
604can be found on the
605L<OpenSSL 1.1.0 Changes page|https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes>.
606
607=head3 Upgrading from the OpenSSL 2.0 FIPS Object Module
608
609The OpenSSL 2.0 FIPS Object Module was a separate download that had to be built
610separately and then integrated into your main OpenSSL 1.0.2 build.
611In OpenSSL 3.0 the FIPS support is fully integrated into the mainline version of
612OpenSSL and is no longer a separate download. For further information see
613L</Completing the installation of the FIPS Module>.
614
615The function calls FIPS_mode() and FIPS_mode_set() have been removed
616from OpenSSL 3.0. You should rewrite your application to not use them.
617See L<fips_module(7)> and L<OSSL_PROVIDER-FIPS(7)> for details.
618
619=head2 Completing the installation of the FIPS Module
620
621The FIPS Module will be built and installed automatically if FIPS support has
622been configured. The current documentation can be found in the
623L<README-FIPS|https://github.com/openssl/openssl/blob/master/README-FIPS.md> file.
624
625=head2 Programming
626
627Applications written to work with OpenSSL 1.1.1 will mostly just work with
628OpenSSL 3.0. However changes will be required if you want to take advantage of
629some of the new features that OpenSSL 3.0 makes available. In order to do that
630you need to understand some new concepts introduced in OpenSSL 3.0.
631Read L<crypto(7)/Library contexts> for further information.
632
633=head3 Library Context
634
635A library context allows different components of a complex application to each
636use a different library context and have different providers loaded with
637different configuration settings.
638See L<crypto(7)/Library contexts> for further info.
639
640If the user creates an B<OSSL_LIB_CTX> via L<OSSL_LIB_CTX_new(3)> then many
641functions may need to be changed to pass additional parameters to handle the
642library context.
643
644=head4 Using a Library Context - Old functions that should be changed
645
646If a library context is needed then all EVP_* digest functions that return a
647B<const EVP_MD *> such as EVP_sha256() should be replaced with a call to
648L<EVP_MD_fetch(3)>. See L<crypto(7)/ALGORITHM FETCHING>.
649
650If a library context is needed then all EVP_* cipher functions that return a
651B<const EVP_CIPHER *> such as EVP_aes_128_cbc() should be replaced vith a call to
652L<EVP_CIPHER_fetch(3)>. See L<crypto(7)/ALGORITHM FETCHING>.
653
654Some functions can be passed an object that has already been set up with a library
655context such as L<d2i_X509(3)>, L<d2i_X509_CRL(3)>, L<d2i_X509_REQ(3)> and
656L<d2i_X509_PUBKEY(3)>. If NULL is passed instead then the created object will be
657set up with the default library context. Use L<X509_new_ex(3)>,
658L<X509_CRL_new_ex(3)>, L<X509_REQ_new_ex(3)> and L<X509_PUBKEY_new_ex(3)> if a
659library context is required.
660
661All functions listed below with a I<NAME> have a replacement function I<NAME_ex>
662that takes B<OSSL_LIB_CTX> as an additional argument. Functions that have other
663mappings are listed along with the respective name.
664
665=over 4
666
667=item *
668
669L<ASN1_item_new(3)>, L<ASN1_item_d2i(3)>, L<ASN1_item_d2i_fp(3)>,
670L<ASN1_item_d2i_bio(3)>, L<ASN1_item_sign(3)> and L<ASN1_item_verify(3)>
671
672=item *
673
674L<BIO_new(3)>
675
676=item *
677
678b2i_RSA_PVK_bio() and i2b_PVK_bio()
679
680=item *
681
682L<BN_CTX_new(3)> and L<BN_CTX_secure_new(3)>
683
684=item *
685
686L<CMS_AuthEnvelopedData_create(3)>, L<CMS_ContentInfo_new(3)>, L<CMS_data_create(3)>,
687L<CMS_digest_create(3)>, L<CMS_EncryptedData_encrypt(3)>, L<CMS_encrypt(3)>,
688L<CMS_EnvelopedData_create(3)>, L<CMS_ReceiptRequest_create0(3)> and L<CMS_sign(3)>
689
690=item *
691
692L<CONF_modules_load_file(3)>
693
694=item *
695
696L<CTLOG_new(3)>, L<CTLOG_new_from_base64(3)> and L<CTLOG_STORE_new(3)>
697
698=item *
699
700L<CT_POLICY_EVAL_CTX_new(3)>
701
702=item *
703
704L<d2i_AutoPrivateKey(3)>, L<d2i_PrivateKey(3)> and L<d2i_PUBKEY(3)>
705
706=item *
707
708L<d2i_PrivateKey_bio(3)> and L<d2i_PrivateKey_fp(3)>
709
710Use L<d2i_PrivateKey_ex_bio(3)> and L<d2i_PrivateKey_ex_fp(3)>
711
712=item *
713
714L<EC_GROUP_new(3)>
715
716Use L<EC_GROUP_new_by_curve_name_ex(3)> or L<EC_GROUP_new_from_params(3)>.
717
718=item *
719
720L<EVP_DigestSignInit(3)> and L<EVP_DigestVerifyInit(3)>
721
722=item *
723
724L<EVP_PBE_CipherInit(3)>, L<EVP_PBE_find(3)> and L<EVP_PBE_scrypt(3)>
725
726=item *
727
728L<PKCS5_PBE_keyivgen(3)>
729
730=item *
731
732L<EVP_PKCS82PKEY(3)>
733
734=item *
735
736L<EVP_PKEY_CTX_new_id(3)>
737
738Use L<EVP_PKEY_CTX_new_from_name(3)>
739
740=item *
741
742L<EVP_PKEY_derive_set_peer(3)>, L<EVP_PKEY_new_raw_private_key(3)>
743and L<EVP_PKEY_new_raw_public_key(3)>
744
745=item *
746
747L<EVP_SignFinal(3)> and L<EVP_VerifyFinal(3)>
748
749=item *
750
751L<NCONF_new(3)>
752
753=item *
754
755L<OCSP_RESPID_match(3)> and L<OCSP_RESPID_set_by_key(3)>
756
757=item *
758
759L<OPENSSL_thread_stop(3)>
760
761=item *
762
763L<OSSL_STORE_open(3)>
764
765=item *
766
767L<PEM_read_bio_Parameters(3)>, L<PEM_read_bio_PrivateKey(3)>, L<PEM_read_bio_PUBKEY(3)>,
768L<PEM_read_PrivateKey(3)> and L<PEM_read_PUBKEY(3)>
769
770=item *
771
772L<PEM_write_bio_PrivateKey(3)>, L<PEM_write_bio_PUBKEY(3)>, L<PEM_write_PrivateKey(3)>
773and L<PEM_write_PUBKEY(3)>
774
775=item *
776
777L<PEM_X509_INFO_read_bio(3)> and L<PEM_X509_INFO_read(3)>
778
779=item *
780
781L<PKCS12_add_key(3)>, L<PKCS12_add_safe(3)>, L<PKCS12_add_safes(3)>,
782L<PKCS12_create(3)>, L<PKCS12_decrypt_skey(3)>, L<PKCS12_init(3)>, L<PKCS12_item_decrypt_d2i(3)>,
783L<PKCS12_item_i2d_encrypt(3)>, L<PKCS12_key_gen_asc(3)>, L<PKCS12_key_gen_uni(3)>,
784L<PKCS12_key_gen_utf8(3)>, L<PKCS12_pack_p7encdata(3)>, L<PKCS12_pbe_crypt(3)>,
785L<PKCS12_PBE_keyivgen(3)>, L<PKCS12_SAFEBAG_create_pkcs8_encrypt(3)>
786
787=item *
788
789L<PKCS5_pbe_set0_algor(3)>, L<PKCS5_pbe_set(3)>, L<PKCS5_pbe2_set_iv(3)>,
790L<PKCS5_pbkdf2_set(3)> and L<PKCS5_v2_scrypt_keyivgen(3)>
791
792=item *
793
794L<PKCS7_encrypt(3)>, L<PKCS7_new(3)> and L<PKCS7_sign(3)>
795
796=item *
797
798L<PKCS8_decrypt(3)>, L<PKCS8_encrypt(3)> and L<PKCS8_set0_pbe(3)>
799
800=item *
801
802L<RAND_bytes(3)> and L<RAND_priv_bytes(3)>
803
804=item *
805
806L<SMIME_write_ASN1(3)>
807
808=item *
809
810L<SSL_load_client_CA_file(3)>
811
812=item *
813
814L<SSL_CTX_new(3)>
815
816=item *
817
818L<TS_RESP_CTX_new(3)>
819
820=item *
821
822L<X509_CRL_new(3)>
823
824=item *
825
826L<X509_load_cert_crl_file(3)> and L<X509_load_cert_file(3)>
827
828=item *
829
830L<X509_LOOKUP_by_subject(3)> and L<X509_LOOKUP_ctrl(3)>
831
832=item *
833
834L<X509_NAME_hash(3)>
835
836=item *
837
838L<X509_new(3)>
839
840=item *
841
842L<X509_REQ_new(3)> and L<X509_REQ_verify(3)>
843
844=item *
845
846L<X509_STORE_CTX_new(3)>, L<X509_STORE_set_default_paths(3)>, L<X509_STORE_load_file(3)>,
847L<X509_STORE_load_locations(3)> and L<X509_STORE_load_store(3)>
848
849=back
850
851=head4 New functions that use a Library context
852
853The following functions can be passed a library context if required.
854Passing NULL will use the default library context.
855
856=over 4
857
858=item *
859
860L<BIO_new_from_core_bio(3)>
861
862=item *
863
864L<EVP_ASYM_CIPHER_fetch(3)> and L<EVP_ASYM_CIPHER_do_all_provided(3)>
865
866=item *
867
868L<EVP_CIPHER_fetch(3)> and L<EVP_CIPHER_do_all_provided(3)>
869
870=item *
871
872L<EVP_default_properties_enable_fips(3)> and
873L<EVP_default_properties_is_fips_enabled(3)>
874
875=item *
876
877L<EVP_KDF_fetch(3)> and L<EVP_KDF_do_all_provided(3)>
878
879=item *
880
881L<EVP_KEM_fetch(3)> and L<EVP_KEM_do_all_provided(3)>
882
883=item *
884
885L<EVP_KEYEXCH_fetch(3)> and L<EVP_KEYEXCH_do_all_provided(3)>
886
887=item *
888
889L<EVP_KEYMGMT_fetch(3)> and L<EVP_KEYMGMT_do_all_provided(3)>
890
891=item *
892
893L<EVP_MAC_fetch(3)> and L<EVP_MAC_do_all_provided(3)>
894
895=item *
896
897L<EVP_MD_fetch(3)> and L<EVP_MD_do_all_provided(3)>
898
899=item *
900
901L<EVP_PKEY_CTX_new_from_pkey(3)>
902
903=item *
904
905L<EVP_PKEY_Q_keygen(3)>
906
907=item *
908
909L<EVP_Q_mac(3)> and L<EVP_Q_digest(3)>
910
911=item *
912
913L<EVP_RAND(3)> and L<EVP_RAND_do_all_provided(3)>
914
915=item *
916
917L<EVP_set_default_properties(3)>
918
919=item *
920
921L<EVP_SIGNATURE_fetch(3)> and L<EVP_SIGNATURE_do_all_provided(3)>
922
923=item *
924
925L<OSSL_CMP_CTX_new(3)> and L<OSSL_CMP_SRV_CTX_new(3)>
926
927=item *
928
929L<OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(3)>
930
931=item *
932
933L<OSSL_CRMF_MSG_create_popo(3)> and L<OSSL_CRMF_MSGS_verify_popo(3)>
934
935=item *
936
937L<OSSL_CRMF_pbm_new(3)> and L<OSSL_CRMF_pbmp_new(3)>
938
939=item *
940
941L<OSSL_DECODER_CTX_add_extra(3)> and L<OSSL_DECODER_CTX_new_for_pkey(3)>
942
943=item *
944
945L<OSSL_DECODER_fetch(3)> and L<OSSL_DECODER_do_all_provided(3)>
946
947=item *
948
949L<OSSL_ENCODER_CTX_add_extra(3)>
950
951=item *
952
953L<OSSL_ENCODER_fetch(3)> and L<OSSL_ENCODER_do_all_provided(3)>
954
955=item *
956
957L<OSSL_LIB_CTX_free(3)>, L<OSSL_LIB_CTX_load_config(3)> and L<OSSL_LIB_CTX_set0_default(3)>
958
959=item *
960
961L<OSSL_PROVIDER_add_builtin(3)>, L<OSSL_PROVIDER_available(3)>,
962L<OSSL_PROVIDER_do_all(3)>, L<OSSL_PROVIDER_load(3)>,
963L<OSSL_PROVIDER_set_default_search_path(3)> and L<OSSL_PROVIDER_try_load(3)>
964
965=item *
966
967L<OSSL_SELF_TEST_get_callback(3)> and L<OSSL_SELF_TEST_set_callback(3)>
968
969=item *
970
971L<OSSL_STORE_attach(3)>
972
973=item *
974
975L<OSSL_STORE_LOADER_fetch(3)> and L<OSSL_STORE_LOADER_do_all_provided(3)>
976
977=item *
978
979L<RAND_get0_primary(3)>, L<RAND_get0_private(3)>, L<RAND_get0_public(3)>,
980L<RAND_set_DRBG_type(3)> and L<RAND_set_seed_source_type(3)>
981
982=back
983
984=head3 Providers
985
986Providers are described in detail here L<crypto(7)/Providers>.
987See also L<crypto(7)/OPENSSL PROVIDERS>.
988
989=head3 Fetching algorithms and property queries
990
991Implicit and Explicit Fetching is described in detail here
992L<crypto(7)/ALGORITHM FETCHING>.
993
994=head3 Mapping EVP controls and flags to provider L<OSSL_PARAM(3)> parameters
995
996The existing functions for controls (such as L<EVP_CIPHER_CTX_ctrl(3)>) and
997manipulating flags (such as L<EVP_MD_CTX_set_flags(3)>)internally use
998B<OSSL_PARAMS> to pass information to/from provider objects.
999See L<OSSL_PARAM(3)> for additional information related to parameters.
1000
1001For ciphers see L<EVP_EncryptInit(3)/CONTROLS>, L<EVP_EncryptInit(3)/FLAGS> and
1002L<EVP_EncryptInit(3)/PARAMETERS>.
1003
1004For digests see L<EVP_DigestInit(3)/CONTROLS>, L<EVP_DigestInit(3)/FLAGS> and
1005L<EVP_DigestInit(3)/PARAMETERS>.
1006
1007=head3 Deprecation of Low Level Functions
1008
1009A significant number of APIs have been deprecated in OpenSSL 3.0.
1010This section describes some common categories of deprecations.
1011See L</Deprecated function mappings> for the list of deprecated functions
1012that refer to these categories.
1013
1014=head4 Providers are a replacement for engines and low-level method overrides
1015
1016Any accessor that uses an ENGINE is deprecated (such as EVP_PKEY_set1_engine()).
1017Applications using engines should instead use providers.
1018
1019Before providers were added algorithms were overridden by changing the methods
1020used by algorithms. All these methods such as RSA_new_method() and RSA_meth_new()
1021are now deprecated and can be replaced by using providers instead.
1022
1023=head4 Deprecated i2d and d2i functions for low-level key types
1024
1025Any i2d and d2i functions such as d2i_DHparams() that take a low-level key type
1026have been deprecated. Applications should instead use the L<OSSL_DECODER(3)> and
1027L<OSSL_ENCODER(3)> APIs to read and write files.
1028See L<d2i_RSAPrivateKey(3)/Migration> for further details.
1029
1030=head4 Deprecated low-level key object getters and setters
1031
1032Applications that set or get low-level key objects (such as EVP_PKEY_set1_DH()
1033or EVP_PKEY_get0()) should instead use the OSSL_ENCODER
1034(See L<OSSL_ENCODER_to_bio(3)>) or OSSL_DECODER (See L<OSSL_DECODER_from_bio(3)>)
1035APIs, or alternatively use L<EVP_PKEY_fromdata(3)> or L<EVP_PKEY_todata(3)>.
1036
1037=head4 Deprecated low-level key parameter getters
1038
1039Functions that access low-level objects directly such as L<RSA_get0_n(3)> are now
1040deprecated. Applications should use one of L<EVP_PKEY_get_bn_param(3)>,
1041L<EVP_PKEY_get_int_param(3)>, l<EVP_PKEY_get_size_t_param(3)>,
1042L<EVP_PKEY_get_utf8_string_param(3)>, L<EVP_PKEY_get_octet_string_param(3)> or
1043L<EVP_PKEY_get_params(3)> to access fields from an EVP_PKEY.
1044Gettable parameters are listed in L<EVP_PKEY-RSA(7)/Common RSA parameters>,
1045L<EVP_PKEY-DH(7)/DH parameters>, L<EVP_PKEY-DSA(7)/DSA parameters>,
1046L<EVP_PKEY-FFC(7)/FFC parameters>, L<EVP_PKEY-EC(7)/Common EC parameters> and
1047L<EVP_PKEY-X25519(7)/Common X25519, X448, ED25519 and ED448 parameters>.
1048Applications may also use L<EVP_PKEY_todata(3)> to return all fields.
1049
1050=head4 Deprecated low-level key parameter setters
1051
1052Functions that access low-level objects directly such as L<RSA_set0_crt_params(3)>
1053are now deprecated. Applications should use L<EVP_PKEY_fromdata(3)> to create
1054new keys from user provided key data. Keys should be immutable once they are
1055created, so if required the user may use L<EVP_PKEY_todata(3)>, L<OSSL_PARAM_merge(3)>,
1056and L<EVP_PKEY_fromdata(3)> to create a modified key.
1057See L<EVP_PKEY-DH(7)/Examples> for more information.
1058See L</Deprecated low-level key generation functions> for information on
1059generating a key using parameters.
1060
1061=head4 Deprecated low-level object creation
1062
1063Low-level objects were created using methods such as L<RSA_new(3)>,
1064L<RSA_up_ref(3)> and L<RSA_free(3)>. Applications should instead use the
1065high-level EVP_PKEY APIs, e.g. L<EVP_PKEY_new(3)>, L<EVP_PKEY_up_ref(3)> and
1066L<EVP_PKEY_free(3)>.
1067See also L<EVP_PKEY_CTX_new_from_name(3)> and L<EVP_PKEY_CTX_new_from_pkey(3)>.
1068
1069EVP_PKEYs may be created in a variety of ways:
1070See also L</Deprecated low-level key generation functions>,
1071L</Deprecated low-level key reading and writing functions> and
1072L</Deprecated low-level key parameter setters>.
1073
1074=head4 Deprecated low-level encryption functions
1075
1076Low-level encryption functions such as L<AES_encrypt(3)> and L<AES_decrypt(3)>
1077have been informally discouraged from use for a long time. Applications should
1078instead use the high level EVP APIs L<EVP_EncryptInit_ex(3)>,
1079L<EVP_EncryptUpdate(3)>, and L<EVP_EncryptFinal_ex(3)> or
1080L<EVP_DecryptInit_ex(3)>, L<EVP_DecryptUpdate(3)> and L<EVP_DecryptFinal_ex(3)>.
1081
1082=head4 Deprecated low-level digest functions
1083
1084Use of low-level digest functions such as L<SHA1_Init(3)> have been
1085informally discouraged from use for a long time.  Applications should instead
1086use the the high level EVP APIs L<EVP_DigestInit_ex(3)>, L<EVP_DigestUpdate(3)>
1087and L<EVP_DigestFinal_ex(3)>, or the quick one-shot L<EVP_Q_digest(3)>.
1088
1089Note that the functions L<SHA1(3)>, L<SHA224(3)>, L<SHA256(3)>, L<SHA384(3)>
1090and L<SHA512(3)> have changed to macros that use L<EVP_Q_digest(3)>.
1091
1092=head4 Deprecated low-level signing functions
1093
1094Use of low-level signing functions such as L<DSA_sign(3)> have been
1095informally discouraged for a long time. Instead applications should use
1096L<EVP_DigestSign(3)> and L<EVP_DigestVerify(3)>.
1097See also L<EVP_SIGNATURE-RSA(7)>, L<EVP_SIGNATURE-DSA(7)>,
1098L<EVP_SIGNATURE-ECDSA(7)> and L<EVP_SIGNATURE-ED25519(7)>.
1099
1100=head4 Deprecated low-level MAC functions
1101
1102Low-level mac functions such as L<CMAC_Init(3)> are deprecated.
1103Applications should instead use the new L<EVP_MAC(3)> interface, using
1104L<EVP_MAC_CTX_new(3)>, L<EVP_MAC_CTX_free(3)>, L<EVP_MAC_init(3)>,
1105L<EVP_MAC_update(3)> and L<EVP_MAC_final(3)> or the single-shot MAC function
1106L<EVP_Q_mac(3)>.
1107See L<EVP_MAC(3)>, L<EVP_MAC-HMAC(7)>, L<EVP_MAC-CMAC(7)>, L<EVP_MAC-GMAC(7)>,
1108L<EVP_MAC-KMAC(7)>, L<EVP_MAC-BLAKE2(7)>, L<EVP_MAC-Poly1305(7)> and
1109L<EVP_MAC-Siphash(7)> for additional information.
1110
1111Note that the one-shot method HMAC() is still available for compatibility purposes,
1112but this can also be replaced by using EVP_Q_MAC if a library context is required.
1113
1114=head4 Deprecated low-level validation functions
1115
1116Low-level validation functions such as L<DH_check(3)> have been informally
1117discouraged from use for a long time. Applications should instead use the high-level
1118EVP_PKEY APIs such as L<EVP_PKEY_check(3)>, L<EVP_PKEY_param_check(3)>,
1119L<EVP_PKEY_param_check_quick(3)>, L<EVP_PKEY_public_check(3)>,
1120L<EVP_PKEY_public_check_quick(3)>, L<EVP_PKEY_private_check(3)>,
1121and L<EVP_PKEY_pairwise_check(3)>.
1122
1123=head4 Deprecated low-level key exchange functions
1124
1125Many low-level functions have been informally discouraged from use for a long
1126time. Applications should instead use L<EVP_PKEY_derive(3)>.
1127See L<EVP_KEYEXCH-DH(7)>, L<EVP_KEYEXCH-ECDH(7)> and L<EVP_KEYEXCH-X25519(7)>.
1128
1129=head4 Deprecated low-level key generation functions
1130
1131Many low-level functions have been informally discouraged from use for a long
1132time. Applications should instead use L<EVP_PKEY_keygen_init(3)> and
1133L<EVP_PKEY_generate(3)> as described in L<EVP_PKEY-DSA(7)>, L<EVP_PKEY-DH(7)>,
1134L<EVP_PKEY-RSA(7)>, L<EVP_PKEY-EC(7)> and L<EVP_PKEY-X25519(7)>.
1135The 'quick' one-shot function L<EVP_PKEY_Q_keygen(3)> and macros for the most
1136common cases: <EVP_RSA_gen(3)> and L<EVP_EC_gen(3)> may also be used.
1137
1138=head4 Deprecated low-level key reading and writing functions
1139
1140Use of low-level objects (such as DSA) has been informally discouraged from use
1141for a long time. Functions to read and write these low-level objects (such as
1142PEM_read_DSA_PUBKEY()) should be replaced. Applications should instead use
1143L<OSSL_ENCODER_to_bio(3)> and L<OSSL_DECODER_from_bio(3)>.
1144
1145=head4 Deprecated low-level key printing functions
1146
1147Use of low-level objects (such as DSA) has been informally discouraged from use
1148for a long time. Functions to print these low-level objects such as
1149DSA_print() should be replaced with the equivalent EVP_PKEY functions.
1150Application should use one of L<EVP_PKEY_print_public(3)>,
1151L<EVP_PKEY_print_private(3)>, L<EVP_PKEY_print_params(3)>,
1152L<EVP_PKEY_print_public_fp(3)>, L<EVP_PKEY_print_private_fp(3)> or
1153L<EVP_PKEY_print_params_fp(3)>. Note that internally these use
1154L<OSSL_ENCODER_to_bio(3)> and L<OSSL_DECODER_from_bio(3)>.
1155
1156=head3 Deprecated function mappings
1157
1158The following functions have been deprecated in 3.0.
1159
1160=over 4
1161
1162=item *
1163
1164AES_bi_ige_encrypt() and AES_ige_encrypt()
1165
1166There is no replacement for the IGE functions. New code should not use these modes.
1167These undocumented functions were never integrated into the EVP layer.
1168They implemented the AES Infinite Garble Extension (IGE) mode and AES
1169Bi-directional IGE mode. These modes were never formally standardised and
1170usage of these functions is believed to be very small. In particular
1171AES_bi_ige_encrypt() has a known bug. It accepts 2 AES keys, but only one
1172is ever used. The security implications are believed to be minimal, but
1173this issue was never fixed for backwards compatibility reasons.
1174
1175=item *
1176
1177AES_encrypt(), AES_decrypt(), AES_set_encrypt_key(), AES_set_decrypt_key(),
1178AES_cbc_encrypt(), AES_cfb128_encrypt(), AES_cfb1_encrypt(), AES_cfb8_encrypt(),
1179AES_ecb_encrypt(), AES_ofb128_encrypt()
1180
1181=item *
1182
1183AES_unwrap_key(), AES_wrap_key()
1184
1185See L</Deprecated low-level encryption functions>
1186
1187=item *
1188
1189AES_options()
1190
1191There is no replacement. It returned a string indicating if the AES code was unrolled.
1192
1193=item *
1194
1195ASN1_digest(), ASN1_sign(), ASN1_verify()
1196
1197There are no replacements. These old functions are not used, and could be
1198disabled with the macro NO_ASN1_OLD since OpenSSL 0.9.7.
1199
1200=item *
1201
1202ASN1_STRING_length_set()
1203
1204Use L<ASN1_STRING_set(3)> or L<ASN1_STRING_set0(3)> instead.
1205This was a potentially unsafe function that could change the bounds of a
1206previously passed in pointer.
1207
1208=item *
1209
1210BF_encrypt(), BF_decrypt(), BF_set_key(), BF_cbc_encrypt(), BF_cfb64_encrypt(),
1211BF_ecb_encrypt(), BF_ofb64_encrypt()
1212
1213See L</Deprecated low-level encryption functions>.
1214The Blowfish algorithm has been moved to the L<Legacy Provider|/Legacy Algorithms>.
1215
1216=item *
1217
1218BF_options()
1219
1220There is no replacement. This option returned a constant string.
1221
1222=item *
1223
1224BIO_get_callback(), BIO_set_callback(), BIO_debug_callback()
1225
1226Use the respective non-deprecated _ex() functions.
1227
1228=item *
1229
1230BN_is_prime_ex(), BN_is_prime_fasttest_ex()
1231
1232Use L<BN_check_prime(3)> which avoids possible misuse and always uses at least
123364 rounds of the Miller-Rabin primality test.
1234
1235=item *
1236
1237BN_pseudo_rand(), BN_pseudo_rand_range()
1238
1239Use L<BN_rand(3)> and L<BN_rand_range(3)>.
1240
1241=item *
1242
1243BN_X931_derive_prime_ex(), BN_X931_generate_prime_ex(), BN_X931_generate_Xpq()
1244
1245There are no replacements for these low-level functions. They were used internally
1246by RSA_X931_derive_ex() and RSA_X931_generate_key_ex() which are also deprecated.
1247Use L<EVP_PKEY_keygen(3)> instead.
1248
1249=item *
1250
1251Camellia_encrypt(), Camellia_decrypt(), Camellia_set_key(),
1252Camellia_cbc_encrypt(), Camellia_cfb128_encrypt(), Camellia_cfb1_encrypt(),
1253Camellia_cfb8_encrypt(), Camellia_ctr128_encrypt(), Camellia_ecb_encrypt(),
1254Camellia_ofb128_encrypt()
1255
1256See L</Deprecated low-level encryption functions>.
1257
1258=item *
1259
1260CAST_encrypt(), CAST_decrypt(), CAST_set_key(), CAST_cbc_encrypt(),
1261CAST_cfb64_encrypt(), CAST_ecb_encrypt(), CAST_ofb64_encrypt()
1262
1263See L</Deprecated low-level encryption functions>.
1264The CAST algorithm has been moved to the L<Legacy Provider|/Legacy Algorithms>.
1265
1266=item *
1267
1268CMAC_CTX_new(), CMAC_CTX_cleanup(), CMAC_CTX_copy(), CMAC_CTX_free(),
1269CMAC_CTX_get0_cipher_ctx()
1270
1271See L</Deprecated low-level MAC functions>.
1272
1273=item *
1274
1275CMAC_Init(), CMAC_Update(), CMAC_Final(), CMAC_resume()
1276
1277See L</Deprecated low-level MAC functions>.
1278
1279=item *
1280
1281CRYPTO_mem_ctrl(), CRYPTO_mem_debug_free(), CRYPTO_mem_debug_malloc(),
1282CRYPTO_mem_debug_pop(), CRYPTO_mem_debug_push(), CRYPTO_mem_debug_realloc(),
1283CRYPTO_mem_leaks(), CRYPTO_mem_leaks_cb(), CRYPTO_mem_leaks_fp(),
1284CRYPTO_set_mem_debug()
1285
1286Memory-leak checking has been deprecated in favor of more modern development
1287tools, such as compiler memory and leak sanitizers or Valgrind.
1288
1289=item *
1290
1291CRYPTO_cts128_encrypt_block(), CRYPTO_cts128_encrypt(),
1292CRYPTO_cts128_decrypt_block(), CRYPTO_cts128_decrypt(),
1293CRYPTO_nistcts128_encrypt_block(), CRYPTO_nistcts128_encrypt(),
1294CRYPTO_nistcts128_decrypt_block(), CRYPTO_nistcts128_decrypt()
1295
1296Use the higher level functions EVP_CipherInit_ex2(), EVP_CipherUpdate() and
1297EVP_CipherFinal_ex() instead.
1298See the "cts_mode" parameter in
1299L<EVP_EncryptInit(3)/Gettable and Settable EVP_CIPHER_CTX parameters>.
1300See L<EVP_EncryptInit(3)/EXAMPLES> for a AES-256-CBC-CTS example.
1301
1302=item *
1303
1304d2i_DHparams(), d2i_DHxparams(), d2i_DSAparams(), d2i_DSAPrivateKey(),
1305d2i_DSAPrivateKey_bio(), d2i_DSAPrivateKey_fp(), d2i_DSA_PUBKEY(),
1306d2i_DSA_PUBKEY_bio(), d2i_DSA_PUBKEY_fp(), d2i_DSAPublicKey(),
1307d2i_ECParameters(), d2i_ECPrivateKey(), d2i_ECPrivateKey_bio(),
1308d2i_ECPrivateKey_fp(), d2i_EC_PUBKEY(), d2i_EC_PUBKEY_bio(),
1309d2i_EC_PUBKEY_fp(), d2i_RSAPrivateKey(),
1310d2i_RSAPrivateKey_bio(), d2i_RSAPrivateKey_fp(), d2i_RSA_PUBKEY(),
1311d2i_RSA_PUBKEY_bio(), d2i_RSA_PUBKEY_fp(), d2i_RSAPublicKey(),
1312d2i_RSAPublicKey_bio(), d2i_RSAPublicKey_fp()
1313
1314See L</Deprecated i2d and d2i functions for low-level key types>
1315
1316=item *
1317
1318o2i_ECPublicKey()
1319
1320Use L<EVP_PKEY_set1_encoded_public_key(3)>.
1321See L</Deprecated low-level key parameter setters>
1322
1323=item *
1324
1325DES_crypt(), DES_fcrypt(), DES_encrypt1(), DES_encrypt2(), DES_encrypt3(),
1326DES_decrypt3(), DES_ede3_cbc_encrypt(), DES_ede3_cfb64_encrypt(),
1327DES_ede3_cfb_encrypt(),DES_ede3_ofb64_encrypt(),
1328DES_ecb_encrypt(), DES_ecb3_encrypt(), DES_ofb64_encrypt(), DES_ofb_encrypt(),
1329DES_cfb64_encrypt DES_cfb_encrypt(), DES_cbc_encrypt(), DES_ncbc_encrypt(),
1330DES_pcbc_encrypt(), DES_xcbc_encrypt(), DES_cbc_cksum(), DES_quad_cksum(),
1331DES_check_key_parity(), DES_is_weak_key(), DES_key_sched(), DES_options(),
1332DES_random_key(), DES_set_key(), DES_set_key_checked(), DES_set_key_unchecked(),
1333DES_set_odd_parity(), DES_string_to_2keys(), DES_string_to_key()
1334
1335See L</Deprecated low-level encryption functions>.
1336Algorithms for "DESX-CBC", "DES-ECB", "DES-CBC", "DES-OFB", "DES-CFB",
1337"DES-CFB1" and "DES-CFB8" have been moved to the L<Legacy Provider|/Legacy Algorithms>.
1338
1339=item *
1340
1341DH_bits(), DH_security_bits(), DH_size()
1342
1343Use L<EVP_PKEY_get_bits(3)>, L<EVP_PKEY_get_security_bits(3)> and
1344L<EVP_PKEY_get_size(3)>.
1345
1346=item *
1347
1348DH_check(), DH_check_ex(), DH_check_params(), DH_check_params_ex(),
1349DH_check_pub_key(), DH_check_pub_key_ex()
1350
1351See L</Deprecated low-level validation functions>
1352
1353=item *
1354
1355DH_clear_flags(), DH_test_flags(), DH_set_flags()
1356
1357The B<DH_FLAG_CACHE_MONT_P> flag has been deprecated without replacement.
1358The B<DH_FLAG_TYPE_DH> and B<DH_FLAG_TYPE_DHX> have been deprecated.
1359Use EVP_PKEY_is_a() to determine the type of a key.
1360There is no replacement for setting these flags.
1361
1362=item *
1363
1364DH_compute_key() DH_compute_key_padded()
1365
1366See L</Deprecated low-level key exchange functions>.
1367
1368=item *
1369
1370DH_new(), DH_new_by_nid(), DH_free(), DH_up_ref()
1371
1372See L</Deprecated low-level object creation>
1373
1374=item *
1375
1376DH_generate_key(), DH_generate_parameters_ex()
1377
1378See L</Deprecated low-level key generation functions>.
1379
1380=item *
1381
1382DH_get0_pqg(), DH_get0_p(), DH_get0_q(), DH_get0_g(), DH_get0_key(),
1383DH_get0_priv_key(), DH_get0_pub_key(), DH_get_length(), DH_get_nid()
1384
1385See L</Deprecated low-level key parameter getters>
1386
1387=item *
1388
1389DH_get_1024_160(), DH_get_2048_224(), DH_get_2048_256()
1390
1391Applications should instead set the B<OSSL_PKEY_PARAM_GROUP_NAME> as specified in
1392L<EVP_PKEY-DH(7)/DH parameters>) to one of "dh_1024_160", "dh_2048_224" or
1393"dh_2048_256" when generating a DH key.
1394
1395=item *
1396
1397DH_KDF_X9_42()
1398
1399Applications should use L<EVP_PKEY_CTX_set_dh_kdf_type(3)> instead.
1400
1401=item *
1402
1403DH_get_default_method(), DH_get0_engine(), DH_meth_*(), DH_new_method(),
1404DH_OpenSSL(), DH_get_ex_data(), DH_set_default_method(), DH_set_method(),
1405DH_set_ex_data()
1406
1407See L</Providers are a replacement for engines and low-level method overrides>
1408
1409=item *
1410
1411DHparams_print(), DHparams_print_fp()
1412
1413See L</Deprecated low-level key printing functions>
1414
1415=item *
1416
1417DH_set0_key(), DH_set0_pqg(), DH_set_length()
1418
1419See L</Deprecated low-level key parameter setters>
1420
1421=item *
1422
1423DSA_bits(), DSA_security_bits(), DSA_size()
1424
1425Use L<EVP_PKEY_get_bits(3)>, L<EVP_PKEY_get_security_bits(3)> and
1426L<EVP_PKEY_get_size(3)>.
1427
1428=item *
1429
1430DHparams_dup(), DSA_dup_DH()
1431
1432There is no direct replacement. Applications may use L<EVP_PKEY_copy_parameters(3)>
1433and L<EVP_PKEY_dup(3)> instead.
1434
1435=item *
1436
1437DSA_generate_key(), DSA_generate_parameters_ex()
1438
1439See L</Deprecated low-level key generation functions>.
1440
1441=item *
1442
1443DSA_get0_engine(), DSA_get_default_method(), DSA_get_ex_data(),
1444DSA_get_method(), DSA_meth_*(), DSA_new_method(), DSA_OpenSSL(),
1445DSA_set_default_method(), DSA_set_ex_data(), DSA_set_method()
1446
1447See L</Providers are a replacement for engines and low-level method overrides>.
1448
1449=item *
1450
1451DSA_get0_p(), DSA_get0_q(), DSA_get0_g(), DSA_get0_pqg(), DSA_get0_key(),
1452DSA_get0_priv_key(), DSA_get0_pub_key()
1453
1454See L</Deprecated low-level key parameter getters>.
1455
1456=item *
1457
1458DSA_new(), DSA_free(), DSA_up_ref()
1459
1460See L</Deprecated low-level object creation>
1461
1462=item *
1463
1464DSAparams_dup()
1465
1466There is no direct replacement. Applications may use L<EVP_PKEY_copy_parameters(3)>
1467and L<EVP_PKEY_dup(3)> instead.
1468
1469=item *
1470
1471DSAparams_print(), DSAparams_print_fp(), DSA_print(), DSA_print_fp()
1472
1473See L</Deprecated low-level key printing functions>
1474
1475=item *
1476
1477DSA_set0_key(), DSA_set0_pqg()
1478
1479See L</Deprecated low-level key parameter setters>
1480
1481=item *
1482
1483DSA_set_flags(), DSA_clear_flags(), DSA_test_flags()
1484
1485The B<DSA_FLAG_CACHE_MONT_P> flag has been deprecated without replacement.
1486
1487=item *
1488
1489DSA_sign(), DSA_do_sign(), DSA_sign_setup(), DSA_verify(), DSA_do_verify()
1490
1491See L</Deprecated low-level signing functions>.
1492
1493=item *
1494
1495ECDH_compute_key()
1496
1497See L</Deprecated low-level key exchange functions>.
1498
1499=item *
1500
1501ECDH_KDF_X9_62()
1502
1503Applications may either set this using the helper function
1504L<EVP_PKEY_CTX_set_ecdh_kdf_type(3)> or by setting an L<OSSL_PARAM(3)> using the
1505"kdf-type" as shown in L<EVP_KEYEXCH-ECDH(7)/EXAMPLES>
1506
1507=item *
1508
1509ECDSA_sign(), ECDSA_sign_ex(), ECDSA_sign_setup(), ECDSA_do_sign(),
1510ECDSA_do_sign_ex(), ECDSA_verify(), ECDSA_do_verify()
1511
1512See L</Deprecated low-level signing functions>.
1513
1514=item *
1515
1516ECDSA_size()
1517
1518Applications should use L<EVP_PKEY_get_size(3)>.
1519
1520=item *
1521
1522EC_GF2m_simple_method(), EC_GFp_mont_method(), EC_GFp_nist_method(),
1523EC_GFp_nistp224_method(), EC_GFp_nistp256_method(), EC_GFp_nistp521_method(),
1524EC_GFp_simple_method()
1525
1526There are no replacements for these functions. Applications should rely on the
1527library automatically assigning a suitable method internally when an EC_GROUP
1528is constructed.
1529
1530=item *
1531
1532EC_GROUP_clear_free()
1533
1534Use L<EC_GROUP_free(3)> instead.
1535
1536=item *
1537
1538EC_GROUP_get_curve_GF2m(), EC_GROUP_get_curve_GFp(), EC_GROUP_set_curve_GF2m(),
1539EC_GROUP_set_curve_GFp()
1540
1541Applications should use L<EC_GROUP_get_curve(3)> and L<EC_GROUP_set_curve(3)>.
1542
1543=item *
1544
1545EC_GROUP_have_precompute_mult(), EC_GROUP_precompute_mult(),
1546EC_KEY_precompute_mult()
1547
1548These functions are not widely used. Applications should instead switch to
1549named curves which OpenSSL has hardcoded lookup tables for.
1550
1551=item *
1552
1553EC_GROUP_new(), EC_GROUP_method_of(), EC_POINT_method_of()
1554
1555EC_METHOD is now an internal-only concept and a suitable EC_METHOD is assigned
1556internally without application intervention.
1557Users of EC_GROUP_new() should switch to a different suitable constructor.
1558
1559=item *
1560
1561EC_KEY_can_sign()
1562
1563Applications should use L<EVP_PKEY_can_sign(3)> instead.
1564
1565=item *
1566
1567EC_KEY_check_key()
1568
1569See L</Deprecated low-level validation functions>
1570
1571=item *
1572
1573EC_KEY_set_flags(), EC_KEY_get_flags(), EC_KEY_clear_flags()
1574
1575See L<EVP_PKEY-EC(7)/Common EC parameters> which handles flags as separate
1576parameters for B<OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT>,
1577B<OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE>, B<OSSL_PKEY_PARAM_EC_ENCODING>,
1578B<OSSL_PKEY_PARAM_USE_COFACTOR_ECDH> and
1579B<OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC>.
1580See also L<EVP_PKEY-EC(7)/EXAMPLES>
1581
1582=item *
1583
1584EC_KEY_dup(), EC_KEY_copy()
1585
1586There is no direct replacement. Applications may use L<EVP_PKEY_copy_parameters(3)>
1587and L<EVP_PKEY_dup(3)> instead.
1588
1589=item *
1590
1591EC_KEY_decoded_from_explicit_params()
1592
1593There is no replacement.
1594
1595=item *
1596
1597EC_KEY_generate_key()
1598
1599See L</Deprecated low-level key generation functions>.
1600
1601=item *
1602
1603EC_KEY_get0_group(), EC_KEY_get0_private_key(), EC_KEY_get0_public_key(),
1604EC_KEY_get_conv_form(), EC_KEY_get_enc_flags()
1605
1606See L</Deprecated low-level key parameter getters>.
1607
1608=item *
1609
1610EC_KEY_get0_engine(), EC_KEY_get_default_method(), EC_KEY_get_method(),
1611EC_KEY_new_method(), EC_KEY_get_ex_data(), EC_KEY_OpenSSL(),
1612EC_KEY_set_ex_data(), EC_KEY_set_default_method(), EC_KEY_METHOD_*(),
1613EC_KEY_set_method()
1614
1615See L</Providers are a replacement for engines and low-level method overrides>
1616
1617=item *
1618
1619EC_METHOD_get_field_type()
1620
1621Use L<EC_GROUP_get_field_type(3)> instead.
1622See L</Providers are a replacement for engines and low-level method overrides>
1623
1624=item *
1625
1626EC_KEY_key2buf(), EC_KEY_oct2key(), EC_KEY_oct2priv(), EC_KEY_priv2buf(),
1627EC_KEY_priv2oct()
1628
1629There are no replacements for these.
1630
1631=item *
1632
1633EC_KEY_new(), EC_KEY_new_by_curve_name(), EC_KEY_free(), EC_KEY_up_ref()
1634
1635See L</Deprecated low-level object creation>
1636
1637=item *
1638
1639EC_KEY_print(), EC_KEY_print_fp()
1640
1641See L</Deprecated low-level key printing functions>
1642
1643=item *
1644
1645EC_KEY_set_asn1_flag(), EC_KEY_set_conv_form(), EC_KEY_set_enc_flags()
1646
1647See L</Deprecated low-level key parameter setters>.
1648
1649=item *
1650
1651EC_KEY_set_group(), EC_KEY_set_private_key(), EC_KEY_set_public_key(),
1652EC_KEY_set_public_key_affine_coordinates()
1653
1654See L</Deprecated low-level key parameter setters>.
1655
1656=item *
1657
1658ECParameters_print(), ECParameters_print_fp(), ECPKParameters_print(),
1659ECPKParameters_print_fp()
1660
1661See L</Deprecated low-level key printing functions>
1662
1663=item *
1664
1665EC_POINT_bn2point(), EC_POINT_point2bn()
1666
1667These functions were not particularly useful, since EC point serialization
1668formats are not individual big-endian integers.
1669
1670=item *
1671
1672EC_POINT_get_affine_coordinates_GF2m(), EC_POINT_get_affine_coordinates_GFp(),
1673EC_POINT_set_affine_coordinates_GF2m(), EC_POINT_set_affine_coordinates_GFp()
1674
1675Applications should use L<EC_POINT_get_affine_coordinates(3)> and
1676L<EC_POINT_set_affine_coordinates(3)> instead.
1677
1678=item *
1679
1680EC_POINT_get_Jprojective_coordinates_GFp(), EC_POINT_set_Jprojective_coordinates_GFp()
1681
1682These functions are not widely used. Applications should instead use the
1683L<EC_POINT_set_affine_coordinates(3)> and L<EC_POINT_get_affine_coordinates(3)>
1684functions.
1685
1686=item *
1687
1688EC_POINT_make_affine(), EC_POINTs_make_affine()
1689
1690There is no replacement. These functions were not widely used, and OpenSSL
1691automatically performs this conversion when needed.
1692
1693=item *
1694
1695EC_POINT_set_compressed_coordinates_GF2m(), EC_POINT_set_compressed_coordinates_GFp()
1696
1697Applications should use L<EC_POINT_set_compressed_coordinates(3)> instead.
1698
1699=item *
1700
1701EC_POINTs_mul()
1702
1703This function is not widely used. Applications should instead use the
1704L<EC_POINT_mul(3)> function.
1705
1706=item *
1707
1708B<ENGINE_*()>
1709
1710All engine functions are deprecated. An engine should be rewritten as a provider.
1711See L</Providers are a replacement for engines and low-level method overrides>.
1712
1713=item *
1714
1715B<ERR_load_*()>, ERR_func_error_string(), ERR_get_error_line(),
1716ERR_get_error_line_data(), ERR_get_state()
1717
1718OpenSSL now loads error strings automatically so these functions are not needed.
1719
1720=item *
1721
1722ERR_peek_error_line_data(), ERR_peek_last_error_line_data()
1723
1724The new functions are L<ERR_peek_error_func(3)>, L<ERR_peek_last_error_func(3)>,
1725L<ERR_peek_error_data(3)>, L<ERR_peek_last_error_data(3)>, L<ERR_get_error_all(3)>,
1726L<ERR_peek_error_all(3)> and L<ERR_peek_last_error_all(3)>.
1727Applications should use L<ERR_get_error_all(3)>, or pick information
1728with ERR_peek functions and finish off with getting the error code by using
1729L<ERR_get_error(3)>.
1730
1731=item *
1732
1733EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_iv_noconst(), EVP_CIPHER_CTX_original_iv()
1734
1735Applications should instead use L<EVP_CIPHER_CTX_get_updated_iv(3)>,
1736L<EVP_CIPHER_CTX_get_updated_iv(3)> and L<EVP_CIPHER_CTX_get_original_iv(3)>
1737respectively.
1738See L<EVP_CIPHER_CTX_get_original_iv(3)> for further information.
1739
1740=item *
1741
1742B<EVP_CIPHER_meth_*()>, EVP_MD_CTX_set_update_fn(), EVP_MD_CTX_update_fn(),
1743B<EVP_MD_meth_*()>
1744
1745See L</Providers are a replacement for engines and low-level method overrides>.
1746
1747=item *
1748
1749EVP_PKEY_CTRL_PKCS7_ENCRYPT(), EVP_PKEY_CTRL_PKCS7_DECRYPT(),
1750EVP_PKEY_CTRL_PKCS7_SIGN(), EVP_PKEY_CTRL_CMS_ENCRYPT(),
1751EVP_PKEY_CTRL_CMS_DECRYPT(), and EVP_PKEY_CTRL_CMS_SIGN()
1752
1753These control operations are not invoked by the OpenSSL library anymore and
1754are replaced by direct checks of the key operation against the key type
1755when the operation is initialized.
1756
1757=item *
1758
1759EVP_PKEY_CTX_get0_dh_kdf_ukm(), EVP_PKEY_CTX_get0_ecdh_kdf_ukm()
1760
1761See the "kdf-ukm" item in L<EVP_KEYEXCH-DH(7)/DH key exchange parameters> and
1762L<EVP_KEYEXCH-ECDH(7)/ECDH Key Exchange parameters>.
1763These functions are obsolete and should not be required.
1764
1765=item *
1766
1767EVP_PKEY_CTX_set_rsa_keygen_pubexp()
1768
1769Applications should use L<EVP_PKEY_CTX_set1_rsa_keygen_pubexp(3)> instead.
1770
1771=item *
1772
1773EVP_PKEY_cmp(), EVP_PKEY_cmp_parameters()
1774
1775Applications should use L<EVP_PKEY_eq(3)> and L<EVP_PKEY_parameters_eq(3)> instead.
1776See L<EVP_PKEY_copy_parameters(3)> for further details.
1777
1778=item *
1779
1780EVP_PKEY_encrypt_old(), EVP_PKEY_decrypt_old(),
1781
1782Applications should use L<EVP_PKEY_encrypt_init(3)> and L<EVP_PKEY_encrypt(3)> or
1783L<EVP_PKEY_decrypt_init(3)> and L<EVP_PKEY_decrypt(3)> instead.
1784
1785=item *
1786
1787EVP_PKEY_get0()
1788
1789This function returns NULL if the key comes from a provider.
1790
1791=item *
1792
1793EVP_PKEY_get0_DH(), EVP_PKEY_get0_DSA(), EVP_PKEY_get0_EC_KEY(), EVP_PKEY_get0_RSA(),
1794EVP_PKEY_get1_DH(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_EC_KEY and EVP_PKEY_get1_RSA(),
1795EVP_PKEY_get0_hmac(), EVP_PKEY_get0_poly1305(), EVP_PKEY_get0_siphash()
1796
1797See L</Functions that return an internal key should be treated as read only>.
1798
1799=item *
1800
1801B<EVP_PKEY_meth_*()>
1802
1803See L</Providers are a replacement for engines and low-level method overrides>.
1804
1805=item *
1806
1807EVP_PKEY_new_CMAC_key()
1808
1809See L</Deprecated low-level MAC functions>.
1810
1811=item *
1812
1813EVP_PKEY_assign(), EVP_PKEY_set1_DH(), EVP_PKEY_set1_DSA(),
1814EVP_PKEY_set1_EC_KEY(), EVP_PKEY_set1_RSA()
1815
1816See L</Deprecated low-level key object getters and setters>
1817
1818=item *
1819
1820EVP_PKEY_set1_tls_encodedpoint() EVP_PKEY_get1_tls_encodedpoint()
1821
1822These functions were previously used by libssl to set or get an encoded public
1823key into/from an EVP_PKEY object. With OpenSSL 3.0 these are replaced by the more
1824generic functions L<EVP_PKEY_set1_encoded_public_key(3)> and
1825L<EVP_PKEY_get1_encoded_public_key(3)>.
1826The old versions have been converted to deprecated macros that just call the
1827new functions.
1828
1829=item *
1830
1831EVP_PKEY_set1_engine(), EVP_PKEY_get0_engine()
1832
1833See L</Providers are a replacement for engines and low-level method overrides>.
1834
1835=item *
1836
1837EVP_PKEY_set_alias_type()
1838
1839This function has been removed. There is no replacement.
1840See L</EVP_PKEY_set_alias_type() method has been removed>
1841
1842=item *
1843
1844HMAC_Init_ex(), HMAC_Update(), HMAC_Final(), HMAC_size()
1845
1846See L</Deprecated low-level MAC functions>.
1847
1848=item *
1849
1850HMAC_CTX_new(), HMAC_CTX_free(), HMAC_CTX_copy(), HMAC_CTX_reset(),
1851HMAC_CTX_set_flags(), HMAC_CTX_get_md()
1852
1853See L</Deprecated low-level MAC functions>.
1854
1855=item *
1856
1857i2d_DHparams(), i2d_DHxparams()
1858
1859See L</Deprecated low-level key reading and writing functions>
1860and L<d2i_RSAPrivateKey(3)/Migration>
1861
1862=item *
1863
1864i2d_DSAparams(), i2d_DSAPrivateKey(), i2d_DSAPrivateKey_bio(),
1865i2d_DSAPrivateKey_fp(), i2d_DSA_PUBKEY(), i2d_DSA_PUBKEY_bio(),
1866i2d_DSA_PUBKEY_fp(), i2d_DSAPublicKey()
1867
1868See L</Deprecated low-level key reading and writing functions>
1869and L<d2i_RSAPrivateKey(3)/Migration>
1870
1871=item *
1872
1873i2d_ECParameters(), i2d_ECPrivateKey(), i2d_ECPrivateKey_bio(),
1874i2d_ECPrivateKey_fp(), i2d_EC_PUBKEY(), i2d_EC_PUBKEY_bio(),
1875i2d_EC_PUBKEY_fp()
1876
1877See L</Deprecated low-level key reading and writing functions>
1878and L<d2i_RSAPrivateKey(3)/Migration>
1879
1880=item *
1881
1882i2o_ECPublicKey()
1883
1884Use L<EVP_PKEY_get1_encoded_public_key(3)>.
1885See L</Deprecated low-level key parameter getters>
1886
1887=item *
1888
1889i2d_RSAPrivateKey(), i2d_RSAPrivateKey_bio(), i2d_RSAPrivateKey_fp(),
1890i2d_RSA_PUBKEY(), i2d_RSA_PUBKEY_bio(), i2d_RSA_PUBKEY_fp(),
1891i2d_RSAPublicKey(), i2d_RSAPublicKey_bio(), i2d_RSAPublicKey_fp()
1892
1893See L</Deprecated low-level key reading and writing functions>
1894and L<d2i_RSAPrivateKey(3)/Migration>
1895
1896=item *
1897
1898IDEA_encrypt(), IDEA_set_decrypt_key(), IDEA_set_encrypt_key(),
1899IDEA_cbc_encrypt(), IDEA_cfb64_encrypt(), IDEA_ecb_encrypt(),
1900IDEA_ofb64_encrypt()
1901
1902See L</Deprecated low-level encryption functions>.
1903IDEA has been moved to the L<Legacy Provider|/Legacy Algorithms>.
1904
1905=item *
1906
1907IDEA_options()
1908
1909There is no replacement. This function returned a constant string.
1910
1911=item *
1912
1913MD2(), MD2_Init(), MD2_Update(), MD2_Final()
1914
1915See L</Deprecated low-level encryption functions>.
1916MD2 has been moved to the L<Legacy Provider|/Legacy Algorithms>.
1917
1918=item *
1919
1920MD2_options()
1921
1922There is no replacement. This function returned a constant string.
1923
1924=item *
1925
1926MD4(), MD4_Init(), MD4_Update(), MD4_Final(), MD4_Transform()
1927
1928See L</Deprecated low-level encryption functions>.
1929MD4 has been moved to the L<Legacy Provider|/Legacy Algorithms>.
1930
1931=item *
1932
1933MDC2(), MDC2_Init(), MDC2_Update(), MDC2_Final()
1934
1935See L</Deprecated low-level encryption functions>.
1936MDC2 has been moved to the L<Legacy Provider|/Legacy Algorithms>.
1937
1938=item *
1939
1940MD5(), MD5_Init(), MD5_Update(), MD5_Final(), MD5_Transform()
1941
1942See L</Deprecated low-level encryption functions>.
1943
1944=item *
1945
1946NCONF_WIN32()
1947
1948This undocumented function has no replacement.
1949See L<config(5)/HISTORY> for more details.
1950
1951=item *
1952
1953OCSP_parse_url()
1954
1955Use L<OSSL_HTTP_parse_url(3)> instead.
1956
1957=item *
1958
1959B<OCSP_REQ_CTX> type and B<OCSP_REQ_CTX_*()> functions
1960
1961These methods were used to collect all necessary data to form a HTTP request,
1962and to perform the HTTP transfer with that request.  With OpenSSL 3.0, the
1963type is B<OSSL_HTTP_REQ_CTX>, and the deprecated functions are replaced
1964with B<OSSL_HTTP_REQ_CTX_*()>. See L<OSSL_HTTP_REQ_CTX(3)> for additional
1965details.
1966
1967=item *
1968
1969OPENSSL_fork_child(), OPENSSL_fork_parent(), OPENSSL_fork_prepare()
1970
1971There is no replacement for these functions. These pthread fork support methods
1972were unused by OpenSSL.
1973
1974=item *
1975
1976OSSL_STORE_ctrl(), OSSL_STORE_do_all_loaders(), OSSL_STORE_LOADER_get0_engine(),
1977OSSL_STORE_LOADER_get0_scheme(), OSSL_STORE_LOADER_new(),
1978OSSL_STORE_LOADER_set_attach(), OSSL_STORE_LOADER_set_close(),
1979OSSL_STORE_LOADER_set_ctrl(), OSSL_STORE_LOADER_set_eof(),
1980OSSL_STORE_LOADER_set_error(), OSSL_STORE_LOADER_set_expect(),
1981OSSL_STORE_LOADER_set_find(), OSSL_STORE_LOADER_set_load(),
1982OSSL_STORE_LOADER_set_open(), OSSL_STORE_LOADER_set_open_ex(),
1983OSSL_STORE_register_loader(), OSSL_STORE_unregister_loader(),
1984OSSL_STORE_vctrl()
1985
1986These functions helped applications and engines create loaders for
1987schemes they supported.  These are all deprecated and discouraged in favour of
1988provider implementations, see L<provider-storemgmt(7)>.
1989
1990=item *
1991
1992PEM_read_DHparams(), PEM_read_bio_DHparams(),
1993PEM_read_DSAparams(), PEM_read_bio_DSAparams(),
1994PEM_read_DSAPrivateKey(), PEM_read_DSA_PUBKEY(),
1995PEM_read_bio_DSAPrivateKey and PEM_read_bio_DSA_PUBKEY(),
1996PEM_read_ECPKParameters(), PEM_read_ECPrivateKey(), PEM_read_EC_PUBKEY(),
1997PEM_read_bio_ECPKParameters(), PEM_read_bio_ECPrivateKey(), PEM_read_bio_EC_PUBKEY(),
1998PEM_read_RSAPrivateKey(), PEM_read_RSA_PUBKEY(), PEM_read_RSAPublicKey(),
1999PEM_read_bio_RSAPrivateKey(), PEM_read_bio_RSA_PUBKEY(), PEM_read_bio_RSAPublicKey(),
2000PEM_write_bio_DHparams(), PEM_write_bio_DHxparams(), PEM_write_DHparams(), PEM_write_DHxparams(),
2001PEM_write_DSAparams(), PEM_write_DSAPrivateKey(), PEM_write_DSA_PUBKEY(),
2002PEM_write_bio_DSAparams(), PEM_write_bio_DSAPrivateKey(), PEM_write_bio_DSA_PUBKEY(),
2003PEM_write_ECPKParameters(), PEM_write_ECPrivateKey(), PEM_write_EC_PUBKEY(),
2004PEM_write_bio_ECPKParameters(), PEM_write_bio_ECPrivateKey(), PEM_write_bio_EC_PUBKEY(),
2005PEM_write_RSAPrivateKey(), PEM_write_RSA_PUBKEY(), PEM_write_RSAPublicKey(),
2006PEM_write_bio_RSAPrivateKey(), PEM_write_bio_RSA_PUBKEY(),
2007PEM_write_bio_RSAPublicKey(),
2008
2009See L</Deprecated low-level key reading and writing functions>
2010
2011=item *
2012
2013PKCS1_MGF1()
2014
2015See L</Deprecated low-level encryption functions>.
2016
2017=item *
2018
2019RAND_get_rand_method(), RAND_set_rand_method(), RAND_OpenSSL(),
2020RAND_set_rand_engine()
2021
2022Applications should instead use L<RAND_set_DRBG_type(3)>,
2023L<EVP_RAND(3)> and L<EVP_RAND(7)>.
2024See L<RAND_set_rand_method(3)> for more details.
2025
2026=item *
2027
2028RC2_encrypt(), RC2_decrypt(), RC2_set_key(), RC2_cbc_encrypt(), RC2_cfb64_encrypt(),
2029RC2_ecb_encrypt(), RC2_ofb64_encrypt(),
2030RC4(), RC4_set_key(), RC4_options(),
2031RC5_32_encrypt(), RC5_32_set_key(), RC5_32_decrypt(), RC5_32_cbc_encrypt(),
2032RC5_32_cfb64_encrypt(), RC5_32_ecb_encrypt(), RC5_32_ofb64_encrypt()
2033
2034See L</Deprecated low-level encryption functions>.
2035The Algorithms "RC2", "RC4" and "RC5" have been moved to the L<Legacy Provider|/Legacy Algorithms>.
2036
2037=item *
2038
2039RIPEMD160(), RIPEMD160_Init(), RIPEMD160_Update(), RIPEMD160_Final(),
2040RIPEMD160_Transform()
2041
2042See L</Deprecated low-level digest functions>.
2043The RIPE algorithm has been moved to the L<Legacy Provider|/Legacy Algorithms>.
2044
2045=item *
2046
2047RSA_bits(), RSA_security_bits(), RSA_size()
2048
2049Use L<EVP_PKEY_get_bits(3)>, L<EVP_PKEY_get_security_bits(3)> and
2050L<EVP_PKEY_get_size(3)>.
2051
2052=item *
2053
2054RSA_check_key(), RSA_check_key_ex()
2055
2056See L</Deprecated low-level validation functions>
2057
2058=item *
2059
2060RSA_clear_flags(), RSA_flags(), RSA_set_flags(), RSA_test_flags(),
2061RSA_setup_blinding(), RSA_blinding_off(), RSA_blinding_on()
2062
2063All of these RSA flags have been deprecated without replacement:
2064
2065B<RSA_FLAG_BLINDING>, B<RSA_FLAG_CACHE_PRIVATE>, B<RSA_FLAG_CACHE_PUBLIC>,
2066B<RSA_FLAG_EXT_PKEY>, B<RSA_FLAG_NO_BLINDING>, B<RSA_FLAG_THREAD_SAFE>
2067B<RSA_METHOD_FLAG_NO_CHECK>
2068
2069=item *
2070
2071RSA_generate_key_ex(), RSA_generate_multi_prime_key()
2072
2073See L</Deprecated low-level key generation functions>.
2074
2075=item *
2076
2077RSA_get0_engine()
2078
2079See L</Providers are a replacement for engines and low-level method overrides>
2080
2081=item *
2082
2083RSA_get0_crt_params(), RSA_get0_d(), RSA_get0_dmp1(), RSA_get0_dmq1(),
2084RSA_get0_e(), RSA_get0_factors(), RSA_get0_iqmp(), RSA_get0_key(),
2085RSA_get0_multi_prime_crt_params(), RSA_get0_multi_prime_factors(), RSA_get0_n(),
2086RSA_get0_p(), RSA_get0_pss_params(), RSA_get0_q(),
2087RSA_get_multi_prime_extra_count()
2088
2089See L</Deprecated low-level key parameter getters>
2090
2091=item *
2092
2093RSA_new(), RSA_free(), RSA_up_ref()
2094
2095See L</Deprecated low-level object creation>.
2096
2097=item *
2098
2099RSA_get_default_method(), RSA_get_ex_data and RSA_get_method()
2100
2101See L</Providers are a replacement for engines and low-level method overrides>.
2102
2103=item *
2104
2105RSA_get_version()
2106
2107There is no replacement.
2108
2109=item *
2110
2111B<RSA_meth_*()>, RSA_new_method(), RSA_null_method and RSA_PKCS1_OpenSSL()
2112
2113See L</Providers are a replacement for engines and low-level method overrides>.
2114
2115=item *
2116
2117B<RSA_padding_add_*()>, B<RSA_padding_check_*()>
2118
2119See L</Deprecated low-level signing functions> and
2120L</Deprecated low-level encryption functions>.
2121
2122=item *
2123
2124RSA_print(), RSA_print_fp()
2125
2126See L</Deprecated low-level key printing functions>
2127
2128=item *
2129
2130RSA_public_encrypt(), RSA_private_decrypt()
2131
2132See L</Deprecated low-level encryption functions>
2133
2134=item *
2135
2136RSA_private_encrypt(), RSA_public_decrypt()
2137
2138This is equivalent to doing sign and verify recover operations (with a padding
2139mode of none). See L</Deprecated low-level signing functions>.
2140
2141=item *
2142
2143RSAPrivateKey_dup(), RSAPublicKey_dup()
2144
2145There is no direct replacement. Applications may use L<EVP_PKEY_dup(3)>.
2146
2147=item *
2148
2149RSAPublicKey_it(), RSAPrivateKey_it()
2150
2151See L</Deprecated low-level key reading and writing functions>
2152
2153=item *
2154
2155RSA_set0_crt_params(), RSA_set0_factors(), RSA_set0_key(),
2156RSA_set0_multi_prime_params()
2157
2158See L</Deprecated low-level key parameter setters>.
2159
2160=item *
2161
2162RSA_set_default_method(), RSA_set_method(), RSA_set_ex_data()
2163
2164See L</Providers are a replacement for engines and low-level method overrides>
2165
2166=item *
2167
2168RSA_sign(), RSA_sign_ASN1_OCTET_STRING(), RSA_verify(),
2169RSA_verify_ASN1_OCTET_STRING(), RSA_verify_PKCS1_PSS(),
2170RSA_verify_PKCS1_PSS_mgf1()
2171
2172See L</Deprecated low-level signing functions>.
2173
2174=item *
2175
2176RSA_X931_derive_ex(), RSA_X931_generate_key_ex(), RSA_X931_hash_id()
2177
2178There are no replacements for these functions.
2179X931 padding can be set using L<EVP_SIGNATURE-RSA(7)/Signature Parameters>.
2180See B<OSSL_SIGNATURE_PARAM_PAD_MODE>.
2181
2182=item *
2183
2184SEED_encrypt(), SEED_decrypt(), SEED_set_key(), SEED_cbc_encrypt(),
2185SEED_cfb128_encrypt(), SEED_ecb_encrypt(), SEED_ofb128_encrypt()
2186
2187See L</Deprecated low-level encryption functions>.
2188The SEED algorithm has been moved to the L<Legacy Provider|/Legacy Algorithms>.
2189
2190=item *
2191
2192SHA1_Init(), SHA1_Update(), SHA1_Final(), SHA1_Transform(),
2193SHA224_Init(), SHA224_Update(), SHA224_Final(),
2194SHA256_Init(), SHA256_Update(), SHA256_Final(), SHA256_Transform(),
2195SHA384_Init(), SHA384_Update(), SHA384_Final(),
2196SHA512_Init(), SHA512_Update(), SHA512_Final(), SHA512_Transform()
2197
2198See L</Deprecated low-level digest functions>.
2199
2200=item *
2201
2202SRP_Calc_A(), SRP_Calc_B(), SRP_Calc_client_key(), SRP_Calc_server_key(),
2203SRP_Calc_u(), SRP_Calc_x(), SRP_check_known_gN_param(), SRP_create_verifier(),
2204SRP_create_verifier_BN(), SRP_get_default_gN(), SRP_user_pwd_free(), SRP_user_pwd_new(),
2205SRP_user_pwd_set0_sv(), SRP_user_pwd_set1_ids(), SRP_user_pwd_set_gN(),
2206SRP_VBASE_add0_user(), SRP_VBASE_free(), SRP_VBASE_get1_by_user(), SRP_VBASE_init(),
2207SRP_VBASE_new(), SRP_Verify_A_mod_N(), SRP_Verify_B_mod_N()
2208
2209There are no replacements for the SRP functions.
2210
2211=item *
2212
2213SSL_CTX_set_tmp_dh_callback(), SSL_set_tmp_dh_callback(),
2214SSL_CTX_set_tmp_dh(), SSL_set_tmp_dh()
2215
2216These are used to set the Diffie-Hellman (DH) parameters that are to be used by
2217servers requiring ephemeral DH keys. Instead applications should consider using
2218the built-in DH parameters that are available by calling L<SSL_CTX_set_dh_auto(3)>
2219or L<SSL_set_dh_auto(3)>. If custom parameters are necessary then applications can
2220use the alternative functions L<SSL_CTX_set0_tmp_dh_pkey(3)> and
2221L<SSL_set0_tmp_dh_pkey(3)>. There is no direct replacement for the "callback"
2222functions. The callback was originally useful in order to have different
2223parameters for export and non-export ciphersuites. Export ciphersuites are no
2224longer supported by OpenSSL. Use of the callback functions should be replaced
2225by one of the other methods described above.
2226
2227=item *
2228
2229SSL_CTX_set_tlsext_ticket_key_cb()
2230
2231Use the new L<SSL_CTX_set_tlsext_ticket_key_evp_cb(3)> function instead.
2232
2233=item *
2234
2235WHIRLPOOL(), WHIRLPOOL_Init(), WHIRLPOOL_Update(), WHIRLPOOL_Final(),
2236WHIRLPOOL_BitUpdate()
2237
2238See L</Deprecated low-level digest functions>.
2239The Whirlpool algorithm has been moved to the L<Legacy Provider|/Legacy Algorithms>.
2240
2241=item *
2242
2243X509_certificate_type()
2244
2245This was an undocumented function. Applications can use L<X509_get0_pubkey(3)>
2246and L<X509_get0_signature(3)> instead.
2247
2248=item *
2249
2250X509_http_nbio(), X509_CRL_http_nbio()
2251
2252Use L<X509_load_http(3)> and L<X509_CRL_load_http(3)> instead.
2253
2254=back
2255
2256=head3 NID handling for provided keys and algorithms
2257
2258The following functions for NID (numeric id) handling have changed semantics.
2259
2260=over 4
2261
2262=item *
2263
2264EVP_PKEY_id(), EVP_PKEY_get_id()
2265
2266This function was previously used to reliably return the NID of
2267an EVP_PKEY object, e.g., to look up the name of the algorithm of
2268such EVP_PKEY by calling L<OBJ_nid2sn(3)>. With the introduction
2269of L<provider(7)>s EVP_PKEY_id() or its new equivalent
2270L<EVP_PKEY_get_id(3)> might now also return the value -1
2271(B<EVP_PKEY_KEYMGMT>) indicating the use of a provider to
2272implement the EVP_PKEY object. Therefore, the use of
2273L<EVP_PKEY_get0_type_name(3)> is recommended for retrieving
2274the name of the EVP_PKEY algorithm.
2275
2276=back
2277
2278=head2 Using the FIPS Module in applications
2279
2280See L<fips_module(7)> and L<OSSL_PROVIDER-FIPS(7)> for details.
2281
2282=head2 OpenSSL command line application changes
2283
2284=head3 New applications
2285
2286L<B<openssl kdf>|openssl-kdf(1)> uses the new L<EVP_KDF(3)> API.
2287L<B<openssl kdf>|openssl-mac(1)> uses the new L<EVP_MAC(3)> API.
2288
2289=head3 Added options
2290
2291B<-provider_path> and B<-provider> are available to all apps and can be used
2292multiple times to load any providers, such as the 'legacy' provider or third
2293party providers. If used then the 'default' provider would also need to be
2294specified if required. The B<-provider_path> must be specified before the
2295B<-provider> option.
2296
2297The B<list> app has many new options. See L<openssl-list(1)> for more
2298information.
2299
2300B<-crl_lastupdate> and B<-crl_nextupdate> used by B<openssl ca> allows
2301explicit setting of fields in the generated CRL.
2302
2303=head3 Removed options
2304
2305Interactive mode is not longer available.
2306
2307The B<-crypt> option used by B<openssl passwd>.
2308The B<-c> option used by B<openssl x509>, B<openssl dhparam>,
2309B<openssl dsaparam>, and B<openssl ecparam>.
2310
2311=head3 Other Changes
2312
2313The output of Command line applications may have minor changes.
2314These are primarily changes in capitalisation and white space.  However, in some
2315cases, there are additional differences.
2316For example, the DH parameters output from B<openssl dhparam> now lists 'P',
2317'Q', 'G' and 'pcounter' instead of 'prime', 'generator', 'subgroup order' and
2318'counter' respectively.
2319
2320The B<openssl> commands that read keys, certificates, and CRLs now
2321automatically detect the PEM or DER format of the input files so it is not
2322necessary to explicitly specify the input format anymore. However if the
2323input format option is used the specified format will be required.
2324
2325B<openssl speed> no longer uses low-level API calls.
2326This implies some of the performance numbers might not be comparable with the
2327previous releases due to higher overhead. This applies particularly to
2328measuring performance on smaller data chunks.
2329
2330b<openssl dhparam>, B<openssl dsa>, B<openssl gendsa>, B<openssl dsaparam>,
2331B<openssl genrsa> and B<openssl rsa> have been modified to use PKEY APIs.
2332B<openssl genrsa> and B<openssl rsa> now write PKCS #8 keys by default.
2333
2334=head3 Default settings
2335
2336"SHA256" is now the default digest for TS query used by B<openssl ts>.
2337
2338=head3 Deprecated apps
2339
2340B<openssl rsautl> is deprecated, use B<openssl pkeyutl> instead.
2341B<openssl dhparam>, B<openssl dsa>, B<openssl gendsa>, B<openssl dsaparam>,
2342B<openssl genrsa>, B<openssl rsa>, B<openssl genrsa> and B<openssl rsa> are
2343now in maintenance mode and no new features will be added to them.
2344
2345=head2 TLS Changes
2346
2347=over 4
2348
2349=item *
2350
2351TLS 1.3 FFDHE key exchange support added
2352
2353This uses DH safe prime named groups.
2354
2355=item *
2356
2357Support for fully "pluggable" TLSv1.3 groups.
2358
2359This means that providers may supply their own group implementations (using
2360either the "key exchange" or the "key encapsulation" methods) which will
2361automatically be detected and used by libssl.
2362
2363=item *
2364
2365SSL and SSL_CTX options are now 64 bit instead of 32 bit.
2366
2367The signatures of the functions to get and set options on SSL and
2368SSL_CTX objects changed from "unsigned long" to "uint64_t" type.
2369
2370This may require source code changes. For example it is no longer possible
2371to use the B<SSL_OP_> macro values in preprocessor C<#if> conditions.
2372However it is still possible to test whether these macros are defined or not.
2373
2374See L<SSL_CTX_get_options(3)>, L<SSL_CTX_set_options(3)>,
2375L<SSL_get_options(3)> and L<SSL_set_options(3)>.
2376
2377=item *
2378
2379SSL_set1_host() and SSL_add1_host() Changes
2380
2381These functions now take IP literal addresses as well as actual hostnames.
2382
2383=item *
2384
2385Added SSL option SSL_OP_CLEANSE_PLAINTEXT
2386
2387If the option is set, openssl cleanses (zeroizes) plaintext bytes from
2388internal buffers after delivering them to the application. Note,
2389the application is still responsible for cleansing other copies
2390(e.g.: data received by L<SSL_read(3)>).
2391
2392=item *
2393
2394Client-initiated renegotiation is disabled by default.
2395
2396To allow it, use the B<-client_renegotiation> option,
2397the B<SSL_OP_ALLOW_CLIENT_RENEGOTIATION> flag, or the C<ClientRenegotiation>
2398config parameter as appropriate.
2399
2400=item *
2401
2402Secure renegotiation is now required by default for TLS connections
2403
2404Support for RFC 5746 secure renegotiation is now required by default for
2405SSL or TLS connections to succeed.  Applications that require the ability
2406to connect to legacy peers will need to explicitly set
2407SSL_OP_LEGACY_SERVER_CONNECT.  Accordingly, SSL_OP_LEGACY_SERVER_CONNECT
2408is no longer set as part of SSL_OP_ALL.
2409
2410=item *
2411
2412Combining the Configure options no-ec and no-dh no longer disables TLSv1.3
2413
2414Typically if OpenSSL has no EC or DH algorithms then it cannot support
2415connections with TLSv1.3. However OpenSSL now supports "pluggable" groups
2416through providers. Therefore third party providers may supply group
2417implementations even where there are no built-in ones. Attempting to create
2418TLS connections in such a build without also disabling TLSv1.3 at run time or
2419using third party provider groups may result in handshake failures. TLSv1.3
2420can be disabled at compile time using the "no-tls1_3" Configure option.
2421
2422=item *
2423
2424SSL_CTX_set_ciphersuites() and SSL_set_ciphersuites() changes.
2425
2426The methods now ignore unknown ciphers.
2427
2428=item *
2429
2430Security callback change.
2431
2432The security callback, which can be customised by application code, supports
2433the security operation SSL_SECOP_TMP_DH. This is defined to take an EVP_PKEY
2434in the "other" parameter. In most places this is what is passed. All these
2435places occur server side. However there was one client side call of this
2436security operation and it passed a DH object instead. This is incorrect
2437according to the definition of SSL_SECOP_TMP_DH, and is inconsistent with all
2438of the other locations. Therefore this client side call has been changed to
2439pass an EVP_PKEY instead.
2440
2441=item *
2442
2443New SSL option SSL_OP_IGNORE_UNEXPECTED_EOF
2444
2445The SSL option SSL_OP_IGNORE_UNEXPECTED_EOF is introduced. If that option
2446is set, an unexpected EOF is ignored, it pretends a close notify was received
2447instead and so the returned error becomes SSL_ERROR_ZERO_RETURN.
2448
2449=item *
2450
2451The security strength of SHA1 and MD5 based signatures in TLS has been reduced.
2452
2453This results in SSL 3, TLS 1.0, TLS 1.1 and DTLS 1.0 no longer
2454working at the default security level of 1 and instead requires security
2455level 0. The security level can be changed either using the cipher string
2456with C<@SECLEVEL>, or calling L<SSL_CTX_set_security_level(3)>. This also means
2457that where the signature algorithms extension is missing from a ClientHello
2458then the handshake will fail in TLS 1.2 at security level 1. This is because,
2459although this extension is optional, failing to provide one means that
2460OpenSSL will fallback to a default set of signature algorithms. This default
2461set requires the availability of SHA1.
2462
2463=item *
2464
2465X509 certificates signed using SHA1 are no longer allowed at security level 1 and above.
2466
2467In TLS/SSL the default security level is 1. It can be set either using the cipher
2468string with C<@SECLEVEL>, or calling L<SSL_CTX_set_security_level(3)>. If the
2469leaf certificate is signed with SHA-1, a call to L<SSL_CTX_use_certificate(3)>
2470will fail if the security level is not lowered first.
2471Outside TLS/SSL, the default security level is -1 (effectively 0). It can
2472be set using L<X509_VERIFY_PARAM_set_auth_level(3)> or using the B<-auth_level>
2473options of the commands.
2474
2475=back
2476
2477=head1 SEE ALSO
2478
2479L<fips_module(7)>
2480
2481=head1 HISTORY
2482
2483The migration guide was created for OpenSSL 3.0.
2484
2485=head1 COPYRIGHT
2486
2487Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
2488
2489Licensed under the Apache License 2.0 (the "License").  You may not use
2490this file except in compliance with the License.  You can obtain a copy
2491in the file LICENSE in the source distribution or at
2492L<https://www.openssl.org/source/license.html>.
2493
2494=cut
2495