ossl-guide-migration.pod 80 KB

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