blob: ca4f57ed35675de198b0fcd35f8459ab4595685a [file] [log] [blame] [view]
Manuel Pégourié-Gonnard89d4ab02021-04-23 11:54:27 +02001Migrating from Mbed TLS 2.x to Mbed TLS 3.0
2===========================================
3
4This guide details the steps required to migrate from Mbed TLS version 2.x to
5Mbed TLS version 3.0 or greater. Unlike normal releases, Mbed TLS 3.0 breaks
6compatibility with previous versions, so users (and alt implementors) might
7need to change their own code in order to make it work with Mbed TLS 3.0.
8
9Here's the list of breaking changes; each entry should help you answer these
10two questions: (1) am I affected? (2) if yes, what's my migration path?
11
12Some function parameters were made const
13----------------------------------------
14
15Various functions in the PK and ASN.1 modules had a `const` qualifier added to
16some of their parameters.
17
18This normally doesn't affect your code, unless you use pointers to reference
19those functions. In this case, you'll need to update the type of your pointers
20in order to match the new signature.
21
22Deprecated functions were removed from hashing modules
23------------------------------------------------------
24
25Modules: MD2, MD4, MD5, SHA1, SHA256, SHA512, MD.
26
27- The functions `mbedtls_xxx_starts()`, `mbedtls_xxx_update()`,
28 `mbedtls_xxx_finish()` and `mbedtls_xxx()` were removed. Please use the
29function with the same name with `_ret` appended and check the return value.
30- The function `mbedtls_md_init_ctx()` was removed; please use
31 `mbedtls_md_setup()` instead.
32- The functions `mbedtls_xxx_process()` were removed. You normally don't need
33 to call that from application code. However it you do (or it you want to
34provide your own version of that function), please use
35`mbedtls_internal_xxx_process()` instead, and check the return value.
36
37Deprecated error codes for hardware failures were removed
38---------------------------------------------------------
39
40- The macros `MBEDTLS_ERR_xxx_FEATURE_UNSUPPORTED` from various crypto modules
41 were removed; `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` is now used
42instead.
43- The macros `MBEDTLS_ERR_xxx_HW_ACCEL_FAILED` from various crypto modules
44 were removed; `MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED` is now used instead.
45
46Deprecated names for PSA constants and types were removed
47---------------------------------------------------------
48
49Some constants and types that were present in beta version of the PSA Crypto
50API were removed from in version 1.0 of specification. Please switch to the new
51names provided by the 1.0 specification instead.
52
53Internal / alt-focused headers were moved to a private location
54----------------------------------------------------------------
55
56This shouldn't affect users who took care not to include headers that
57were documented as internal, despite being in the public include directory.
58
59If you're providing alt implementations of ECP or RSA, you'll need to add our
60`library` directory to your include path when building your alt
61implementations, and note that `ecp_internal.h` and `rsa_internal.h` have been
62renamed to `ecp_alt.h` and `rsa_alt_helpers.h` respectively.
63
64If you're a library user and used to rely on having access to a structure or
65function that's now in a private header, please reach out on the mailing list
66and explain your need; we'll consider adding a new API in a future version.
67
68Remove the option to allow SHA-1 by default in certificates
69-----------------------------------------------------------
70
71This does not affect users who use the default `config.h`, as this option was
72already off by default.
73
74If you used to enable `MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES` in your
75`config.h`, first please take a moment to consider whether you really still
76want to accept certificates signed with SHA-1 as those are considered insecure
77and no CA has issued them for a while. If you really need to allow SHA-1 in
78certificates, please set up a custom profile as explained in the ChangeLog.
79
80Remove the certs module from the library
81----------------------------------------
82
83This should not affect production use of the library, as the certificates and
84keys included there were never suitable for production use.
85
86However it might affect you if you relied on them for testing purposes. In
87that case, please embed your own test certificates in your test code; now that
88`certs.c` is out of the library there is no longer any stability guaranteed
89and it may change in incompatible ways at any time.
90
91Remove the HAVEGE module
92------------------------
93
94This doesn't affect people using the default configuration as it was already
95disabled by default.
96
97This only affects users who called the HAVEGE modules directly (not
98recommended), or users who used it though the entropy module but had it as the
99only source of entropy. If you're in that case, please declare OS or hardware
100RNG interfaces with `mbedtls_entropy_add_source()` and/or use an entropy seed
101file created securely during device provisioning. See
102<https://tls.mbed.org/kb/how-to/add-entropy-sources-to-entropy-pool> for more
103information.
104
105Remove support for parsing SSLv2 ClientHello
106--------------------------------------------
107
108This doesn't affect people using the default configuration as it was already
109disabled by default.
110
111This only affects TLS servers that have clients who send a SSLv2 ClientHello.
112These days clients are very unlikely to do that. If you have a client that
113does, please try contacting them and encouraging them to upgrade their
114software.
115
116Remove support for SSL 3.0
117--------------------------
118
119This doesn't affect people using the default configuration as it was already
120disabled by default.
121
122This only affects TLS users who explicitly enabled `MBEDTLS_SSL_PROTO_SSL3`
123and relied on that version in order to communicate with peers that are not up
124to date. If one of your peers in in that case, please try contacting them and
125encouraging them to upgrade their software.
126
127Remove support for compatibility with old Mbed TLS's truncated HMAC
128-------------------------------------------------------------------
129
130This doesn't affect people using the default configuration as it was already
131disabled by default.
132
133This only affects TLS users enabled `MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT` and
134used the Truncated HMAC extension to communicate with peers using old version
135of Mbed TLS. Please consider using a CCM-8 ciphersuite instead of the
136Truncated HMAC extension, or convicing your peer to upgrade their version of
137Mbed TLS.
138
139Remove support for TLS record-level compression
140-----------------------------------------------
141
142This doesn't affect people using the default configuration as it was already
143disabled by default.
144
145This only affects TLS users who enabled `MBEDTLS_ZLIB_SUPPORT`. This will not
146cause any failures however if you used to enable TLS record-level compression
147you may find that your bandwidth usage increases without compression. There's
148no general solution to this problem; application protocols might have their
149own compression mechanisms and are in a better position than the TLS stack to
150avoid variants of the CRIME and BREACH attacks.
151
152Remove support for TLS RC4-based ciphersuites
153---------------------------------------------
154
155This does not affect people who used the default `config.h` and the default
156list of ciphersuites, as RC4-based ciehrsuites were already not negociated in
157that case.
158
159Please switch to any of the modern, recommended ciphersuites (based on
160AES-GCM, AES-CCM or ChachaPoly for example) and if your peer doesn't support
161any, encourage them to upgrade their software.
162
163Remove support for TLS single-DES ciphersuites
164----------------------------------------------
165
166This doesn't affect people using the default configuration as it was already
167disabled by default.
168
169Please switch to any of the modern, recommended ciphersuites (based on
170AES-GCM, AES-CCM or ChachaPoly for example) and if your peer doesn't support
171any, encourage them to upgrade their software.
172
173Remove support for TLS record-level hardware acceleration
174---------------------------------------------------------
175
176This doesn't affect people using the default configuration as it was already
177disabled by default.
178
179This feature had been broken for a while so we doubt anyone still used it.
180However if you did, please reach out on the mailing list and let us know about
181your use case.
182
183Remove wrapper for libpkcs11-helper
184-----------------------------------
185
186This doesn't affect people using the default configuration as it was already
187disabled by default.
188
189If you used to rely on this module in order to store your private keys
190securely, please have a look at the key management facilities provided by the
191PSA crypto API. If you have a use case that's not covered yet by this API,
192please reach out on the mailing list.
193
194Remove config option `MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME`
195----------------------------------------------------------
196
197This doesn't affect people using the default configuration.
198
199This option has been inactive for a long time. Please use the `lifetime`
200parameter of `mbedtls_ssl_ticket_setup()` instead.
201
202Remove helpers for the transition from Mbed TLS 1.3 to Mbed TLS 2.0
203-------------------------------------------------------------------
204
205This only affects people who've been using Mbed TLS since before version 2.0
206and still relied on `compat-1.3.h` in their code.
207
208Please use the new names directly in your code; `scripts/rename.pl` (from any
209of the 2.x releases - no longer included in 3.0) might help you do that.
210