ossl-guide-migration.pod 80 KB

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