xref: /optee_os/lib/libmbedtls/mbedtls/ChangeLog (revision c3deb3d6f3b13d0e17fc9efe5880aec039e47594)
1039e02dfSJerome ForissierMbed TLS ChangeLog (Sorted per branch, date)
2039e02dfSJerome Forissier
3*c3deb3d6SEtienne Carriere= Mbed TLS 3.6.3 branch released 2025-03-24
4*c3deb3d6SEtienne Carriere
5*c3deb3d6SEtienne CarriereDefault behavior changes
6*c3deb3d6SEtienne Carriere   * In TLS clients, if mbedtls_ssl_set_hostname() has not been called,
7*c3deb3d6SEtienne Carriere     mbedtls_ssl_handshake() now fails with
8*c3deb3d6SEtienne Carriere     MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
9*c3deb3d6SEtienne Carriere     if certificate-based authentication of the server is attempted.
10*c3deb3d6SEtienne Carriere     This is because authenticating a server without knowing what name
11*c3deb3d6SEtienne Carriere     to expect is usually insecure. To restore the old behavior, either
12*c3deb3d6SEtienne Carriere     call mbedtls_ssl_set_hostname() with NULL as the hostname, or
13*c3deb3d6SEtienne Carriere     enable the new compile-time option
14*c3deb3d6SEtienne Carriere     MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME.
15*c3deb3d6SEtienne Carriere
16*c3deb3d6SEtienne CarriereFeatures
17*c3deb3d6SEtienne Carriere   * Added new configuration option MBEDTLS_PSA_STATIC_KEY_SLOTS, which
18*c3deb3d6SEtienne Carriere     uses static storage for keys, enabling malloc-less use of key slots.
19*c3deb3d6SEtienne Carriere     The size of each buffer is given by the option
20*c3deb3d6SEtienne Carriere     MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE. By default it accommodates the
21*c3deb3d6SEtienne Carriere     largest PSA key enabled in the build.
22*c3deb3d6SEtienne Carriere   * MD module can now perform PSA dispatching also when
23*c3deb3d6SEtienne Carriere     `MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C`, even though this
24*c3deb3d6SEtienne Carriere     configuration is not officially supported. This requires that a
25*c3deb3d6SEtienne Carriere     PSA Crypto provider library which:
26*c3deb3d6SEtienne Carriere     * supports the required `PSA_WANT_ALG_xxx` and
27*c3deb3d6SEtienne Carriere     * implements `psa_can_do_hash()` on the client interface
28*c3deb3d6SEtienne Carriere     is linked against Mbed TLS and that `psa_crypto_init()` is called before
29*c3deb3d6SEtienne Carriere     performing any PSA call.
30*c3deb3d6SEtienne Carriere
31*c3deb3d6SEtienne CarriereSecurity
32*c3deb3d6SEtienne Carriere   * Note that TLS clients should generally call mbedtls_ssl_set_hostname()
33*c3deb3d6SEtienne Carriere     if they use certificate authentication (i.e. not pre-shared keys).
34*c3deb3d6SEtienne Carriere     Otherwise, in many scenarios, the server could be impersonated.
35*c3deb3d6SEtienne Carriere     The library will now prevent the handshake and return
36*c3deb3d6SEtienne Carriere     MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
37*c3deb3d6SEtienne Carriere     if mbedtls_ssl_set_hostname() has not been called.
38*c3deb3d6SEtienne Carriere     CVE-2025-27809
39*c3deb3d6SEtienne Carriere   * Zeroize a temporary heap buffer used in psa_key_derivation_output_key()
40*c3deb3d6SEtienne Carriere     when deriving an ECC key pair.
41*c3deb3d6SEtienne Carriere   * Zeroize temporary heap buffers used in PSA operations.
42*c3deb3d6SEtienne Carriere   * Fix a vulnerability in the TLS 1.2 handshake. If memory allocation failed
43*c3deb3d6SEtienne Carriere     or there was a cryptographic hardware failure when calculating the
44*c3deb3d6SEtienne Carriere     Finished message, it could be calculated incorrectly. This would break
45*c3deb3d6SEtienne Carriere     the security guarantees of the TLS handshake.
46*c3deb3d6SEtienne Carriere     CVE-2025-27810
47*c3deb3d6SEtienne Carriere
48*c3deb3d6SEtienne CarriereBugfix
49*c3deb3d6SEtienne Carriere   * When MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE is disabled, work with
50*c3deb3d6SEtienne Carriere     peers that have middlebox compatibility enabled, as long as no
51*c3deb3d6SEtienne Carriere     problematic middlebox is in the way. Fixes #9551.
52*c3deb3d6SEtienne Carriere   * Fix invalid JSON schemas for driver descriptions used by
53*c3deb3d6SEtienne Carriere     generate_driver_wrappers.py.
54*c3deb3d6SEtienne Carriere   * Use 'mbedtls_net_close' instead of 'close' in 'mbedtls_net_bind'
55*c3deb3d6SEtienne Carriere     and 'mbedtls_net_connect' to prevent possible double close fd
56*c3deb3d6SEtienne Carriere     problems. Fixes #9711.
57*c3deb3d6SEtienne Carriere   * Fix undefined behavior in some cases when mbedtls_psa_raw_to_der() or
58*c3deb3d6SEtienne Carriere     mbedtls_psa_der_to_raw() is called with bits=0.
59*c3deb3d6SEtienne Carriere   * Fix compilation on MS-DOS DJGPP. Fixes #9813.
60*c3deb3d6SEtienne Carriere   * Fix missing constraints on the AES-NI inline assembly which is used on
61*c3deb3d6SEtienne Carriere     GCC-like compilers when building AES for generic x86_64 targets. This
62*c3deb3d6SEtienne Carriere     may have resulted in incorrect code with some compilers, depending on
63*c3deb3d6SEtienne Carriere     optimizations. Fixes #9819.
64*c3deb3d6SEtienne Carriere   * Support re-assembly of fragmented handshake messages in TLS (both
65*c3deb3d6SEtienne Carriere     1.2 and 1.3). The lack of support was causing handshake failures with
66*c3deb3d6SEtienne Carriere     some servers, especially with TLS 1.3 in practice. There are a few
67*c3deb3d6SEtienne Carriere     limitations, notably a fragmented ClientHello is only supported when
68*c3deb3d6SEtienne Carriere     TLS 1.3 support is enabled. See the documentation of
69*c3deb3d6SEtienne Carriere     mbedtls_ssl_handshake() for details.
70*c3deb3d6SEtienne Carriere   * Fix definition of MBEDTLS_PRINTF_SIZET to prevent runtime crashes that
71*c3deb3d6SEtienne Carriere     occurred whenever SSL debugging was enabled on a copy of Mbed TLS built
72*c3deb3d6SEtienne Carriere     with Visual Studio 2013 or MinGW.
73*c3deb3d6SEtienne Carriere     Fixes #10017.
74*c3deb3d6SEtienne Carriere   * Remove Everest Visual Studio 2010 compatibility headers, which could
75*c3deb3d6SEtienne Carriere     shadow standard CRT headers inttypes.h and stdbool.h with incomplete
76*c3deb3d6SEtienne Carriere     implementatios if placed on the include path, eg. when building Mbed TLS
77*c3deb3d6SEtienne Carriere     with the .sln file shipped with the project.
78*c3deb3d6SEtienne Carriere   * Fix issue where psa_key_derivation_input_integer() is not detecting
79*c3deb3d6SEtienne Carriere     bad state after an operation has been aborted.
80*c3deb3d6SEtienne Carriere
81*c3deb3d6SEtienne CarriereChanges
82*c3deb3d6SEtienne Carriere   * Improve performance of PSA key generation with ECC keys: it no longer
83*c3deb3d6SEtienne Carriere     computes the public key (which was immediately discarded). Fixes #9732.
84*c3deb3d6SEtienne Carriere
85cb034002SJerome Forissier= Mbed TLS 3.6.2 branch released 2024-10-14
86cb034002SJerome Forissier
87cb034002SJerome ForissierSecurity
88cb034002SJerome Forissier   * Fix a buffer underrun in mbedtls_pk_write_key_der() when
89cb034002SJerome Forissier     called on an opaque key, MBEDTLS_USE_PSA_CRYPTO is enabled,
90cb034002SJerome Forissier     and the output buffer is smaller than the actual output.
91cb034002SJerome Forissier     Fix a related buffer underrun in mbedtls_pk_write_key_pem()
92cb034002SJerome Forissier     when called on an opaque RSA key, MBEDTLS_USE_PSA_CRYPTO is enabled
93cb034002SJerome Forissier     and MBEDTLS_MPI_MAX_SIZE is smaller than needed for a 4096-bit RSA key.
94cb034002SJerome Forissier     CVE-2024-49195
95cb034002SJerome Forissier
96cb034002SJerome Forissier= Mbed TLS 3.6.1 branch released 2024-08-30
97cb034002SJerome Forissier
98cb034002SJerome ForissierAPI changes
99cb034002SJerome Forissier   * The experimental functions psa_generate_key_ext() and
100cb034002SJerome Forissier     psa_key_derivation_output_key_ext() are no longer declared when compiling
101cb034002SJerome Forissier     in C++. This resolves a build failure under C++ compilers that do not
102cb034002SJerome Forissier     support flexible array members (a C99 feature not adopted by C++).
103cb034002SJerome Forissier     Fixes #9020.
104cb034002SJerome Forissier
105cb034002SJerome ForissierDefault behavior changes
106cb034002SJerome Forissier   * In a PSA-client-only build (i.e. MBEDTLS_PSA_CRYPTO_CLIENT &&
107cb034002SJerome Forissier     !MBEDTLS_PSA_CRYPTO_C), do not automatically enable local crypto when the
108cb034002SJerome Forissier     corresponding PSA mechanism is enabled, since the server provides the
109cb034002SJerome Forissier     crypto. Fixes #9126.
110cb034002SJerome Forissier   * A TLS handshake may now call psa_crypto_init() if TLS 1.3 is enabled.
111cb034002SJerome Forissier     This can happen even if TLS 1.3 is offered but eventually not selected
112cb034002SJerome Forissier     in the protocol version negotiation.
113cb034002SJerome Forissier   * By default, the handling of TLS 1.3 tickets by the Mbed TLS client is now
114cb034002SJerome Forissier     disabled at runtime. Applications that were using TLS 1.3 tickets
115cb034002SJerome Forissier     signalled by MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET return values now
116cb034002SJerome Forissier     need to enable the handling of TLS 1.3 tickets through the new
117cb034002SJerome Forissier     mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets() API.
118cb034002SJerome Forissier
119cb034002SJerome ForissierNew deprecations
120cb034002SJerome Forissier   * The experimental functions psa_generate_key_ext() and
121cb034002SJerome Forissier     psa_key_derivation_output_key_ext() are deprecated in favor of
122cb034002SJerome Forissier     psa_generate_key_custom() and psa_key_derivation_output_key_custom().
123cb034002SJerome Forissier     They have almost exactly the same interface, but the variable-length
124cb034002SJerome Forissier     data is passed in a separate parameter instead of a flexible array
125cb034002SJerome Forissier     member.
126cb034002SJerome Forissier   * The following cryptographic mechanisms are planned to be removed
127cb034002SJerome Forissier     in Mbed TLS 4.0:
128cb034002SJerome Forissier     - DES (including 3DES).
129cb034002SJerome Forissier     - PKCS#1v1.5 encryption/decryption (RSAES-PKCS1-v1_5).
130cb034002SJerome Forissier       (OAEP, PSS, and PKCS#1v1.5 signature are staying.)
131cb034002SJerome Forissier     - Finite-field Diffie-Hellman with custom groups.
132cb034002SJerome Forissier       (RFC 7919 groups remain supported.)
133cb034002SJerome Forissier     - Elliptic curves of size 225 bits or less.
134cb034002SJerome Forissier   * The following cipher suites are planned to be removed from (D)TLS 1.2
135cb034002SJerome Forissier     in Mbed TLS 4.0:
136cb034002SJerome Forissier     - TLS_RSA_* (including TLS_RSA_PSK_*), i.e. cipher suites using
137cb034002SJerome Forissier       RSA decryption.
138cb034002SJerome Forissier       (RSA signatures, i.e. TLS_ECDHE_RSA_*, are staying.)
139cb034002SJerome Forissier     - TLS_ECDH_*, i.e. cipher suites using static ECDH.
140cb034002SJerome Forissier       (Ephemeral ECDH, i.e. TLS_ECDHE_*, is staying.)
141cb034002SJerome Forissier     - TLS_DHE_*, i.e. cipher suites using finite-field Diffie-Hellman.
142cb034002SJerome Forissier       (Ephemeral ECDH, i.e. TLS_ECDHE_*, is staying.)
143cb034002SJerome Forissier     - TLS_*CBC*, i.e. all cipher suites using CBC.
144cb034002SJerome Forissier   * The following low-level application interfaces are planned to be removed
145cb034002SJerome Forissier     from the public API in Mbed TLS 4.0:
146cb034002SJerome Forissier     - Hashes: hkdf.h, md5.h, ripemd160.h, sha1.h, sha3.h, sha256.h, sha512.h;
147cb034002SJerome Forissier     - Random generation: ctr_drbg.h, hmac_drbg.h, entropy.h;
148cb034002SJerome Forissier     - Ciphers and modes: aes.h, aria.h, camellia.h, chacha20.h, chachapoly.h,
149cb034002SJerome Forissier       cipher.h, cmac.h, gcm.h, poly1305.h;
150cb034002SJerome Forissier     - Private key encryption mechanisms: pkcs5.h, pkcs12.h.
151cb034002SJerome Forissier     - Asymmetric cryptography: bignum.h, dhm.h, ecdh.h, ecdsa.h, ecjpake.h,
152cb034002SJerome Forissier       ecp.h, rsa.h.
153cb034002SJerome Forissier     The cryptographic mechanisms remain present, but they will only be
154cb034002SJerome Forissier     accessible via the PSA API (psa_xxx functions introduced gradually
155cb034002SJerome Forissier     starting with Mbed TLS 2.17) and, where relevant, `pk.h`.
156cb034002SJerome Forissier     For guidance on migrating application code to the PSA API, please consult
157cb034002SJerome Forissier     the PSA transition guide (docs/psa-transition.md).
158cb034002SJerome Forissier   * The following integration interfaces are planned to be removed
159cb034002SJerome Forissier     in Mbed TLS 4.0:
160cb034002SJerome Forissier     - MBEDTLS_xxx_ALT replacement of cryptographic modules and functions.
161cb034002SJerome Forissier       Use PSA transparent drivers instead.
162cb034002SJerome Forissier     - MBEDTLS_PK_RSA_ALT and MBEDTLS_PSA_CRYPTO_SE_C.
163cb034002SJerome Forissier       Use PSA opaque drivers instead.
164cb034002SJerome Forissier
165cb034002SJerome ForissierFeatures
166cb034002SJerome Forissier   * When the new compilation option MBEDTLS_PSA_KEY_STORE_DYNAMIC is enabled,
167cb034002SJerome Forissier     the number of volatile PSA keys is virtually unlimited, at the expense
168cb034002SJerome Forissier     of increased code size. This option is off by default, but enabled in
169cb034002SJerome Forissier     the default mbedtls_config.h. Fixes #9216.
170cb034002SJerome Forissier
171cb034002SJerome ForissierSecurity
172cb034002SJerome Forissier   * Unlike previously documented, enabling MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does
173cb034002SJerome Forissier     not cause the PSA subsystem to use HMAC_DRBG: it uses HMAC_DRBG only when
174cb034002SJerome Forissier     MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and MBEDTLS_CTR_DRBG_C are disabled.
175cb034002SJerome Forissier     CVE-2024-45157
176cb034002SJerome Forissier   * Fix a stack buffer overflow in mbedtls_ecdsa_der_to_raw() and
177cb034002SJerome Forissier     mbedtls_ecdsa_raw_to_der() when the bits parameter is larger than the
178cb034002SJerome Forissier     largest supported curve. In some configurations with PSA disabled,
179cb034002SJerome Forissier     all values of bits are affected. This never happens in internal library
180cb034002SJerome Forissier     calls, but can affect applications that call these functions directly.
181cb034002SJerome Forissier     CVE-2024-45158
182cb034002SJerome Forissier   * With TLS 1.3, when a server enables optional authentication of the
183cb034002SJerome Forissier     client, if the client-provided certificate does not have appropriate values
184cb034002SJerome Forissier     in keyUsage or extKeyUsage extensions, then the return value of
185cb034002SJerome Forissier     mbedtls_ssl_get_verify_result() would incorrectly have the
186cb034002SJerome Forissier     MBEDTLS_X509_BADCERT_KEY_USAGE and MBEDTLS_X509_BADCERT_EXT_KEY_USAGE bits
187cb034002SJerome Forissier     clear. As a result, an attacker that had a certificate valid for uses other
188cb034002SJerome Forissier     than TLS client authentication could be able to use it for TLS client
189cb034002SJerome Forissier     authentication anyway. Only TLS 1.3 servers were affected, and only with
190cb034002SJerome Forissier     optional authentication (required would abort the handshake with a fatal
191cb034002SJerome Forissier     alert).
192cb034002SJerome Forissier     CVE-2024-45159
193cb034002SJerome Forissier
194cb034002SJerome ForissierBugfix
195cb034002SJerome Forissier   * Fix TLS 1.3 client build and runtime when support for session tickets is
196cb034002SJerome Forissier     disabled (MBEDTLS_SSL_SESSION_TICKETS configuration option). Fixes #6395.
197cb034002SJerome Forissier   * Fix compilation error when memcpy() is a function-like macros. Fixes #8994.
198cb034002SJerome Forissier   * MBEDTLS_ASN1_PARSE_C and MBEDTLS_ASN1_WRITE_C are now automatically enabled
199cb034002SJerome Forissier     as soon as MBEDTLS_RSA_C is enabled. Fixes #9041.
200cb034002SJerome Forissier   * Fix undefined behaviour (incrementing a NULL pointer by zero length) when
201cb034002SJerome Forissier     passing in zero length additional data to multipart AEAD.
202cb034002SJerome Forissier   * Fix rare concurrent access bug where attempting to operate on a
203cb034002SJerome Forissier     non-existent key while concurrently creating a new key could potentially
204cb034002SJerome Forissier     corrupt the key store.
205cb034002SJerome Forissier   * Fix error handling when creating a key in a dynamic secure element
206cb034002SJerome Forissier     (feature enabled by MBEDTLS_PSA_CRYPTO_SE_C). In a low memory condition,
207cb034002SJerome Forissier     the creation could return PSA_SUCCESS but using or destroying the key
208cb034002SJerome Forissier     would not work. Fixes #8537.
209cb034002SJerome Forissier   * Fix issue of redefinition warning messages for _GNU_SOURCE in
210cb034002SJerome Forissier     entropy_poll.c and sha_256.c. There was a build warning during
211cb034002SJerome Forissier     building for linux platform.
212cb034002SJerome Forissier     Resolves #9026
213cb034002SJerome Forissier   * Fix a compilation warning in pk.c when PSA is enabled and RSA is disabled.
214cb034002SJerome Forissier   * Fix the build when MBEDTLS_PSA_CRYPTO_CONFIG is enabled and the built-in
215cb034002SJerome Forissier     CMAC is enabled, but no built-in unauthenticated cipher is enabled.
216cb034002SJerome Forissier     Fixes #9209.
217cb034002SJerome Forissier   * Fix redefinition warnings when SECP192R1 and/or SECP192K1 are disabled.
218cb034002SJerome Forissier     Fixes #9029.
219cb034002SJerome Forissier   * Fix psa_cipher_decrypt() with CCM* rejecting messages less than 3 bytes
220cb034002SJerome Forissier     long. Credit to Cryptofuzz. Fixes #9314.
221cb034002SJerome Forissier   * Fix interference between PSA volatile keys and built-in keys
222cb034002SJerome Forissier     when MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS is enabled and
223cb034002SJerome Forissier     MBEDTLS_PSA_KEY_SLOT_COUNT is more than 4096.
224cb034002SJerome Forissier   * Document and enforce the limitation of mbedtls_psa_register_se_key()
225cb034002SJerome Forissier     to persistent keys. Resolves #9253.
226cb034002SJerome Forissier   * Fix Clang compilation error when MBEDTLS_USE_PSA_CRYPTO is enabled
227cb034002SJerome Forissier     but MBEDTLS_DHM_C is disabled. Reported by Michael Schuster in #9188.
228cb034002SJerome Forissier   * Fix server mode only build when MBEDTLS_SSL_SRV_C is enabled but
229cb034002SJerome Forissier     MBEDTLS_SSL_CLI_C is disabled. Reported by M-Bab on GitHub in #9186.
230cb034002SJerome Forissier   * When MBEDTLS_PSA_CRYPTO_C was disabled and MBEDTLS_ECDSA_C enabled,
231cb034002SJerome Forissier     some code was defining 0-size arrays, resulting in compilation errors.
232cb034002SJerome Forissier     Fixed by disabling the offending code in configurations without PSA
233cb034002SJerome Forissier     Crypto, where it never worked. Fixes #9311.
234cb034002SJerome Forissier   * Fix unintended performance regression when using short RSA public keys.
235cb034002SJerome Forissier     Fixes #9232.
236cb034002SJerome Forissier   * Fixes an issue where some TLS 1.2 clients could not connect to an
237cb034002SJerome Forissier     Mbed TLS 3.6.0 server, due to incorrect handling of
238cb034002SJerome Forissier     legacy_compression_methods in the ClientHello.
239cb034002SJerome Forissier     Fixes #8995, #9243.
240cb034002SJerome Forissier   * Fix TLS connections failing when the handshake selects TLS 1.3
241cb034002SJerome Forissier     in an application that does not call psa_crypto_init().
242cb034002SJerome Forissier     Fixes #9072.
243cb034002SJerome Forissier   * Fix TLS connection failure in applications using an Mbed TLS client in
244cb034002SJerome Forissier     the default configuration connecting to a TLS 1.3 server sending tickets.
245cb034002SJerome Forissier     See the documentation of
246cb034002SJerome Forissier     mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets() for more
247cb034002SJerome Forissier     information.
248cb034002SJerome Forissier     Fixes #8749.
249cb034002SJerome Forissier   * Fix a memory leak that could occur when failing to process an RSA
250cb034002SJerome Forissier     key through some PSA functions due to low memory conditions.
251cb034002SJerome Forissier   * Fixed a regression introduced in 3.6.0 where the CA callback set with
252cb034002SJerome Forissier     mbedtls_ssl_conf_ca_cb() would stop working when connections were
253cb034002SJerome Forissier     upgraded to TLS 1.3. Fixed by adding support for the CA callback with TLS
254cb034002SJerome Forissier     1.3.
255cb034002SJerome Forissier   * Fixed a regression introduced in 3.6.0 where clients that relied on
256cb034002SJerome Forissier     optional/none authentication mode, by calling mbedtls_ssl_conf_authmode()
257cb034002SJerome Forissier     with MBEDTLS_SSL_VERIFY_OPTIONAL or MBEDTLS_SSL_VERIFY_NONE, would stop
258cb034002SJerome Forissier     working when connections were upgraded to TLS 1.3. Fixed by adding
259cb034002SJerome Forissier     support for optional/none with TLS 1.3 as well. Note that the TLS 1.3
260cb034002SJerome Forissier     standard makes server authentication mandatory; users are advised not to
261cb034002SJerome Forissier     use authmode none, and to carefully check the results when using optional
262cb034002SJerome Forissier     mode.
263cb034002SJerome Forissier   * Fixed a regression introduced in 3.6.0 where context-specific certificate
264cb034002SJerome Forissier     verify callbacks, set with mbedtls_ssl_set_verify() as opposed to
265cb034002SJerome Forissier     mbedtls_ssl_conf_verify(), would stop working when connections were
266cb034002SJerome Forissier     upgraded to TLS 1.3. Fixed by adding support for context-specific verify
267cb034002SJerome Forissier     callback in TLS 1.3.
268cb034002SJerome Forissier
269cb034002SJerome ForissierChanges
270cb034002SJerome Forissier   * Warn if mbedtls/check_config.h is included manually, as this can
271cb034002SJerome Forissier     lead to spurious errors. Error if a *adjust*.h header is included
272cb034002SJerome Forissier     manually, as this can lead to silently inconsistent configurations,
273cb034002SJerome Forissier     potentially resulting in buffer overflows.
274cb034002SJerome Forissier     When migrating from Mbed TLS 2.x, if you had a custom config.h that
275cb034002SJerome Forissier     included check_config.h, remove this inclusion from the Mbed TLS 3.x
276cb034002SJerome Forissier     configuration file (renamed to mbedtls_config.h). This change was made
277cb034002SJerome Forissier     in Mbed TLS 3.0, but was not announced in a changelog entry at the time.
278cb034002SJerome Forissier
279b0563631STom Van Eyck= Mbed TLS 3.6.0 branch released 2024-03-28
280b0563631STom Van Eyck
281b0563631STom Van EyckAPI changes
282b0563631STom Van Eyck   * Remove `tls13_` in mbedtls_ssl_tls13_conf_early_data() and
283b0563631STom Van Eyck     mbedtls_ssl_tls13_conf_max_early_data_size() API names. Early data
284b0563631STom Van Eyck     feature may not be TLS 1.3 specific in the future. Fixes #6909.
285b0563631STom Van Eyck
286b0563631STom Van EyckDefault behavior changes
287b0563631STom Van Eyck   * psa_import_key() now only accepts RSA keys in the PSA standard formats.
288b0563631STom Van Eyck     The undocumented ability to import other formats (PKCS#8, SubjectPublicKey,
289b0563631STom Van Eyck     PEM) accepted by the pkparse module has been removed. Applications that
290b0563631STom Van Eyck     need these formats can call mbedtls_pk_parse_{public,}key() followed by
291b0563631STom Van Eyck     mbedtls_pk_import_into_psa().
292b0563631STom Van Eyck
293b0563631STom Van EyckRequirement changes
294b0563631STom Van Eyck   * Drop support for Visual Studio 2013 and 2015, and Arm Compiler 5.
295b0563631STom Van Eyck
296b0563631STom Van EyckNew deprecations
297b0563631STom Van Eyck   * Rename the MBEDTLS_SHA256_USE_A64_CRYPTO_xxx config options to
298b0563631STom Van Eyck     MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_xxx. The old names may still
299b0563631STom Van Eyck     be used, but are deprecated.
300b0563631STom Van Eyck   * In the PSA API, domain parameters are no longer used for anything.
301b0563631STom Van Eyck     They are deprecated and will be removed in a future version of the
302b0563631STom Van Eyck     library.
303b0563631STom Van Eyck   * mbedtls_ecp_write_key() is deprecated in favor of
304b0563631STom Van Eyck     mbedtls_ecp_write_key_ext().
305b0563631STom Van Eyck
306b0563631STom Van EyckRemovals
307b0563631STom Van Eyck   * In the PSA API, the experimental way to encode the public exponent of
308b0563631STom Van Eyck     an RSA key as a domain parameter is no longer supported. Use
309b0563631STom Van Eyck     psa_generate_key_ext() instead.
310b0563631STom Van Eyck   * Temporary function mbedtls_pk_wrap_as_opaque() is removed. To mimic the
311b0563631STom Van Eyck     same behavior mbedtls_pk_get_psa_attributes() and
312b0563631STom Van Eyck     mbedtls_pk_import_into_psa() can be used to import a PK key into PSA,
313b0563631STom Van Eyck     while mbedtls_pk_setup_opaque() can be used to wrap a PSA key into a opaque
314b0563631STom Van Eyck     PK context.
315b0563631STom Van Eyck
316b0563631STom Van EyckFeatures
317b0563631STom Van Eyck   * Added an example program showing how to hash with the PSA API.
318b0563631STom Van Eyck   * Support Armv8-A Crypto Extension acceleration for SHA-256
319b0563631STom Van Eyck     when compiling for Thumb (T32) or 32-bit Arm (A32).
320b0563631STom Van Eyck   * AES-NI is now supported in Windows builds with clang and clang-cl.
321b0563631STom Van Eyck     Resolves #8372.
322b0563631STom Van Eyck   * Add new mbedtls_x509_csr_parse_der_with_ext_cb() routine which allows
323b0563631STom Van Eyck     parsing unsupported certificate extensions via user provided callback.
324b0563631STom Van Eyck   * Enable the new option MBEDTLS_BLOCK_CIPHER_NO_DECRYPT to omit
325b0563631STom Van Eyck     the decryption direction of block ciphers (AES, ARIA, Camellia).
326b0563631STom Van Eyck     This affects both the low-level modules and the high-level APIs
327b0563631STom Van Eyck     (the cipher and PSA interfaces). This option is incompatible with modes
328b0563631STom Van Eyck     that use the decryption direction (ECB in PSA, CBC, XTS, KW) and with DES.
329b0563631STom Van Eyck   * Support use of Armv8-A Cryptographic Extensions for hardware acclerated
330b0563631STom Van Eyck     AES when compiling for Thumb (T32) or 32-bit Arm (A32).
331b0563631STom Van Eyck   * If a cipher or AEAD mechanism has a PSA driver, you can now build the
332b0563631STom Van Eyck     library without the corresponding built-in implementation. Generally
333b0563631STom Van Eyck     speaking that requires both the key type and algorithm to be accelerated
334b0563631STom Van Eyck     or they'll both be built in. However, for CCM and GCM the built-in
335b0563631STom Van Eyck     implementation is able to take advantage of a driver that only
336b0563631STom Van Eyck     accelerates the key type (that is, the block cipher primitive). See
337b0563631STom Van Eyck     docs/driver-only-builds.md for full details and current limitations.
338b0563631STom Van Eyck   * The CTR_DRBG module will now use AES from a PSA driver if MBEDTLS_AES_C is
339b0563631STom Van Eyck     disabled. This requires PSA_WANT_ALG_ECB_NO_PADDING in addition to
340b0563631STom Van Eyck     MBEDTLS_PSA_CRYPTO_C and PSA_WANT_KEY_TYPE_AES.
341b0563631STom Van Eyck   * Fewer modules depend on MBEDTLS_CIPHER_C, making it possible to save code
342b0563631STom Van Eyck     size by disabling it in more circumstances. In particular, the CCM and
343b0563631STom Van Eyck     GCM modules no longer depend on MBEDTLS_CIPHER_C. Also,
344b0563631STom Van Eyck     MBEDTLS_PSA_CRYPTO can now be enabled without MBEDTLS_CIPHER_C if all
345b0563631STom Van Eyck     unauthenticated (non-AEAD) ciphers are disabled, or if they're all
346b0563631STom Van Eyck     fully provided by drivers. See docs/driver-only-builds.md for full
347b0563631STom Van Eyck     details and current limitations; in particular, NIST_KW and PKCS5/PKCS12
348b0563631STom Van Eyck     decryption still unconditionally depend on MBEDTLS_CIPHER_C.
349b0563631STom Van Eyck   * Add support for record size limit extension as defined by RFC 8449
350b0563631STom Van Eyck     and configured with MBEDTLS_SSL_RECORD_SIZE_LIMIT.
351b0563631STom Van Eyck     Application data sent and received will be fragmented according to
352b0563631STom Van Eyck     Record size limits negotiated during handshake.
353b0563631STom Van Eyck   * Improve performance of AES-GCM, AES-CTR and CTR-DRBG when
354b0563631STom Van Eyck     hardware accelerated AES is not present (around 13-23% on 64-bit Arm).
355b0563631STom Van Eyck   * Add functions mbedtls_ecc_group_to_psa() and mbedtls_ecc_group_from_psa()
356b0563631STom Van Eyck     to convert between Mbed TLS and PSA curve identifiers.
357b0563631STom Van Eyck   * Add utility functions to manipulate mbedtls_ecp_keypair objects, filling
358b0563631STom Van Eyck     gaps made by making its fields private: mbedtls_ecp_set_public_key(),
359b0563631STom Van Eyck     mbedtls_ecp_write_public_key(), mbedtls_ecp_keypair_calc_public(),
360b0563631STom Van Eyck     mbedtls_ecp_keypair_get_group_id(). Fixes #5017, #5441, #8367, #8652.
361b0563631STom Van Eyck   * Add functions mbedtls_md_psa_alg_from_type() and
362b0563631STom Van Eyck     mbedtls_md_type_from_psa_alg() to convert between mbedtls_md_type_t and
363b0563631STom Van Eyck     psa_algorithm_t.
364b0563631STom Van Eyck   * Add partial platform support for z/OS.
365b0563631STom Van Eyck   * Improve performance for gcc (versions older than 9.3.0) and IAR.
366b0563631STom Van Eyck   * Add functions mbedtls_ecdsa_raw_to_der() and mbedtls_ecdsa_der_to_raw() to
367b0563631STom Van Eyck     convert ECDSA signatures between raw and DER (ASN.1) formats.
368b0563631STom Van Eyck   * Add support for using AES-CBC 128, 192, and 256 bit schemes
369b0563631STom Van Eyck     with PKCS#5 PBES2. Keys encrypted this way can now be parsed by PK parse.
370b0563631STom Van Eyck   * The new function mbedtls_rsa_get_bitlen() returns the length of the modulus
371b0563631STom Van Eyck     in bits, i.e. the key size for an RSA key.
372b0563631STom Van Eyck   * Add pc files for pkg-config, e.g.:
373b0563631STom Van Eyck     pkg-config --cflags --libs (mbedtls|mbedcrypto|mbedx509)
374b0563631STom Van Eyck   * Add getter (mbedtls_ssl_session_get_ticket_creation_time()) to access
375b0563631STom Van Eyck     `mbedtls_ssl_session.ticket_creation_time`.
376b0563631STom Van Eyck   * The new functions mbedtls_pk_get_psa_attributes() and
377b0563631STom Van Eyck     mbedtls_pk_import_into_psa() provide a uniform way to create a PSA
378b0563631STom Van Eyck     key from a PK key.
379b0563631STom Van Eyck   * The benchmark program now reports times for both ephemeral and static
380b0563631STom Van Eyck     ECDH in all ECDH configurations.
381b0563631STom Van Eyck   * Add support for 8-bit GCM tables for Shoup's algorithm to speedup GCM
382b0563631STom Van Eyck     operations when hardware accelerated AES is not present. Improves
383b0563631STom Van Eyck     performance by around 30% on 64-bit Intel; 125% on Armv7-M.
384b0563631STom Van Eyck   * The new function psa_generate_key_ext() allows generating an RSA
385b0563631STom Van Eyck     key pair with a custom public exponent.
386b0563631STom Van Eyck   * The new function mbedtls_ecp_write_key_ext() is similar to
387b0563631STom Van Eyck     mbedtls_ecp_write_key(), but can be used without separately calculating
388b0563631STom Van Eyck     the output length.
389b0563631STom Van Eyck   * Add new accessor to expose the private group id member of
390b0563631STom Van Eyck     `mbedtls_ecdh_context` structure.
391b0563631STom Van Eyck   * Add new accessor to expose the `MBEDTLS_PRIVATE(ca_istrue)` member of
392b0563631STom Van Eyck     `mbedtls_x509_crt` structure. This requires setting
393b0563631STom Van Eyck     the MBEDTLS_X509_EXT_BASIC_CONSTRAINTS bit in the certificate's
394b0563631STom Van Eyck     ext_types field.
395b0563631STom Van Eyck   * mbedtls_psa_get_random() is always available as soon as
396b0563631STom Van Eyck     MBEDTLS_PSA_CRYPTO_CLIENT is enabled at build time and psa_crypto_init() is
397b0563631STom Van Eyck     called at runtime. This together with MBEDTLS_PSA_RANDOM_STATE can be
398b0563631STom Van Eyck     used as random number generator function (f_rng) and context (p_rng) in
399b0563631STom Van Eyck     legacy functions.
400b0563631STom Van Eyck   * The new functions mbedtls_pk_copy_from_psa() and
401b0563631STom Van Eyck     mbedtls_pk_copy_public_from_psa() provide ways to set up a PK context
402b0563631STom Van Eyck     with the same content as a PSA key.
403b0563631STom Van Eyck   * Add new accessors to expose the private session-id,
404b0563631STom Van Eyck     session-id length, and ciphersuite-id members of
405b0563631STom Van Eyck     `mbedtls_ssl_session` structure.
406b0563631STom Van Eyck     Add new accessor to expose the ciphersuite-id of
407b0563631STom Van Eyck     `mbedtls_ssl_ciphersuite_t` structure.Design ref: #8529
408b0563631STom Van Eyck   * Mbed TLS now supports the writing and reading of TLS 1.3 early data (see
409b0563631STom Van Eyck     docs/tls13-early-data.md). The support enablement is controlled at build
410b0563631STom Van Eyck     time by the MBEDTLS_SSL_EARLY_DATA configuration option and at runtime by
411b0563631STom Van Eyck     the mbedtls_ssl_conf_early_data() API (by default disabled in both cases).
412b0563631STom Van Eyck   * Add protection for multithreaded access to the PSA keystore and protection
413b0563631STom Van Eyck     for multithreaded access to the the PSA global state, including
414b0563631STom Van Eyck     concurrently calling psa_crypto_init() when MBEDTLS_THREADING_C and
415b0563631STom Van Eyck     MBEDTLS_THREADING_PTHREAD are defined. See
416b0563631STom Van Eyck     docs/architecture/psa-thread-safety/psa-thread-safety.md for more details.
417b0563631STom Van Eyck     Resolves issues #3263 and #7945.
418b0563631STom Van Eyck
419b0563631STom Van EyckSecurity
420b0563631STom Van Eyck   * Fix a stack buffer overread (less than 256 bytes) when parsing a TLS 1.3
421b0563631STom Van Eyck     ClientHello in a TLS 1.3 server supporting some PSK key exchange mode. A
422b0563631STom Van Eyck     malicious client could cause information disclosure or a denial of service.
423cb034002SJerome Forissier     Fixes CVE-2024-30166.
424b0563631STom Van Eyck   * Passing buffers that are stored in untrusted memory as arguments
425b0563631STom Van Eyck     to PSA functions is now secure by default.
426b0563631STom Van Eyck     The PSA core now protects against modification of inputs or exposure
427b0563631STom Van Eyck     of intermediate outputs during operations. This is currently implemented
428b0563631STom Van Eyck     by copying buffers.
429b0563631STom Van Eyck     This feature increases code size and memory usage. If buffers passed to
430b0563631STom Van Eyck     PSA functions are owned exclusively by the PSA core for the duration of
431b0563631STom Van Eyck     the function call (i.e. no buffer parameters are in shared memory),
432b0563631STom Van Eyck     copying may be disabled by setting MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS.
433b0563631STom Van Eyck     Note that setting this option will cause input-output buffer overlap to
434b0563631STom Van Eyck     be only partially supported (#3266).
435b0563631STom Van Eyck     Fixes CVE-2024-28960.
436b0563631STom Van Eyck   * Restore the maximum TLS version to be negotiated to the configured one
437b0563631STom Van Eyck     when an SSL context is reset with the mbedtls_ssl_session_reset() API.
438b0563631STom Van Eyck     An attacker was able to prevent an Mbed TLS server from establishing any
439b0563631STom Van Eyck     TLS 1.3 connection potentially resulting in a Denial of Service or forced
440b0563631STom Van Eyck     version downgrade from TLS 1.3 to TLS 1.2. Fixes #8654 reported by hey3e.
441b0563631STom Van Eyck     Fixes CVE-2024-28755.
442b0563631STom Van Eyck   * When negotiating TLS version on server side, do not fall back to the
443b0563631STom Van Eyck     TLS 1.2 implementation of the protocol if it is disabled.
444b0563631STom Van Eyck     - If the TLS 1.2 implementation was disabled at build time, a TLS 1.2
445b0563631STom Van Eyck       client could put the TLS 1.3-only server in an infinite loop processing
446b0563631STom Van Eyck       a TLS 1.2 ClientHello, resulting in a denial of service. Reported by
447b0563631STom Van Eyck       Matthias Mucha and Thomas Blattmann, SICK AG.
448b0563631STom Van Eyck     - If the TLS 1.2 implementation was disabled at runtime, a TLS 1.2 client
449b0563631STom Van Eyck       was able to successfully establish a TLS 1.2 connection with the server.
450b0563631STom Van Eyck       Reported by alluettiv on GitHub.
451b0563631STom Van Eyck    Fixes CVE-2024-28836.
452b0563631STom Van Eyck
453b0563631STom Van EyckBugfix
454b0563631STom Van Eyck   * Fix the build with CMake when Everest or P256-m is enabled through
455b0563631STom Van Eyck     a user configuration file or the compiler command line. Fixes #8165.
456b0563631STom Van Eyck   * Fix compilation error in C++ programs when MBEDTLS_ASN1_PARSE_C is
457b0563631STom Van Eyck     disabled.
458b0563631STom Van Eyck   * Fix possible NULL dereference issue in X509 cert_req program if an entry
459b0563631STom Van Eyck     in the san parameter is not separated by a colon.
460b0563631STom Van Eyck   * Fix possible NULL dereference issue in X509 cert_write program if an entry
461b0563631STom Van Eyck     in the san parameter is not separated by a colon.
462b0563631STom Van Eyck   * Fix an inconsistency between implementations and usages of `__cpuid`,
463b0563631STom Van Eyck     which mainly causes failures when building Windows target using
464b0563631STom Van Eyck     mingw or clang. Fixes #8334 & #8332.
465b0563631STom Van Eyck   * Fix build failure in conda-forge.  Fixes #8422.
466b0563631STom Van Eyck   * Fix parsing of CSRs with critical extensions.
467b0563631STom Van Eyck   * Switch to milliseconds as the unit for ticket creation and reception time
468b0563631STom Van Eyck     instead of seconds. That avoids rounding errors when computing the age of
469b0563631STom Van Eyck     tickets compared to peer using a millisecond clock (observed with GnuTLS).
470b0563631STom Van Eyck     Fixes #6623.
471b0563631STom Van Eyck   * Fix TLS server accepting TLS 1.2 handshake while TLS 1.2
472b0563631STom Van Eyck     is disabled at runtime. Fixes #8593.
473b0563631STom Van Eyck   * Remove accidental introduction of RSA signature algorithms
474b0563631STom Van Eyck     in TLS Suite B Profile. Fixes #8221.
475b0563631STom Van Eyck   * Fix unsupported PSA asymmetric encryption and decryption
476b0563631STom Van Eyck     (psa_asymmetric_[en|de]crypt) with opaque keys.
477b0563631STom Van Eyck     Resolves #8461.
478b0563631STom Van Eyck   * On Linux on ARMv8, fix a build error with SHA-256 and SHA-512
479b0563631STom Van Eyck     acceleration detection when the libc headers do not define the
480b0563631STom Van Eyck     corresponding constant. Reported by valord577.
481b0563631STom Van Eyck   * Correct initial capacities for key derivation algorithms:TLS12_PRF,
482b0563631STom Van Eyck     TLS12_PSK_TO_MS, PBKDF2-HMAC, PBKDF2-CMAC
483b0563631STom Van Eyck   * Fix mbedtls_pk_get_bitlen() for RSA keys whose size is not a
484b0563631STom Van Eyck     multiple of 8. Fixes #868.
485b0563631STom Van Eyck   * Avoid segmentation fault caused by releasing not initialized
486b0563631STom Van Eyck     entropy resource in gen_key example. Fixes #8809.
487b0563631STom Van Eyck   * mbedtls_pem_read_buffer() now performs a check on the padding data of
488b0563631STom Van Eyck     decrypted keys and it rejects invalid ones.
489b0563631STom Van Eyck   * Fix mbedtls_pk_sign(), mbedtls_pk_verify(), mbedtls_pk_decrypt() and
490b0563631STom Van Eyck     mbedtls_pk_encrypt() on non-opaque RSA keys to honor the padding mode in
491b0563631STom Van Eyck     the RSA context. Before, if MBEDTLS_USE_PSA_CRYPTO was enabled and the
492b0563631STom Van Eyck     RSA context was configured for PKCS#1 v2.1 (PSS/OAEP), the sign/verify
493b0563631STom Van Eyck     functions performed a PKCS#1 v1.5 signature instead and the
494b0563631STom Van Eyck     encrypt/decrypt functions returned an error. Fixes #8824.
495b0563631STom Van Eyck   * Fix missing bitflags in SSL session serialization headers. Their absence
496b0563631STom Van Eyck     allowed SSL sessions saved in one configuration to be loaded in a
497b0563631STom Van Eyck     different, incompatible configuration.
498b0563631STom Van Eyck   * In TLS 1.3 clients, fix an interoperability problem due to the client
499b0563631STom Van Eyck     generating a new random after a HelloRetryRequest. Fixes #8669.
500b0563631STom Van Eyck   * Fix the restoration of the ALPN when loading serialized connection with
501b0563631STom Van Eyck     the mbedtls_ssl_context_load() API.
502b0563631STom Van Eyck   * Fix NULL pointer dereference in mbedtls_pk_verify_ext() when called using
503b0563631STom Van Eyck     an opaque RSA context and specifying MBEDTLS_PK_RSASSA_PSS as key type.
504b0563631STom Van Eyck   * Fix RSA opaque keys always using PKCS1 v1.5 algorithms instead of the
505b0563631STom Van Eyck     primary algorithm of the wrapped PSA key.
506b0563631STom Van Eyck   * Fully support arbitrary overlap between inputs and outputs of PSA
507b0563631STom Van Eyck     functions. Note that overlap is still only partially supported when
508b0563631STom Van Eyck     MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS is set (#3266).
509b0563631STom Van Eyck
510b0563631STom Van EyckChanges
511b0563631STom Van Eyck   * Use heap memory to allocate DER encoded public/private key.
512b0563631STom Van Eyck     This reduces stack usage significantly for writing a public/private
513b0563631STom Van Eyck     key to a PEM string.
514b0563631STom Van Eyck   * PSA_WANT_ALG_CCM and PSA_WANT_ALG_CCM_STAR_NO_TAG are no more synonyms and
515b0563631STom Van Eyck     they are now treated separately. This means that they should be
516b0563631STom Van Eyck     individually enabled in order to enable respective support; also the
517b0563631STom Van Eyck     corresponding MBEDTLS_PSA_ACCEL symbol should be defined in case
518b0563631STom Van Eyck     acceleration is required.
519b0563631STom Van Eyck   * Moved declaration of functions mbedtls_ecc_group_to_psa and
520b0563631STom Van Eyck     mbedtls_ecc_group_of_psa from psa/crypto_extra.h to mbedtls/psa_util.h
521b0563631STom Van Eyck   * mbedtls_pk_sign_ext() is now always available, not just when
522b0563631STom Van Eyck     PSA (MBEDTLS_PSA_CRYPTO_C) is enabled.
523b0563631STom Van Eyck   * Extended PSA Crypto configurations options for FFDH by making it possible
524b0563631STom Van Eyck     to select only some of the parameters / groups, with the macros
525b0563631STom Van Eyck     PSA_WANT_DH_RFC7919_XXXX. You now need to defined the corresponding macro
526b0563631STom Van Eyck     for each size you want to support. Also, if you have an FFDH accelerator,
527b0563631STom Van Eyck     you'll need to define the appropriate MBEDTLS_PSA_ACCEL macros to signal
528b0563631STom Van Eyck     support for these domain parameters.
529b0563631STom Van Eyck   * RSA support in PSA no longer auto-enables the pkparse and pkwrite modules,
530b0563631STom Van Eyck     saving code size when those are not otherwise enabled.
531b0563631STom Van Eyck   * mbedtls_mpi_exp_mod and code that uses it, notably RSA and DHM operations,
532b0563631STom Van Eyck     have changed their speed/memory compromise as part of a proactive security
533b0563631STom Van Eyck     improvement. The new default value of MBEDTLS_MPI_WINDOW_SIZE roughly
534b0563631STom Van Eyck     preserves the current speed, at the expense of increasing memory
535b0563631STom Van Eyck     consumption.
536b0563631STom Van Eyck   * Rename directory containing Visual Studio files from visualc/VS2013 to
537b0563631STom Van Eyck     visualc/VS2017.
538b0563631STom Van Eyck   * The TLS 1.3 protocol is now enabled in the default configuration.
539b0563631STom Van Eyck
540b0563631STom Van Eyck= Mbed TLS 3.5.2 branch released 2024-01-26
541b0563631STom Van Eyck
542b0563631STom Van EyckSecurity
543b0563631STom Van Eyck   * Fix a timing side channel in private key RSA operations. This side channel
544b0563631STom Van Eyck     could be sufficient for an attacker to recover the plaintext. A local
545b0563631STom Van Eyck     attacker or a remote attacker who is close to the victim on the network
546b0563631STom Van Eyck     might have precise enough timing measurements to exploit this. It requires
547b0563631STom Van Eyck     the attacker to send a large number of messages for decryption. For
548b0563631STom Van Eyck     details, see "Everlasting ROBOT: the Marvin Attack", Hubert Kario. Reported
549b0563631STom Van Eyck     by Hubert Kario, Red Hat.
550b0563631STom Van Eyck   * Fix a failure to validate input when writing x509 extensions lengths which
551b0563631STom Van Eyck     could result in an integer overflow, causing a zero-length buffer to be
552b0563631STom Van Eyck     allocated to hold the extension. The extension would then be copied into
553b0563631STom Van Eyck     the buffer, causing a heap buffer overflow.
554b0563631STom Van Eyck
555b0563631STom Van Eyck= Mbed TLS 3.5.1 branch released 2023-11-06
556b0563631STom Van Eyck
557b0563631STom Van EyckChanges
558b0563631STom Van Eyck   *  Mbed TLS is now released under a dual Apache-2.0 OR GPL-2.0-or-later
559b0563631STom Van Eyck      license. Users may choose which license they take the code under.
560b0563631STom Van Eyck
561b0563631STom Van EyckBugfix
562b0563631STom Van Eyck   * Fix accidental omission of MBEDTLS_TARGET_PREFIX in 3rdparty modules
563b0563631STom Van Eyck     in CMake.
564b0563631STom Van Eyck
565b0563631STom Van Eyck= Mbed TLS 3.5.0 branch released 2023-10-05
566b0563631STom Van Eyck
567b0563631STom Van EyckAPI changes
568b0563631STom Van Eyck   * Mbed TLS 3.4 introduced support for omitting the built-in implementation
569b0563631STom Van Eyck     of ECDSA and/or EC J-PAKE when those are provided by a driver. However,
570b0563631STom Van Eyck     there was a flaw in the logic checking if the built-in implementation, in
571b0563631STom Van Eyck     that it failed to check if all the relevant curves were supported by the
572b0563631STom Van Eyck     accelerator. As a result, it was possible to declare no curves as
573b0563631STom Van Eyck     accelerated and still have the built-in implementation compiled out.
574b0563631STom Van Eyck     Starting with this release, it is necessary to declare which curves are
575b0563631STom Van Eyck     accelerated (using MBEDTLS_PSA_ACCEL_ECC_xxx macros), or they will be
576b0563631STom Van Eyck     considered not accelerated, and the built-in implementation of the curves
577b0563631STom Van Eyck     and any algorithm possible using them will be included in the build.
578b0563631STom Van Eyck   * Add new millisecond time type `mbedtls_ms_time_t` and `mbedtls_ms_time()`
579b0563631STom Van Eyck     function, needed for TLS 1.3 ticket lifetimes. Alternative implementations
580b0563631STom Van Eyck     can be created using an ALT interface.
581b0563631STom Van Eyck
582b0563631STom Van EyckRequirement changes
583b0563631STom Van Eyck   * Officially require Python 3.8 now that earlier versions are out of support.
584b0563631STom Van Eyck   * Minimum required Windows version is now Windows Vista, or
585b0563631STom Van Eyck     Windows Server 2008.
586b0563631STom Van Eyck
587b0563631STom Van EyckNew deprecations
588b0563631STom Van Eyck   * PSA_WANT_KEY_TYPE_xxx_KEY_PAIR and
589b0563631STom Van Eyck     MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR, where xxx is either ECC or RSA,
590b0563631STom Van Eyck     are now being deprecated in favor of PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_yyy and
591b0563631STom Van Eyck     MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR_yyy. Here yyy can be: BASIC,
592b0563631STom Van Eyck     IMPORT, EXPORT, GENERATE, DERIVE. The goal is to have a finer detail about
593b0563631STom Van Eyck     the capabilities of the PSA side for either key.
594b0563631STom Van Eyck   * MBEDTLS_CIPHER_BLKSIZE_MAX is deprecated in favor of
595b0563631STom Van Eyck     MBEDTLS_MAX_BLOCK_LENGTH (if you intended what the name suggests:
596b0563631STom Van Eyck     maximum size of any supported block cipher) or the new name
597b0563631STom Van Eyck     MBEDTLS_CMAC_MAX_BLOCK_SIZE (if you intended the actual semantics:
598b0563631STom Van Eyck     maximum size of a block cipher supported by the CMAC module).
599b0563631STom Van Eyck   * mbedtls_pkcs5_pbes2() and mbedtls_pkcs12_pbe() functions are now
600b0563631STom Van Eyck     deprecated in favor of mbedtls_pkcs5_pbes2_ext() and
601b0563631STom Van Eyck     mbedtls_pkcs12_pbe_ext() as they offer more security by checking
602b0563631STom Van Eyck     for overflow of the output buffer and reporting the actual length
603b0563631STom Van Eyck     of the output.
604b0563631STom Van Eyck
605b0563631STom Van EyckFeatures
606b0563631STom Van Eyck   * All modules that use hashes or HMAC can now take advantage of PSA Crypto
607b0563631STom Van Eyck     drivers when MBEDTLS_PSA_CRYPTO_C is enabled and psa_crypto_init() has
608b0563631STom Van Eyck     been called. Previously (in 3.3), this was restricted to a few modules,
609b0563631STom Van Eyck     and only in builds where MBEDTLS_MD_C was disabled; in particular the
610b0563631STom Van Eyck     entropy module was not covered which meant an external RNG had to be
611b0563631STom Van Eyck     provided - these limitations are lifted in this version. A new set of
612b0563631STom Van Eyck     feature macros, MBEDTLS_MD_CAN_xxx, has been introduced that can be used
613b0563631STom Van Eyck     to check for availability of hash algorithms, regardless of whether
614b0563631STom Van Eyck     they're provided by a built-in implementation, a driver or both. See
615b0563631STom Van Eyck     docs/driver-only-builds.md.
616b0563631STom Van Eyck   * When a PSA driver for ECDH is present, it is now possible to disable
617b0563631STom Van Eyck     MBEDTLS_ECDH_C in the build in order to save code size. For TLS 1.2
618b0563631STom Van Eyck     key exchanges based on ECDH(E) to work, this requires
619b0563631STom Van Eyck     MBEDTLS_USE_PSA_CRYPTO. Restartable/interruptible ECDHE operations in
620b0563631STom Van Eyck     TLS 1.2 (ECDHE-ECDSA key exchange) are not supported in those builds yet,
621b0563631STom Van Eyck     as PSA does not have an API for restartable ECDH yet.
622b0563631STom Van Eyck   * When all of ECDH, ECDSA and EC J-PAKE are either disabled or provided by
623b0563631STom Van Eyck     a driver, it is possible to disable MBEDTLS_ECP_C (and MBEDTLS_BIGNUM_C
624b0563631STom Van Eyck     if not required by another module) and still get support for ECC keys and
625b0563631STom Van Eyck     algorithms in PSA, with some limitations. See docs/driver-only-builds.txt
626b0563631STom Van Eyck     for details.
627b0563631STom Van Eyck   * Add parsing of directoryName subtype for subjectAltName extension in
628b0563631STom Van Eyck     x509 certificates.
629b0563631STom Van Eyck   * Add support for server-side TLS version negotiation. If both TLS 1.2 and
630b0563631STom Van Eyck     TLS 1.3 protocols are enabled, the TLS server now selects TLS 1.2 or
631b0563631STom Van Eyck     TLS 1.3 depending on the capabilities and preferences of TLS clients.
632b0563631STom Van Eyck     Fixes #6867.
633b0563631STom Van Eyck   * X.509 hostname verification now supports IPAddress Subject Alternate Names.
634b0563631STom Van Eyck   * Add support for reading and writing X25519 and X448
635b0563631STom Van Eyck     public and private keys in RFC 8410 format using the existing PK APIs.
636b0563631STom Van Eyck   * When parsing X.509 certificates, support the extensions
637b0563631STom Van Eyck     SignatureKeyIdentifier and AuthorityKeyIdentifier.
638b0563631STom Van Eyck   * Don't include the PSA dispatch functions for PAKEs (psa_pake_setup() etc)
639b0563631STom Van Eyck     if no PAKE algorithms are requested
640b0563631STom Van Eyck   * Add support for the FFDH algorithm and DH key types in PSA, with
641b0563631STom Van Eyck     parameters from RFC 7919. This includes a built-in implementation based
642b0563631STom Van Eyck     on MBEDTLS_BIGNUM_C, and a driver dispatch layer enabling alternative
643b0563631STom Van Eyck     implementations of FFDH through the driver entry points.
644b0563631STom Van Eyck   * It is now possible to generate certificates with SubjectAltNames.
645b0563631STom Van Eyck     Currently supported subtypes: DnsName, UniformResourceIdentifier,
646b0563631STom Van Eyck     IP address, OtherName, and DirectoryName, as defined in RFC 5280.
647b0563631STom Van Eyck     See mbedtls_x509write_crt_set_subject_alternative_name for
648b0563631STom Van Eyck     more information.
649b0563631STom Van Eyck   * X.509 hostname verification now partially supports URI Subject Alternate
650b0563631STom Van Eyck     Names. Only exact matching, without any normalization procedures
651b0563631STom Van Eyck     described in 7.4 of RFC5280, will result in a positive URI verification.
652b0563631STom Van Eyck   * Add function mbedtls_oid_from_numeric_string() to parse an OID from a
653b0563631STom Van Eyck     string to a DER-encoded mbedtls_asn1_buf.
654b0563631STom Van Eyck   * Add SHA-3 family hash functions.
655b0563631STom Van Eyck   * Add support to restrict AES to 128-bit keys in order to save code size.
656b0563631STom Van Eyck     A new configuration option, MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH, can be
657b0563631STom Van Eyck     used to enable this feature.
658b0563631STom Van Eyck   * AES performance improvements. Uplift varies by platform,
659b0563631STom Van Eyck     toolchain, optimisation flags and mode.
660b0563631STom Van Eyck     Aarch64, gcc -Os and CCM, GCM and XTS benefit the most.
661b0563631STom Van Eyck     On Aarch64, uplift is typically around 20 - 110%.
662b0563631STom Van Eyck     When compiling with gcc -Os on Aarch64, AES-XTS improves
663b0563631STom Van Eyck     by 4.5x.
664b0563631STom Van Eyck   * Add support for PBKDF2-HMAC through the PSA API.
665b0563631STom Van Eyck   * New symbols PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_yyy and
666b0563631STom Van Eyck     MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR_yyy (where xxx is either ECC, RSA
667b0563631STom Van Eyck     or DH) were introduced in order to have finer accuracy in defining the
668b0563631STom Van Eyck     PSA capabilities for each key. These capabilities, named yyy above, can be
669b0563631STom Van Eyck     any of: BASIC, IMPORT, EXPORT, GENERATE, DERIVE.
670b0563631STom Van Eyck     - DERIVE is only available for ECC keys, not for RSA or DH ones.
671b0563631STom Van Eyck     - implementations are free to enable more than what it was strictly
672b0563631STom Van Eyck       requested. For example BASIC internally enables IMPORT and EXPORT
673b0563631STom Van Eyck       (useful for testing purposes), but this might change in the future.
674b0563631STom Van Eyck   * Add support for FFDH key exchange in TLS 1.3.
675b0563631STom Van Eyck     This is automatically enabled as soon as PSA_WANT_ALG_FFDH
676b0563631STom Van Eyck     and the ephemeral or psk-ephemeral key exchange mode are enabled.
677b0563631STom Van Eyck     By default, all groups are offered; the list of groups can be
678b0563631STom Van Eyck     configured using the existing API function mbedtls_ssl_conf_groups().
679b0563631STom Van Eyck   * Improve mbedtls_x509_time performance and reduce memory use.
680b0563631STom Van Eyck   * Reduce syscalls to time() during certificate verification.
681b0563631STom Van Eyck   * Allow MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE to be set by
682b0563631STom Van Eyck     setting the CMake variable of the same name at configuration time.
683b0563631STom Van Eyck   * Add getter (mbedtls_ssl_cache_get_timeout()) to access
684b0563631STom Van Eyck     `mbedtls_ssl_cache_context.timeout`.
685b0563631STom Van Eyck   * Add getter (mbedtls_ssl_get_hostname()) to access
686b0563631STom Van Eyck     `mbedtls_ssl_context.hostname`.
687b0563631STom Van Eyck   * Add getter (mbedtls_ssl_conf_get_endpoint()) to access
688b0563631STom Van Eyck     `mbedtls_ssl_config.endpoint`.
689b0563631STom Van Eyck   * Support for "opaque" (PSA-held) ECC keys in the PK module has been
690b0563631STom Van Eyck     extended: it is now possible to use mbedtls_pk_write_key_der(),
691b0563631STom Van Eyck     mbedtls_pk_write_key_pem(), mbedtls_pk_check_pair(), and
692b0563631STom Van Eyck     mbedtls_pk_verify() with opaque ECC keys (provided the PSA attributes
693b0563631STom Van Eyck     allow it).
694b0563631STom Van Eyck   * The documentation of mbedtls_ecp_group now describes the optimized
695b0563631STom Van Eyck     representation of A for some curves. Fixes #8045.
696b0563631STom Van Eyck   * Add a possibility to generate CSR's with RCF822 and directoryName subtype
697b0563631STom Van Eyck     of subjectAltName extension in x509 certificates.
698b0563631STom Van Eyck   * Add support for PBKDF2-CMAC through the PSA API.
699b0563631STom Van Eyck   * New configuration option MBEDTLS_AES_USE_HARDWARE_ONLY introduced. When
700b0563631STom Van Eyck     using CPU-accelerated AES (e.g., Arm Crypto Extensions), this option
701b0563631STom Van Eyck     disables the plain C implementation and the run-time detection for the
702b0563631STom Van Eyck     CPU feature, which reduces code size and avoids the vulnerability of the
703b0563631STom Van Eyck     plain C implementation.
704b0563631STom Van Eyck   * Accept arbitrary AttributeType and AttributeValue in certificate
705b0563631STom Van Eyck     Distinguished Names using RFC 4514 syntax.
706b0563631STom Van Eyck   * Applications using ECC over secp256r1 through the PSA API can use a
707b0563631STom Van Eyck     new implementation with a much smaller footprint, but some minor
708b0563631STom Van Eyck     usage restrictions. See the documentation of the new configuration
709b0563631STom Van Eyck     option MBEDTLS_PSA_P256M_DRIVER_ENABLED for details.
710b0563631STom Van Eyck
711b0563631STom Van EyckSecurity
712b0563631STom Van Eyck   * Fix a case where potentially sensitive information held in memory would not
713b0563631STom Van Eyck     be completely zeroized during TLS 1.2 handshake, in both server and client
714b0563631STom Van Eyck     configurations.
715b0563631STom Van Eyck   * In configurations with ARIA or Camellia but not AES, the value of
716b0563631STom Van Eyck     MBEDTLS_CIPHER_BLKSIZE_MAX was 8, rather than 16 as the name might
717b0563631STom Van Eyck     suggest. This did not affect any library code, because this macro was
718b0563631STom Van Eyck     only used in relation with CMAC which does not support these ciphers.
719b0563631STom Van Eyck     This may affect application code that uses this macro.
720b0563631STom Van Eyck   * Developers using mbedtls_pkcs5_pbes2() or mbedtls_pkcs12_pbe() should
721b0563631STom Van Eyck     review the size of the output buffer passed to this function, and note
722b0563631STom Van Eyck     that the output after decryption may include CBC padding. Consider moving
723b0563631STom Van Eyck     to the new functions mbedtls_pkcs5_pbes2_ext() or mbedtls_pkcs12_pbe_ext()
724b0563631STom Van Eyck     which checks for overflow of the output buffer and reports the actual
725b0563631STom Van Eyck     length of the output.
726b0563631STom Van Eyck   * Improve padding calculations in CBC decryption, NIST key unwrapping and
727b0563631STom Van Eyck     RSA OAEP decryption. With the previous implementation, some compilers
728b0563631STom Van Eyck     (notably recent versions of Clang and IAR) could produce non-constant
729b0563631STom Van Eyck     time code, which could allow a padding oracle attack if the attacker
730b0563631STom Van Eyck     has access to precise timing measurements.
731b0563631STom Van Eyck   * Updates to constant-time C code so that compilers are less likely to use
732b0563631STom Van Eyck     conditional instructions, which can have an observable difference in
733b0563631STom Van Eyck     timing. (Clang has been seen to do this.) Also introduce assembly
734b0563631STom Van Eyck     implementations for 32- and 64-bit Arm and for x86 and x86-64, which are
735b0563631STom Van Eyck     guaranteed not to use conditional instructions.
736b0563631STom Van Eyck   * Fix definition of MBEDTLS_MD_MAX_BLOCK_SIZE, which was too
737b0563631STom Van Eyck     small when MBEDTLS_SHA384_C was defined and MBEDTLS_SHA512_C was
738b0563631STom Van Eyck     undefined. Mbed TLS itself was unaffected by this, but user code
739b0563631STom Van Eyck     which used MBEDTLS_MD_MAX_BLOCK_SIZE could be affected. The only
740b0563631STom Van Eyck     release containing this bug was Mbed TLS 3.4.0.
741b0563631STom Van Eyck   * Fix a buffer overread when parsing short TLS application data records in
742b0563631STom Van Eyck     null-cipher cipher suites. Credit to OSS-Fuzz.
743b0563631STom Van Eyck   * Fix a remotely exploitable heap buffer overflow in TLS handshake parsing.
744b0563631STom Van Eyck     In TLS 1.3, all configurations are affected except PSK-only ones, and
745b0563631STom Van Eyck     both clients and servers are affected.
746b0563631STom Van Eyck     In TLS 1.2, the affected configurations are those with
747b0563631STom Van Eyck     MBEDTLS_USE_PSA_CRYPTO and ECDH enabled but DHM and RSA disabled,
748b0563631STom Van Eyck     and only servers are affected, not clients.
749b0563631STom Van Eyck     Credit to OSS-Fuzz.
750b0563631STom Van Eyck
751b0563631STom Van EyckBugfix
752b0563631STom Van Eyck   * Fix proper sizing for PSA_EXPORT_[KEY_PAIR/PUBLIC_KEY]_MAX_SIZE and
753b0563631STom Van Eyck     PSA_SIGNATURE_MAX_SIZE buffers when at least one accelerated EC is bigger
754b0563631STom Van Eyck     than all built-in ones and RSA is disabled.
755b0563631STom Van Eyck     Resolves #6622.
756b0563631STom Van Eyck   * Add missing md.h includes to some of the external programs from
757b0563631STom Van Eyck     the programs directory. Without this, even though the configuration
758b0563631STom Van Eyck     was sufficient for a particular program to work, it would only print
759b0563631STom Van Eyck     a message that one of the required defines is missing.
760b0563631STom Van Eyck   * Fix declaration of mbedtls_ecdsa_sign_det_restartable() function
761b0563631STom Van Eyck     in the ecdsa.h header file. There was a build warning when the
762b0563631STom Van Eyck     configuration macro MBEDTLS_ECDSA_SIGN_ALT was defined.
763b0563631STom Van Eyck     Resolves #7407.
764b0563631STom Van Eyck   * Fix an error when MBEDTLS_ECDSA_SIGN_ALT is defined but not
765b0563631STom Van Eyck     MBEDTLS_ECDSA_VERIFY_ALT, causing ecdsa verify to fail. Fixes #7498.
766b0563631STom Van Eyck   * Fix missing PSA initialization in sample programs when
767b0563631STom Van Eyck     MBEDTLS_USE_PSA_CRYPTO is enabled.
768b0563631STom Van Eyck   * Fix the J-PAKE driver interface for user and peer to accept any values
769b0563631STom Van Eyck     (previously accepted values were limited to "client" or "server").
770b0563631STom Van Eyck   * Fix clang and armclang compilation error when targeting certain Arm
771b0563631STom Van Eyck     M-class CPUs (Cortex-M0, Cortex-M0+, Cortex-M1, Cortex-M23,
772b0563631STom Van Eyck     SecurCore SC000). Fixes #1077.
773b0563631STom Van Eyck   * Fix "unterminated '#pragma clang attribute push'" in sha256/sha512.c when
774b0563631STom Van Eyck     built with MBEDTLS_SHAxxx_USE_A64_CRYPTO_IF_PRESENT but don't have a
775b0563631STom Van Eyck     way to detect the crypto extensions required. A warning is still issued.
776b0563631STom Van Eyck   * Fixed an issue that caused compile errors when using CMake and the IAR
777b0563631STom Van Eyck     toolchain.
778b0563631STom Van Eyck   * Fix very high stack usage in SSL debug code. Reported by Maximilian
779b0563631STom Van Eyck     Gerhardt in #7804.
780b0563631STom Van Eyck   * Fix a compilation failure in the constant_time module when
781b0563631STom Van Eyck     building for arm64_32 (e.g., for watchos). Reported by Paulo
782b0563631STom Van Eyck     Coutinho in #7787.
783b0563631STom Van Eyck   * Fix crypt_and_hash decryption fail when used with a stream cipher
784b0563631STom Van Eyck     mode of operation due to the input not being multiple of block size.
785b0563631STom Van Eyck     Resolves #7417.
786b0563631STom Van Eyck   * Fix a bug in which mbedtls_x509_string_to_names() would return success
787b0563631STom Van Eyck     when given a invalid name string if it did not contain '=' or ','.
788b0563631STom Van Eyck   * Fix compilation warnings in aes.c, which prevented the
789b0563631STom Van Eyck     example TF-M configuration in configs/ from building cleanly:
790b0563631STom Van Eyck     tfm_mbedcrypto_config_profile_medium.h with
791b0563631STom Van Eyck     crypto_config_profile_medium.h.
792b0563631STom Van Eyck   * In TLS 1.3, fix handshake failure when a client in its ClientHello
793b0563631STom Van Eyck     proposes an handshake based on PSK only key exchange mode or at least
794b0563631STom Van Eyck     one of the key exchange modes using ephemeral keys to a server that
795b0563631STom Van Eyck     supports only the PSK key exchange mode.
796b0563631STom Van Eyck   * Fix CCM* with no tag being not supported in a build with CCM as the only
797b0563631STom Van Eyck     symmetric encryption algorithm and the PSA configuration enabled.
798b0563631STom Van Eyck   * Fix the build with MBEDTLS_PSA_INJECT_ENTROPY. Fixes #7516.
799b0563631STom Van Eyck   * Fix a compilation error on some platforms when including mbedtls/ssl.h
800b0563631STom Van Eyck     with all TLS support disabled. Fixes #6628.
801b0563631STom Van Eyck   * Fix x509 certificate generation to conform to RFC 5480 / RFC 5758 when
802b0563631STom Van Eyck     using ECC key. The certificate was rejected by some crypto frameworks.
803b0563631STom Van Eyck     Fixes #2924.
804b0563631STom Van Eyck   * Fix a potential corruption of the passed-in IV when mbedtls_aes_crypt_cbc()
805b0563631STom Van Eyck     is called with zero length and padlock is not enabled.
806b0563631STom Van Eyck   * Fix compile failure due to empty enum in cipher_wrap.c, when building
807b0563631STom Van Eyck     with a very minimal configuration. Fixes #7625.
808b0563631STom Van Eyck   * Fix some cases where mbedtls_mpi_mod_exp, RSA key construction or ECDSA
809b0563631STom Van Eyck     signature can silently return an incorrect result in low memory conditions.
810b0563631STom Van Eyck   * Don't try to include MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE when
811b0563631STom Van Eyck     MBEDTLS_PSA_CRYPTO_CONFIG is disabled.
812b0563631STom Van Eyck   * Fix IAR compiler warnings.
813b0563631STom Van Eyck   * Fix an issue when parsing an otherName subject alternative name into a
814b0563631STom Van Eyck     mbedtls_x509_san_other_name struct. The type-id of the otherName was not
815b0563631STom Van Eyck     copied to the struct. This meant that the struct had incomplete
816b0563631STom Van Eyck     information about the otherName SAN and contained uninitialized memory.
817b0563631STom Van Eyck   * Fix the detection of HardwareModuleName otherName SANs. These were being
818b0563631STom Van Eyck     detected by comparing the wrong field and the check was erroneously
819b0563631STom Van Eyck     inverted.
820b0563631STom Van Eyck   * Fix a build error in some configurations with MBEDTLS_PSA_CRYPTO_CONFIG
821b0563631STom Van Eyck     enabled, where some low-level modules required by requested PSA crypto
822b0563631STom Van Eyck     features were not getting automatically enabled. Fixes #7420.
823b0563631STom Van Eyck   * Fix undefined symbols in some builds using TLS 1.3 with a custom
824b0563631STom Van Eyck     configuration file.
825b0563631STom Van Eyck   * Fix log level for the got supported group message. Fixes #6765
826b0563631STom Van Eyck   * Functions in the ssl_cache module now return a negative MBEDTLS_ERR_xxx
827b0563631STom Van Eyck     error code on failure. Before, they returned 1 to indicate failure in
828b0563631STom Van Eyck     some cases involving a missing entry or a full cache.
829b0563631STom Van Eyck   * mbedtls_pk_parse_key() now rejects trailing garbage in encrypted keys.
830b0563631STom Van Eyck   * Fix the build with CMake when Everest or P256-m is enabled through
831b0563631STom Van Eyck     a user configuration file or the compiler command line. Fixes #8165.
832b0563631STom Van Eyck
833b0563631STom Van EyckChanges
834b0563631STom Van Eyck   * Enable Arm / Thumb bignum assembly for most Arm platforms when
835b0563631STom Van Eyck     compiling with gcc, clang or armclang and -O0.
836b0563631STom Van Eyck   * Enforce minimum RSA key size when generating a key
837b0563631STom Van Eyck     to avoid accidental misuse.
838b0563631STom Van Eyck   * Use heap memory to allocate DER encoded RSA private key.
839b0563631STom Van Eyck     This reduces stack usage significantly for RSA signature
840b0563631STom Van Eyck     operations when MBEDTLS_PSA_CRYPTO_C is defined.
841b0563631STom Van Eyck   * Update Windows code to use BCryptGenRandom and wcslen, and
842b0563631STom Van Eyck     ensure that conversions between size_t, ULONG, and int are
843b0563631STom Van Eyck     always done safely.  Original contribution by Kevin Kane #635, #730
844b0563631STom Van Eyck     followed by Simon Butcher #1453.
845b0563631STom Van Eyck   * Users integrating their own PSA drivers should be aware that
846b0563631STom Van Eyck     the file library/psa_crypto_driver_wrappers.c has been renamed
847b0563631STom Van Eyck     to psa_crypto_driver_wrappers_no_static.c.
848b0563631STom Van Eyck   * When using CBC with the cipher module, the requirement to call
849b0563631STom Van Eyck     mbedtls_cipher_set_padding_mode() is now enforced. Previously, omitting
850b0563631STom Van Eyck     this call accidentally applied a default padding mode chosen at compile
851b0563631STom Van Eyck     time.
852b0563631STom Van Eyck
853b0563631STom Van Eyck= Mbed TLS 3.4.1 branch released 2023-08-04
854b0563631STom Van Eyck
855b0563631STom Van EyckBugfix
856b0563631STom Van Eyck   * Fix builds on Windows with clang
857b0563631STom Van Eyck
858b0563631STom Van EyckChanges
859b0563631STom Van Eyck   * Update test data to avoid failures of unit tests after 2023-08-07.
860b0563631STom Van Eyck
86132b31808SJens Wiklander= Mbed TLS 3.4.0 branch released 2023-03-28
86232b31808SJens Wiklander
86332b31808SJens WiklanderDefault behavior changes
86432b31808SJens Wiklander   * The default priority order of TLS 1.3 cipher suites has been modified to
86532b31808SJens Wiklander     follow the same rules as the TLS 1.2 cipher suites (see
86632b31808SJens Wiklander     ssl_ciphersuites.c). The preferred cipher suite is now
86732b31808SJens Wiklander     TLS_CHACHA20_POLY1305_SHA256.
86832b31808SJens Wiklander
86932b31808SJens WiklanderNew deprecations
87032b31808SJens Wiklander   * mbedtls_x509write_crt_set_serial() is now being deprecated in favor of
87132b31808SJens Wiklander     mbedtls_x509write_crt_set_serial_raw(). The goal here is to remove any
87232b31808SJens Wiklander     direct dependency of X509 on BIGNUM_C.
87332b31808SJens Wiklander   * PSA to mbedtls error translation is now unified in psa_util.h,
87432b31808SJens Wiklander     deprecating mbedtls_md_error_from_psa. Each file that performs error
87532b31808SJens Wiklander     translation should define its own version of PSA_TO_MBEDTLS_ERR,
87632b31808SJens Wiklander     optionally providing file-specific error pairs. Please see psa_util.h for
87732b31808SJens Wiklander     more details.
87832b31808SJens Wiklander
87932b31808SJens WiklanderFeatures
88032b31808SJens Wiklander   * Added partial support for parsing the PKCS #7 Cryptographic Message
88132b31808SJens Wiklander     Syntax, as defined in RFC 2315. Currently, support is limited to the
88232b31808SJens Wiklander     following:
88332b31808SJens Wiklander     - Only the signed-data content type, version 1 is supported.
88432b31808SJens Wiklander     - Only DER encoding is supported.
88532b31808SJens Wiklander     - Only a single digest algorithm per message is supported.
88632b31808SJens Wiklander     - Certificates must be in X.509 format. A message must have either 0
88732b31808SJens Wiklander       or 1 certificates.
88832b31808SJens Wiklander     - There is no support for certificate revocation lists.
88932b31808SJens Wiklander     - The authenticated and unauthenticated attribute fields of SignerInfo
89032b31808SJens Wiklander       must be empty.
89132b31808SJens Wiklander     Many thanks to Daniel Axtens, Nayna Jain, and Nick Child from IBM for
89232b31808SJens Wiklander     contributing this feature, and to Demi-Marie Obenour for contributing
89332b31808SJens Wiklander     various improvements, tests and bug fixes.
89432b31808SJens Wiklander   * General performance improvements by accessing multiple bytes at a time.
89532b31808SJens Wiklander     Fixes #1666.
89632b31808SJens Wiklander   * Improvements to use of unaligned and byte-swapped memory, reducing code
89732b31808SJens Wiklander     size and improving performance (depending on compiler and target
89832b31808SJens Wiklander     architecture).
89932b31808SJens Wiklander   * Add support for reading points in compressed format
90032b31808SJens Wiklander     (MBEDTLS_ECP_PF_COMPRESSED) with mbedtls_ecp_point_read_binary()
90132b31808SJens Wiklander     (and callers) for Short Weierstrass curves with prime p where p = 3 mod 4
90232b31808SJens Wiklander     (all mbedtls MBEDTLS_ECP_DP_SECP* and MBEDTLS_ECP_DP_BP* curves
90332b31808SJens Wiklander      except MBEDTLS_ECP_DP_SECP224R1 and MBEDTLS_ECP_DP_SECP224K1)
90432b31808SJens Wiklander   * SHA224_C/SHA384_C are now independent from SHA384_C/SHA512_C respectively.
90532b31808SJens Wiklander     This helps in saving code size when some of the above hashes are not
90632b31808SJens Wiklander     required.
90732b31808SJens Wiklander   * Add parsing of V3 extensions (key usage, Netscape cert-type,
90832b31808SJens Wiklander     Subject Alternative Names) in x509 Certificate Sign Requests.
90932b31808SJens Wiklander   * Use HOSTCC (if it is set) when compiling C code during generation of the
91032b31808SJens Wiklander     configuration-independent files. This allows them to be generated when
91132b31808SJens Wiklander     CC is set for cross compilation.
91232b31808SJens Wiklander   * Add parsing of uniformResourceIdentifier subtype for subjectAltName
91332b31808SJens Wiklander     extension in x509 certificates.
91432b31808SJens Wiklander   * Add an interruptible version of sign and verify hash to the PSA interface,
91532b31808SJens Wiklander     backed by internal library support for ECDSA signing and verification.
91632b31808SJens Wiklander   * Add parsing of rfc822Name subtype for subjectAltName
91732b31808SJens Wiklander     extension in x509 certificates.
91832b31808SJens Wiklander   * The configuration macros MBEDTLS_PSA_CRYPTO_PLATFORM_FILE and
91932b31808SJens Wiklander     MBEDTLS_PSA_CRYPTO_STRUCT_FILE specify alternative locations for
92032b31808SJens Wiklander     the headers "psa/crypto_platform.h" and "psa/crypto_struct.h".
92132b31808SJens Wiklander   * When a PSA driver for ECDSA is present, it is now possible to disable
92232b31808SJens Wiklander     MBEDTLS_ECDSA_C in the build in order to save code size. For PK, X.509
92332b31808SJens Wiklander     and TLS to fully work, this requires MBEDTLS_USE_PSA_CRYPTO to be enabled.
92432b31808SJens Wiklander     Restartable/interruptible ECDSA operations in PK, X.509 and TLS are not
92532b31808SJens Wiklander     supported in those builds yet, as driver support for interruptible ECDSA
92632b31808SJens Wiklander     operations is not present yet.
92732b31808SJens Wiklander   * Add a driver dispatch layer for EC J-PAKE, enabling alternative
92832b31808SJens Wiklander     implementations of EC J-PAKE through the driver entry points.
92932b31808SJens Wiklander   * Add new API mbedtls_ssl_cache_remove for cache entry removal by
93032b31808SJens Wiklander     its session id.
93132b31808SJens Wiklander   * Add support to include the SubjectAltName extension to a CSR.
93232b31808SJens Wiklander   * Add support for AES with the Armv8-A Cryptographic Extension on
93332b31808SJens Wiklander     64-bit Arm. A new configuration option, MBEDTLS_AESCE_C, can
93432b31808SJens Wiklander     be used to enable this feature. Run-time detection is supported
93532b31808SJens Wiklander     under Linux only.
93632b31808SJens Wiklander   * When a PSA driver for EC J-PAKE is present, it is now possible to disable
93732b31808SJens Wiklander     MBEDTLS_ECJPAKE_C in the build in order to save code size. For the
93832b31808SJens Wiklander     corresponding TLS 1.2 key exchange to work, MBEDTLS_USE_PSA_CRYPTO needs
93932b31808SJens Wiklander     to be enabled.
94032b31808SJens Wiklander   * Add functions mbedtls_rsa_get_padding_mode() and mbedtls_rsa_get_md_alg()
94132b31808SJens Wiklander     to read non-public fields for padding mode and hash id from
94232b31808SJens Wiklander     an mbedtls_rsa_context, as requested in #6917.
94332b31808SJens Wiklander   * AES-NI is now supported with Visual Studio.
94432b31808SJens Wiklander   * AES-NI is now supported in 32-bit builds, or when MBEDTLS_HAVE_ASM
94532b31808SJens Wiklander     is disabled, when compiling with GCC or Clang or a compatible compiler
94632b31808SJens Wiklander     for a target CPU that supports the requisite instructions (for example
94732b31808SJens Wiklander     gcc -m32 -msse2 -maes -mpclmul). (Generic x86 builds with GCC-like
94832b31808SJens Wiklander     compilers still require MBEDTLS_HAVE_ASM and a 64-bit target.)
94932b31808SJens Wiklander   * It is now possible to use a PSA-held (opaque) password with the TLS 1.2
95032b31808SJens Wiklander     ECJPAKE key exchange, using the new API function
95132b31808SJens Wiklander     mbedtls_ssl_set_hs_ecjpake_password_opaque().
95232b31808SJens Wiklander
95332b31808SJens WiklanderSecurity
95432b31808SJens Wiklander   * Use platform-provided secure zeroization function where possible, such as
95532b31808SJens Wiklander     explicit_bzero().
95632b31808SJens Wiklander   * Zeroize SSL cache entries when they are freed.
95732b31808SJens Wiklander   * Fix a potential heap buffer overread in TLS 1.3 client-side when
95832b31808SJens Wiklander     MBEDTLS_DEBUG_C is enabled. This may result in an application crash.
95932b31808SJens Wiklander   * Add support for AES with the Armv8-A Cryptographic Extension on 64-bit
96032b31808SJens Wiklander     Arm, so that these systems are no longer vulnerable to timing side-channel
96132b31808SJens Wiklander     attacks. This is configured by MBEDTLS_AESCE_C, which is on by default.
96232b31808SJens Wiklander     Reported by Demi Marie Obenour.
96332b31808SJens Wiklander   * MBEDTLS_AESNI_C, which is enabled by default, was silently ignored on
96432b31808SJens Wiklander     builds that couldn't compile the GCC-style assembly implementation
96532b31808SJens Wiklander     (most notably builds with Visual Studio), leaving them vulnerable to
96632b31808SJens Wiklander     timing side-channel attacks. There is now an intrinsics-based AES-NI
96732b31808SJens Wiklander     implementation as a fallback for when the assembly one cannot be used.
96832b31808SJens Wiklander
96932b31808SJens WiklanderBugfix
97032b31808SJens Wiklander   * Fix possible integer overflow in mbedtls_timing_hardclock(), which
97132b31808SJens Wiklander     could cause a crash in programs/test/benchmark.
97232b31808SJens Wiklander   * Fix IAR compiler warnings. Fixes #6924.
97332b31808SJens Wiklander   * Fix a bug in the build where directory names containing spaces were
97432b31808SJens Wiklander     causing generate_errors.pl to error out resulting in a build failure.
97532b31808SJens Wiklander     Fixes issue #6879.
97632b31808SJens Wiklander   * In TLS 1.3, when using a ticket for session resumption, tweak its age
97732b31808SJens Wiklander     calculation on the client side. It prevents a server with more accurate
97832b31808SJens Wiklander     ticket timestamps (typically timestamps in milliseconds) compared to the
97932b31808SJens Wiklander     Mbed TLS ticket timestamps (in seconds) to compute a ticket age smaller
98032b31808SJens Wiklander     than the age computed and transmitted by the client and thus potentially
98132b31808SJens Wiklander     reject the ticket. Fix #6623.
98232b31808SJens Wiklander   * Fix compile error where MBEDTLS_RSA_C and MBEDTLS_X509_CRT_WRITE_C are
98332b31808SJens Wiklander     defined, but MBEDTLS_PK_RSA_ALT_SUPPORT is not defined. Fixes #3174.
98432b31808SJens Wiklander   * List PSA_WANT_ALG_CCM_STAR_NO_TAG in psa/crypto_config.h so that it can
98532b31808SJens Wiklander     be toggled with config.py.
98632b31808SJens Wiklander   * The key derivation algorithm PSA_ALG_TLS12_ECJPAKE_TO_PMS cannot be
98732b31808SJens Wiklander     used on a shared secret from a key agreement since its input must be
98832b31808SJens Wiklander     an ECC public key. Reject this properly.
98932b31808SJens Wiklander   * mbedtls_x509write_crt_set_serial() now explicitly rejects serial numbers
99032b31808SJens Wiklander     whose binary representation is longer than 20 bytes. This was already
99132b31808SJens Wiklander     forbidden by the standard (RFC5280 - section 4.1.2.2) and now it's being
99232b31808SJens Wiklander     enforced also at code level.
99332b31808SJens Wiklander   * Fix potential undefined behavior in mbedtls_mpi_sub_abs().  Reported by
99432b31808SJens Wiklander     Pascal Cuoq using TrustInSoft Analyzer in #6701; observed independently by
99532b31808SJens Wiklander     Aaron Ucko under Valgrind.
99632b31808SJens Wiklander   * Fix behavior of certain sample programs which could, when run with no
99732b31808SJens Wiklander     arguments, access uninitialized memory in some cases. Fixes #6700 (which
99832b31808SJens Wiklander     was found by TrustInSoft Analyzer during REDOCS'22) and #1120.
99932b31808SJens Wiklander   * Fix parsing of X.509 SubjectAlternativeName extension. Previously,
100032b31808SJens Wiklander     malformed alternative name components were not caught during initial
100132b31808SJens Wiklander     certificate parsing, but only on subsequent calls to
100232b31808SJens Wiklander     mbedtls_x509_parse_subject_alt_name(). Fixes #2838.
100332b31808SJens Wiklander   * Make the fields of mbedtls_pk_rsassa_pss_options public. This makes it
100432b31808SJens Wiklander     possible to verify RSA PSS signatures with the pk module, which was
100532b31808SJens Wiklander     inadvertently broken since Mbed TLS 3.0.
100632b31808SJens Wiklander   * Fix bug in conversion from OID to string in
100732b31808SJens Wiklander     mbedtls_oid_get_numeric_string(). OIDs such as 2.40.0.25 are now printed
100832b31808SJens Wiklander     correctly.
100932b31808SJens Wiklander   * Reject OIDs with overlong-encoded subidentifiers when converting
101032b31808SJens Wiklander     them to a string.
101132b31808SJens Wiklander   * Reject OIDs with subidentifier values exceeding UINT_MAX.  Such
101232b31808SJens Wiklander     subidentifiers can be valid, but Mbed TLS cannot currently handle them.
101332b31808SJens Wiklander   * Reject OIDs that have unterminated subidentifiers, or (equivalently)
101432b31808SJens Wiklander     have the most-significant bit set in their last byte.
101532b31808SJens Wiklander   * Silence warnings from clang -Wdocumentation about empty \retval
101632b31808SJens Wiklander     descriptions, which started appearing with Clang 15. Fixes #6960.
101732b31808SJens Wiklander   * Fix the handling of renegotiation attempts in TLS 1.3. They are now
101832b31808SJens Wiklander     systematically rejected.
101932b31808SJens Wiklander   * Fix an unused-variable warning in TLS 1.3-only builds if
102032b31808SJens Wiklander     MBEDTLS_SSL_RENEGOTIATION was enabled. Fixes #6200.
102132b31808SJens Wiklander   * Fix undefined behavior in mbedtls_ssl_read() and mbedtls_ssl_write() if
102232b31808SJens Wiklander     len argument is 0 and buffer is NULL.
102332b31808SJens Wiklander   * Allow setting user and peer identifiers for EC J-PAKE operation
102432b31808SJens Wiklander     instead of role in PAKE PSA Crypto API as described in the specification.
102532b31808SJens Wiklander     This is a partial fix that allows only "client" and "server" identifiers.
102632b31808SJens Wiklander   * Fix a compilation error when PSA Crypto is built with support for
102732b31808SJens Wiklander     TLS12_PRF but not TLS12_PSK_TO_MS. Reported by joerchan in #7125.
102832b31808SJens Wiklander   * In the TLS 1.3 server, select the preferred client cipher suite, not the
102932b31808SJens Wiklander     least preferred. The selection error was introduced in Mbed TLS 3.3.0.
103032b31808SJens Wiklander   * Fix TLS 1.3 session resumption when the established pre-shared key is
103132b31808SJens Wiklander     384 bits long. That is the length of pre-shared keys created under a
103232b31808SJens Wiklander     session where the cipher suite is TLS_AES_256_GCM_SHA384.
103332b31808SJens Wiklander   * Fix an issue when compiling with MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
103432b31808SJens Wiklander     enabled, which required specifying compiler flags enabling SHA3 Crypto
103532b31808SJens Wiklander     Extensions, where some compilers would emit EOR3 instructions in other
103632b31808SJens Wiklander     modules, which would then fail if run on a CPU without the SHA3
103732b31808SJens Wiklander     extensions. Fixes #5758.
103832b31808SJens Wiklander
103932b31808SJens WiklanderChanges
104032b31808SJens Wiklander   * Install the .cmake files into CMAKE_INSTALL_LIBDIR/cmake/MbedTLS,
104132b31808SJens Wiklander     typically /usr/lib/cmake/MbedTLS.
104232b31808SJens Wiklander   * Mixed-endian systems are explicitly not supported any more.
104332b31808SJens Wiklander   * When MBEDTLS_USE_PSA_CRYPTO and MBEDTLS_ECDSA_DETERMINISTIC are both
104432b31808SJens Wiklander     defined, mbedtls_pk_sign() now use deterministic ECDSA for ECDSA
104532b31808SJens Wiklander     signatures. This aligns the behaviour with MBEDTLS_USE_PSA_CRYPTO to
104632b31808SJens Wiklander     the behaviour without it, where deterministic ECDSA was already used.
104732b31808SJens Wiklander   * Visual Studio: Rename the directory containing Visual Studio files from
104832b31808SJens Wiklander     visualc/VS2010 to visualc/VS2013 as we do not support building with versions
104932b31808SJens Wiklander     older than 2013. Update the solution file to specify VS2013 as a minimum.
105032b31808SJens Wiklander   * programs/x509/cert_write:
105132b31808SJens Wiklander     - now it accepts the serial number in 2 different formats: decimal and
105232b31808SJens Wiklander       hex. They cannot be used simultaneously
105332b31808SJens Wiklander     - "serial" is used for the decimal format and it's limted in size to
105432b31808SJens Wiklander       unsigned long long int
105532b31808SJens Wiklander     - "serial_hex" is used for the hex format; max length here is
105632b31808SJens Wiklander       MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN*2
105732b31808SJens Wiklander   * The C code follows a new coding style. This is transparent for users but
105832b31808SJens Wiklander     affects contributors and maintainers of local patches. For more
105932b31808SJens Wiklander     information, see
106032b31808SJens Wiklander     https://mbed-tls.readthedocs.io/en/latest/kb/how-to/rewrite-branch-for-coding-style/
106132b31808SJens Wiklander   * Changed the default MBEDTLS_ECP_WINDOW_SIZE from 6 to 2.
106232b31808SJens Wiklander     As tested in issue 6790, the correlation between this define and
106332b31808SJens Wiklander     RSA decryption performance has changed lately due to security fixes.
106432b31808SJens Wiklander     To fix the performance degradation when using default values the
106532b31808SJens Wiklander     window was reduced from 6 to 2, a value that gives the best or close
106632b31808SJens Wiklander     to best results when tested on Cortex-M4 and Intel i7.
106732b31808SJens Wiklander   * When enabling MBEDTLS_SHA256_USE_A64_CRYPTO_* or
106832b31808SJens Wiklander     MBEDTLS_SHA512_USE_A64_CRYPTO_*, it is no longer necessary to specify
106932b31808SJens Wiklander     compiler target flags on the command line; the library now sets target
107032b31808SJens Wiklander     options within the appropriate modules.
107132b31808SJens Wiklander
107232b31808SJens Wiklander= Mbed TLS 3.3.0 branch released 2022-12-14
107332b31808SJens Wiklander
107432b31808SJens WiklanderDefault behavior changes
107532b31808SJens Wiklander   * Previously the macro MBEDTLS_SSL_DTLS_CONNECTION_ID implemented version 05
107632b31808SJens Wiklander     of the IETF draft, and was marked experimental and disabled by default.
107732b31808SJens Wiklander     It is now no longer experimental, and implements the final version from
107832b31808SJens Wiklander     RFC 9146, which is not interoperable with the draft-05 version.
107932b31808SJens Wiklander     If you need to communicate with peers that use earlier versions of
108032b31808SJens Wiklander     Mbed TLS, then you need to define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
108132b31808SJens Wiklander     to 1, but then you won't be able to communicate with peers that use the
108232b31808SJens Wiklander     standard (non-draft) version.
108332b31808SJens Wiklander     If you need to interoperate with both classes of peers with the
108432b31808SJens Wiklander     same build of Mbed TLS, please let us know about your situation on the
108532b31808SJens Wiklander     mailing list or GitHub.
108632b31808SJens Wiklander
108732b31808SJens WiklanderRequirement changes
108832b31808SJens Wiklander   * When building with PSA drivers using generate_driver_wrappers.py, or
108932b31808SJens Wiklander     when building the library from the development branch rather than
109032b31808SJens Wiklander     from a release, the Python module jsonschema is now necessary, in
109132b31808SJens Wiklander     addition to jinja2. The official list of required Python modules is
109232b31808SJens Wiklander     maintained in scripts/basic.requirements.txt and may change again
109332b31808SJens Wiklander     in the future.
109432b31808SJens Wiklander
109532b31808SJens WiklanderNew deprecations
109632b31808SJens Wiklander   * Deprecate mbedtls_asn1_free_named_data().
109732b31808SJens Wiklander     Use mbedtls_asn1_free_named_data_list()
109832b31808SJens Wiklander     or mbedtls_asn1_free_named_data_list_shallow().
109932b31808SJens Wiklander
110032b31808SJens WiklanderFeatures
110132b31808SJens Wiklander   * Support rsa_pss_rsae_* signature algorithms in TLS 1.2.
110232b31808SJens Wiklander   * make: enable building unversioned shared library, with e.g.:
110332b31808SJens Wiklander     "SHARED=1 SOEXT_TLS=so SOEXT_X509=so SOEXT_CRYPTO=so make lib"
110432b31808SJens Wiklander     resulting in library names like "libmbedtls.so" rather than
110532b31808SJens Wiklander     "libmbedcrypto.so.11".
110632b31808SJens Wiklander   * Expose the EC J-PAKE functionality through the Draft PSA PAKE Crypto API.
110732b31808SJens Wiklander     Only the ECC primitive with secp256r1 curve and SHA-256 hash algorithm
110832b31808SJens Wiklander     are supported in this implementation.
110932b31808SJens Wiklander   * Some modules can now use PSA drivers for hashes, including with no
111032b31808SJens Wiklander     built-in implementation present, but only in some configurations.
111132b31808SJens Wiklander     - RSA OAEP and PSS (PKCS#1 v2.1), PKCS5, PKCS12 and EC J-PAKE now use
111232b31808SJens Wiklander       hashes from PSA when (and only when) MBEDTLS_MD_C is disabled.
111332b31808SJens Wiklander     - PEM parsing of encrypted files now uses MD-5 from PSA when (and only
111432b31808SJens Wiklander       when) MBEDTLS_MD5_C is disabled.
111532b31808SJens Wiklander     See the documentation of the corresponding macros in mbedtls_config.h for
111632b31808SJens Wiklander     details.
111732b31808SJens Wiklander     Note that some modules are not able to use hashes from PSA yet, including
111832b31808SJens Wiklander     the entropy module. As a consequence, for now the only way to build with
111932b31808SJens Wiklander     all hashes only provided by drivers (no built-in hash) is to use
112032b31808SJens Wiklander     MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG.
112132b31808SJens Wiklander   * When MBEDTLS_USE_PSA_CRYPTO is enabled, X.509, TLS 1.2 and TLS 1.3 now
112232b31808SJens Wiklander     properly negotiate/accept hashes based on their availability in PSA.
112332b31808SJens Wiklander     As a consequence, they now work in configurations where the built-in
112432b31808SJens Wiklander     implementations of (some) hashes are excluded and those hashes are only
112532b31808SJens Wiklander     provided by PSA drivers. (See previous entry for limitation on RSA-PSS
112632b31808SJens Wiklander     though: that module only use hashes from PSA when MBEDTLS_MD_C is off).
112732b31808SJens Wiklander   * Add support for opaque keys as the private keys associated to certificates
112832b31808SJens Wiklander     for authentication in TLS 1.3.
112932b31808SJens Wiklander   * Add the LMS post-quantum-safe stateful-hash asymmetric signature scheme.
113032b31808SJens Wiklander     Signature verification is production-ready, but generation is for testing
113132b31808SJens Wiklander     purposes only. This currently only supports one parameter set
113232b31808SJens Wiklander     (LMS_SHA256_M32_H10), meaning that each private key can be used to sign
113332b31808SJens Wiklander     1024 messages. As such, it is not intended for use in TLS, but instead
113432b31808SJens Wiklander     for verification of assets transmitted over an insecure channel,
113532b31808SJens Wiklander     particularly firmware images.
113632b31808SJens Wiklander   * Add the LM-OTS post-quantum-safe one-time signature scheme, which is
113732b31808SJens Wiklander     required for LMS. This can be used independently, but each key can only
113832b31808SJens Wiklander     be used to sign one message so is impractical for most circumstances.
113932b31808SJens Wiklander   * Mbed TLS now supports TLS 1.3 key establishment via pre-shared keys.
114032b31808SJens Wiklander     The pre-shared keys can be provisioned externally or via the ticket
114132b31808SJens Wiklander     mechanism (session resumption).
114232b31808SJens Wiklander     The ticket mechanism is supported when the configuration option
114332b31808SJens Wiklander     MBEDTLS_SSL_SESSION_TICKETS is enabled.
114432b31808SJens Wiklander     New options MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_xxx_ENABLED
114532b31808SJens Wiklander     control the support for the three possible TLS 1.3 key exchange modes.
114632b31808SJens Wiklander   * cert_write: support for setting extended key usage attributes. A
114732b31808SJens Wiklander     corresponding new public API call has been added in the library,
114832b31808SJens Wiklander     mbedtls_x509write_crt_set_ext_key_usage().
114932b31808SJens Wiklander   * cert_write: support for writing certificate files in either PEM
115032b31808SJens Wiklander     or DER format.
115132b31808SJens Wiklander   * The PSA driver wrapper generator generate_driver_wrappers.py now
115232b31808SJens Wiklander     supports a subset of the driver description language, including
115332b31808SJens Wiklander     the following entry points: import_key, export_key, export_public_key,
115432b31808SJens Wiklander     get_builtin_key, copy_key.
115532b31808SJens Wiklander   * The new functions mbedtls_asn1_free_named_data_list() and
115632b31808SJens Wiklander     mbedtls_asn1_free_named_data_list_shallow() simplify the management
115732b31808SJens Wiklander     of memory in named data lists in X.509 structures.
115832b31808SJens Wiklander   * The TLS 1.2 EC J-PAKE key exchange can now use the PSA Crypto API.
115932b31808SJens Wiklander     Additional PSA key slots will be allocated in the process of such key
116032b31808SJens Wiklander     exchange for builds that enable MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED and
116132b31808SJens Wiklander     MBEDTLS_USE_PSA_CRYPTO.
116232b31808SJens Wiklander   * Add support for DTLS Connection ID as defined by RFC 9146, controlled by
116332b31808SJens Wiklander     MBEDTLS_SSL_DTLS_CONNECTION_ID (enabled by default) and configured with
116432b31808SJens Wiklander     mbedtls_ssl_set_cid().
116532b31808SJens Wiklander   * Add a driver dispatch layer for raw key agreement, enabling alternative
116632b31808SJens Wiklander     implementations of raw key agreement through the key_agreement driver
116732b31808SJens Wiklander     entry point. This entry point is specified in the proposed PSA driver
116832b31808SJens Wiklander     interface, but had not yet been implemented.
116932b31808SJens Wiklander   * Add an ad-hoc key derivation function handling EC J-PAKE to PMS
117032b31808SJens Wiklander     calculation that can be used to derive the session secret in TLS 1.2,
117132b31808SJens Wiklander     as described in draft-cragie-tls-ecjpake-01. This can be achieved by
117232b31808SJens Wiklander     using PSA_ALG_TLS12_ECJPAKE_TO_PMS as the key derivation algorithm.
117332b31808SJens Wiklander
117432b31808SJens WiklanderSecurity
117532b31808SJens Wiklander   * Fix potential heap buffer overread and overwrite in DTLS if
117632b31808SJens Wiklander     MBEDTLS_SSL_DTLS_CONNECTION_ID is enabled and
117732b31808SJens Wiklander     MBEDTLS_SSL_CID_IN_LEN_MAX > 2 * MBEDTLS_SSL_CID_OUT_LEN_MAX.
117832b31808SJens Wiklander   * Fix an issue where an adversary with access to precise enough information
117932b31808SJens Wiklander     about memory accesses (typically, an untrusted operating system attacking
118032b31808SJens Wiklander     a secure enclave) could recover an RSA private key after observing the
118132b31808SJens Wiklander     victim performing a single private-key operation if the window size used
118232b31808SJens Wiklander     for the exponentiation was 3 or smaller. Found and reported by Zili KOU,
118332b31808SJens Wiklander     Wenjian HE, Sharad Sinha, and Wei ZHANG. See "Cache Side-channel Attacks
118432b31808SJens Wiklander     and Defenses of the Sliding Window Algorithm in TEEs" - Design, Automation
118532b31808SJens Wiklander     and Test in Europe 2023.
118632b31808SJens Wiklander
118732b31808SJens WiklanderBugfix
118832b31808SJens Wiklander   * Refactor mbedtls_aes_context to support shallow-copying. Fixes #2147.
118932b31808SJens Wiklander   * Fix an issue with in-tree CMake builds in releases with GEN_FILES
119032b31808SJens Wiklander     turned off: if a shipped file was missing from the working directory,
119132b31808SJens Wiklander     it could be turned into a symbolic link to itself.
119232b31808SJens Wiklander   * Fix a long-standing build failure when building x86 PIC code with old
119332b31808SJens Wiklander     gcc (4.x). The code will be slower, but will compile. We do however
119432b31808SJens Wiklander     recommend upgrading to a more recent compiler instead. Fixes #1910.
119532b31808SJens Wiklander   * Fix support for little-endian Microblaze when MBEDTLS_HAVE_ASM is defined.
119632b31808SJens Wiklander     Contributed by Kazuyuki Kimura to fix #2020.
119732b31808SJens Wiklander   * Use double quotes to include private header file psa_crypto_cipher.h.
119832b31808SJens Wiklander     Fixes 'file not found with <angled> include' error
119932b31808SJens Wiklander     when building with Xcode.
120032b31808SJens Wiklander   * Fix handling of broken symlinks when loading certificates using
120132b31808SJens Wiklander     mbedtls_x509_crt_parse_path(). Instead of returning an error as soon as a
120232b31808SJens Wiklander     broken link is encountered, skip the broken link and continue parsing
120332b31808SJens Wiklander     other certificate files. Contributed by Eduardo Silva in #2602.
120432b31808SJens Wiklander   * Fix an interoperability failure between an Mbed TLS client with both
120532b31808SJens Wiklander     TLS 1.2 and TLS 1.3 support, and a TLS 1.2 server that supports
120632b31808SJens Wiklander     rsa_pss_rsae_* signature algorithms. This failed because Mbed TLS
120732b31808SJens Wiklander     advertised support for PSS in both TLS 1.2 and 1.3, but only
120832b31808SJens Wiklander     actually supported PSS in TLS 1.3.
120932b31808SJens Wiklander   * Fix a compilation error when using CMake with an IAR toolchain.
121032b31808SJens Wiklander     Fixes #5964.
121132b31808SJens Wiklander   * Fix a build error due to a missing prototype warning when
121232b31808SJens Wiklander     MBEDTLS_DEPRECATED_REMOVED is enabled.
121332b31808SJens Wiklander   * Fix mbedtls_ctr_drbg_free() on an initialized but unseeded context. When
121432b31808SJens Wiklander     MBEDTLS_AES_ALT is enabled, it could call mbedtls_aes_free() on an
121532b31808SJens Wiklander     uninitialized context.
121632b31808SJens Wiklander   * Fix a build issue on Windows using CMake where the source and build
121732b31808SJens Wiklander     directories could not be on different drives. Fixes #5751.
121832b31808SJens Wiklander   * Fix bugs and missing dependencies when building and testing
121932b31808SJens Wiklander     configurations with only one encryption type enabled in TLS 1.2.
122032b31808SJens Wiklander   * Provide the missing definition of mbedtls_setbuf() in some configurations
122132b31808SJens Wiklander     with MBEDTLS_PLATFORM_C disabled. Fixes #6118, #6196.
122232b31808SJens Wiklander   * Fix compilation errors when trying to build with
122332b31808SJens Wiklander     PSA drivers for AEAD (GCM, CCM, Chacha20-Poly1305).
122432b31808SJens Wiklander   * Fix memory leak in ssl_parse_certificate_request() caused by
122532b31808SJens Wiklander     mbedtls_x509_get_name() not freeing allocated objects in case of error.
122632b31808SJens Wiklander     Change mbedtls_x509_get_name() to clean up allocated objects on error.
122732b31808SJens Wiklander   * Fix build failure with MBEDTLS_RSA_C and MBEDTLS_PSA_CRYPTO_C but not
122832b31808SJens Wiklander     MBEDTLS_USE_PSA_CRYPTO or MBEDTLS_PK_WRITE_C. Fixes #6408.
122932b31808SJens Wiklander   * Fix build failure with MBEDTLS_RSA_C and MBEDTLS_PSA_CRYPTO_C but not
123032b31808SJens Wiklander     MBEDTLS_PK_PARSE_C. Fixes #6409.
123132b31808SJens Wiklander   * Fix ECDSA verification, where it was not always validating the
123232b31808SJens Wiklander     public key. This bug meant that it was possible to verify a
123332b31808SJens Wiklander     signature with an invalid public key, in some cases. Reported by
123432b31808SJens Wiklander     Guido Vranken using Cryptofuzz in #4420.
123532b31808SJens Wiklander   * Fix a possible null pointer dereference if a memory allocation fails
123632b31808SJens Wiklander     in TLS PRF code. Reported by Michael Madsen in #6516.
123732b31808SJens Wiklander   * Fix TLS 1.3 session resumption. Fixes #6488.
123832b31808SJens Wiklander   * Add a configuration check to exclude optional client authentication
123932b31808SJens Wiklander     in TLS 1.3 (where it is forbidden).
124032b31808SJens Wiklander   * Fix a bug in which mbedtls_x509_crt_info() would produce non-printable
124132b31808SJens Wiklander     bytes when parsing certificates containing a binary RFC 4108
124232b31808SJens Wiklander     HardwareModuleName as a Subject Alternative Name extension. Hardware
124332b31808SJens Wiklander     serial numbers are now rendered in hex format. Fixes #6262.
124432b31808SJens Wiklander   * Fix bug in error reporting in dh_genprime.c where upon failure,
124532b31808SJens Wiklander     the error code returned by mbedtls_mpi_write_file() is overwritten
124632b31808SJens Wiklander     and therefore not printed.
124732b31808SJens Wiklander   * In the bignum module, operations of the form (-A) - (+A) or (-A) - (-A)
124832b31808SJens Wiklander     with A > 0 created an unintended representation of the value 0 which was
124932b31808SJens Wiklander     not processed correctly by some bignum operations. Fix this. This had no
125032b31808SJens Wiklander     consequence on cryptography code, but might affect applications that call
125132b31808SJens Wiklander     bignum directly and use negative numbers.
125232b31808SJens Wiklander   * Fix a bug whereby the list of signature algorithms sent as part of
125332b31808SJens Wiklander     the TLS 1.2 server certificate request would get corrupted, meaning the
125432b31808SJens Wiklander     first algorithm would not get sent and an entry consisting of two random
125532b31808SJens Wiklander     bytes would be sent instead. Found by Serban Bejan and Dudek Sebastian.
125632b31808SJens Wiklander   * Fix undefined behavior (typically harmless in practice) of
125732b31808SJens Wiklander     mbedtls_mpi_add_mpi(), mbedtls_mpi_add_abs() and mbedtls_mpi_add_int()
125832b31808SJens Wiklander     when both operands are 0 and the left operand is represented with 0 limbs.
125932b31808SJens Wiklander   * Fix undefined behavior (typically harmless in practice) when some bignum
126032b31808SJens Wiklander     functions receive the most negative value of mbedtls_mpi_sint. Credit
126132b31808SJens Wiklander     to OSS-Fuzz. Fixes #6597.
126232b31808SJens Wiklander   * Fix undefined behavior (typically harmless in practice) in PSA ECB
126332b31808SJens Wiklander     encryption and decryption.
126432b31808SJens Wiklander   * Move some SSL-specific code out of libmbedcrypto where it had been placed
126532b31808SJens Wiklander     accidentally.
126632b31808SJens Wiklander   * Fix a build error when compiling the bignum module for some Arm platforms.
126732b31808SJens Wiklander     Fixes #6089, #6124, #6217.
126832b31808SJens Wiklander
126932b31808SJens WiklanderChanges
127032b31808SJens Wiklander   * Add the ability to query PSA_WANT_xxx macros to query_compile_time_config.
127132b31808SJens Wiklander   * Calling AEAD tag-specific functions for non-AEAD algorithms (which
127232b31808SJens Wiklander     should not be done - they are documented for use only by AES-GCM and
127332b31808SJens Wiklander     ChaCha20+Poly1305) now returns MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE
127432b31808SJens Wiklander     instead of success (0).
127532b31808SJens Wiklander
127632b31808SJens Wiklander= Mbed TLS 3.2.1 branch released 2022-07-12
127732b31808SJens Wiklander
127832b31808SJens WiklanderBugfix
127932b31808SJens Wiklander   *  Re-add missing generated file library/psa_crypto_driver_wrappers.c
128032b31808SJens Wiklander
128132b31808SJens Wiklander= Mbed TLS 3.2.0 branch released 2022-07-11
1282039e02dfSJerome Forissier
1283039e02dfSJerome ForissierDefault behavior changes
1284039e02dfSJerome Forissier   * mbedtls_cipher_set_iv will now fail with ChaCha20 and ChaCha20+Poly1305
1285039e02dfSJerome Forissier     for IV lengths other than 12. The library was silently overwriting this
1286039e02dfSJerome Forissier     length with 12, but did not inform the caller about it. Fixes #4301.
1287039e02dfSJerome Forissier
128832b31808SJens WiklanderRequirement changes
128932b31808SJens Wiklander   * The library will no longer compile out of the box on a platform without
129032b31808SJens Wiklander     setbuf(). If your platform does not have setbuf(), you can configure an
129132b31808SJens Wiklander     alternative function by enabling MBEDTLS_PLATFORM_SETBUF_ALT or
129232b31808SJens Wiklander     MBEDTLS_PLATFORM_SETBUF_MACRO.
129332b31808SJens Wiklander
129432b31808SJens WiklanderNew deprecations
129532b31808SJens Wiklander   * Deprecate mbedtls_ssl_conf_max_version() and
129632b31808SJens Wiklander     mbedtls_ssl_conf_min_version() in favor of
129732b31808SJens Wiklander     mbedtls_ssl_conf_max_tls_version() and
129832b31808SJens Wiklander     mbedtls_ssl_conf_min_tls_version().
129932b31808SJens Wiklander   * Deprecate mbedtls_cipher_setup_psa(). Use psa_aead_xxx() or
130032b31808SJens Wiklander     psa_cipher_xxx() directly instead.
130132b31808SJens Wiklander   * Secure element drivers enabled by MBEDTLS_PSA_CRYPTO_SE_C are deprecated.
130232b31808SJens Wiklander     This was intended as an experimental feature, but had not been explicitly
130332b31808SJens Wiklander     documented as such. Use opaque drivers with the interface enabled by
130432b31808SJens Wiklander     MBEDTLS_PSA_CRYPTO_DRIVERS instead.
130532b31808SJens Wiklander   * Deprecate mbedtls_ssl_conf_sig_hashes() in favor of the more generic
130632b31808SJens Wiklander     mbedtls_ssl_conf_sig_algs(). Signature algorithms for the TLS 1.2 and
130732b31808SJens Wiklander     TLS 1.3 handshake should now be configured with
130832b31808SJens Wiklander     mbedtls_ssl_conf_sig_algs().
130932b31808SJens Wiklander
1310039e02dfSJerome ForissierFeatures
131132b31808SJens Wiklander   * Add accessor to obtain ciphersuite id from ssl context.
131232b31808SJens Wiklander   * Add accessors to get members from ciphersuite info.
131332b31808SJens Wiklander   * Add mbedtls_ssl_ticket_rotate() for external ticket rotation.
131432b31808SJens Wiklander   * Add accessor to get the raw buffer pointer from a PEM context.
131532b31808SJens Wiklander   * The structures mbedtls_ssl_config and mbedtls_ssl_context now store
131632b31808SJens Wiklander     a piece of user data which is reserved for the application. The user
131732b31808SJens Wiklander     data can be either a pointer or an integer.
131832b31808SJens Wiklander   * Add an accessor function to get the configuration associated with
131932b31808SJens Wiklander     an SSL context.
132032b31808SJens Wiklander   * Add a function to access the protocol version from an SSL context in a
132132b31808SJens Wiklander     form that's easy to compare. Fixes #5407.
132232b31808SJens Wiklander   * Add function mbedtls_md_info_from_ctx() to recall the message digest
132332b31808SJens Wiklander     information that was used to set up a message digest context.
132432b31808SJens Wiklander   * Add ALPN support in TLS 1.3 clients.
132532b31808SJens Wiklander   * Add server certificate selection callback near end of Client Hello.
132632b31808SJens Wiklander     Register callback with mbedtls_ssl_conf_cert_cb().
132732b31808SJens Wiklander   * Provide mechanism to reset handshake cert list by calling
132832b31808SJens Wiklander     mbedtls_ssl_set_hs_own_cert() with NULL value for own_cert param.
132932b31808SJens Wiklander   * Add accessor mbedtls_ssl_get_hs_sni() to retrieve SNI from within
133032b31808SJens Wiklander     cert callback (mbedtls_ssl_conf_cert_cb()) during handshake.
133132b31808SJens Wiklander   * The X.509 module now uses PSA hash acceleration if present.
133232b31808SJens Wiklander   * Add support for psa crypto key derivation for elliptic curve
133332b31808SJens Wiklander     keys. Fixes #3260.
133432b31808SJens Wiklander   * Add function mbedtls_timing_get_final_delay() to access the private
133532b31808SJens Wiklander     final delay field in an mbedtls_timing_delay_context, as requested in
133632b31808SJens Wiklander     #5183.
133732b31808SJens Wiklander    * Add mbedtls_pk_sign_ext() which allows generating RSA-PSS signatures when
133832b31808SJens Wiklander      PSA Crypto is enabled.
133932b31808SJens Wiklander   * Add function mbedtls_ecp_export() to export ECP key pair parameters.
134032b31808SJens Wiklander     Fixes #4838.
134132b31808SJens Wiklander   * Add function mbedtls_ssl_is_handshake_over() to enable querying if the SSL
134232b31808SJens Wiklander     Handshake has completed or not, and thus whether to continue calling
134332b31808SJens Wiklander     mbedtls_ssl_handshake_step(), requested in #4383.
134432b31808SJens Wiklander   * Add the function mbedtls_ssl_get_own_cid() to access our own connection id
134532b31808SJens Wiklander     within mbedtls_ssl_context, as requested in #5184.
134632b31808SJens Wiklander   * Introduce mbedtls_ssl_hs_cb_t typedef for use with
134732b31808SJens Wiklander     mbedtls_ssl_conf_cert_cb() and perhaps future callbacks
134832b31808SJens Wiklander     during TLS handshake.
134932b31808SJens Wiklander   * Add functions mbedtls_ssl_conf_max_tls_version() and
135032b31808SJens Wiklander     mbedtls_ssl_conf_min_tls_version() that use a single value to specify
135132b31808SJens Wiklander     the protocol version.
135232b31808SJens Wiklander    * Extend the existing PSA_ALG_TLS12_PSK_TO_MS() algorithm to support
135332b31808SJens Wiklander      mixed-PSK. Add an optional input PSA_KEY_DERIVATION_INPUT_OTHER_SECRET
135432b31808SJens Wiklander      holding the other secret.
1355039e02dfSJerome Forissier   * When MBEDTLS_PSA_CRYPTO_CONFIG is enabled, you may list the PSA crypto
1356039e02dfSJerome Forissier     feature requirements in the file named by the new macro
1357039e02dfSJerome Forissier     MBEDTLS_PSA_CRYPTO_CONFIG_FILE instead of the default psa/crypto_config.h.
1358039e02dfSJerome Forissier     Furthermore you may name an additional file to include after the main
1359039e02dfSJerome Forissier     file with the macro MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE.
136032b31808SJens Wiklander   * Add the function mbedtls_x509_crt_has_ext_type() to access the ext types
136132b31808SJens Wiklander     field within mbedtls_x509_crt context, as requested in #5585.
136232b31808SJens Wiklander   * Add HKDF-Expand and HKDF-Extract as separate algorithms in the PSA API.
136332b31808SJens Wiklander   * Add support for the ARMv8 SHA-2 acceleration instructions when building
136432b31808SJens Wiklander     for Aarch64.
136532b31808SJens Wiklander   * Add support for authentication of TLS 1.3 clients by TLS 1.3 servers.
136632b31808SJens Wiklander   * Add support for server HelloRetryRequest message. The TLS 1.3 client is
136732b31808SJens Wiklander     now capable of negotiating another shared secret if the one sent in its
136832b31808SJens Wiklander     first ClientHello was not suitable to the server.
136932b31808SJens Wiklander   * Add support for client-side TLS version negotiation. If both TLS 1.2 and
137032b31808SJens Wiklander     TLS 1.3 protocols are enabled in the build of Mbed TLS, the TLS client now
137132b31808SJens Wiklander     negotiates TLS 1.3 or TLS 1.2 with TLS servers.
137232b31808SJens Wiklander   * Enable building of Mbed TLS with TLS 1.3 protocol support but without TLS
137332b31808SJens Wiklander     1.2 protocol support.
137432b31808SJens Wiklander   * Mbed TLS provides an implementation of a TLS 1.3 server (ephemeral key
137532b31808SJens Wiklander     establishment only). See docs/architecture/tls13-support.md for a
137632b31808SJens Wiklander     description of the support. The MBEDTLS_SSL_PROTO_TLS1_3 and
137732b31808SJens Wiklander     MBEDTLS_SSL_SRV_C configuration options control this.
137832b31808SJens Wiklander   * Add accessors to configure DN hints for certificate request:
137932b31808SJens Wiklander     mbedtls_ssl_conf_dn_hints() and mbedtls_ssl_set_hs_dn_hints()
138032b31808SJens Wiklander   * The configuration option MBEDTLS_USE_PSA_CRYPTO, which previously
138132b31808SJens Wiklander     affected only a limited subset of crypto operations in TLS, X.509 and PK,
138232b31808SJens Wiklander     now causes most of them to be done using PSA Crypto; see
138332b31808SJens Wiklander     docs/use-psa-crypto.md for the list of exceptions.
138432b31808SJens Wiklander   * The function mbedtls_pk_setup_opaque() now supports RSA key pairs as well.
138532b31808SJens Wiklander     Opaque keys can now be used everywhere a private key is expected in the
138632b31808SJens Wiklander     TLS and X.509 modules.
138732b31808SJens Wiklander   * Opaque pre-shared keys for TLS, provisioned with
138832b31808SJens Wiklander     mbedtls_ssl_conf_psk_opaque() or mbedtls_ssl_set_hs_psk_opaque(), which
138932b31808SJens Wiklander     previously only worked for "pure" PSK key exchange, now can also be used
139032b31808SJens Wiklander     for the "mixed" PSK key exchanges as well: ECDHE-PSK, DHE-PSK, RSA-PSK.
139132b31808SJens Wiklander   * cmake now detects if it is being built as a sub-project, and in that case
139232b31808SJens Wiklander     disables the target export/installation and package configuration.
139332b31808SJens Wiklander   * Make USE_PSA_CRYPTO compatible with KEY_ID_ENCODES_OWNER. Fixes #5259.
139432b31808SJens Wiklander   * Add example programs cipher_aead_demo.c, md_hmac_demo.c, aead_demo.c
139532b31808SJens Wiklander     and hmac_demo.c, which use PSA and the md/cipher interfaces side
139632b31808SJens Wiklander     by side in order to illustrate how the operation is performed in PSA.
139732b31808SJens Wiklander     Addresses #5208.
1398039e02dfSJerome Forissier
1399039e02dfSJerome ForissierSecurity
1400039e02dfSJerome Forissier   * Zeroize dynamically-allocated buffers used by the PSA Crypto key storage
1401039e02dfSJerome Forissier     module before freeing them. These buffers contain secret key material, and
1402039e02dfSJerome Forissier     could thus potentially leak the key through freed heap.
140332b31808SJens Wiklander   * Fix potential memory leak inside mbedtls_ssl_cache_set() with
140432b31808SJens Wiklander     an invalid session id length.
140532b31808SJens Wiklander   * Add the platform function mbedtls_setbuf() to allow buffering to be
140632b31808SJens Wiklander     disabled on stdio files, to stop secrets loaded from said files being
140732b31808SJens Wiklander     potentially left in memory after file operations. Reported by
140832b31808SJens Wiklander     Glenn Strauss.
1409039e02dfSJerome Forissier   * Fix a potential heap buffer overread in TLS 1.2 server-side when
1410039e02dfSJerome Forissier     MBEDTLS_USE_PSA_CRYPTO is enabled, an opaque key (created with
1411039e02dfSJerome Forissier     mbedtls_pk_setup_opaque()) is provisioned, and a static ECDH ciphersuite
1412039e02dfSJerome Forissier     is selected. This may result in an application crash or potentially an
1413039e02dfSJerome Forissier     information leak.
1414039e02dfSJerome Forissier   * Fix a buffer overread in DTLS ClientHello parsing in servers with
1415039e02dfSJerome Forissier     MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE enabled. An unauthenticated client
1416039e02dfSJerome Forissier     or a man-in-the-middle could cause a DTLS server to read up to 255 bytes
1417039e02dfSJerome Forissier     after the end of the SSL input buffer. The buffer overread only happens
1418039e02dfSJerome Forissier     when MBEDTLS_SSL_IN_CONTENT_LEN is less than a threshold that depends on
1419039e02dfSJerome Forissier     the exact configuration: 258 bytes if using mbedtls_ssl_cookie_check(),
1420039e02dfSJerome Forissier     and possibly up to 571 bytes with a custom cookie check function.
1421039e02dfSJerome Forissier     Reported by the Cybeats PSI Team.
142232b31808SJens Wiklander    * Fix a buffer overread in TLS 1.3 Certificate parsing. An unauthenticated
142332b31808SJens Wiklander      client or server could cause an MbedTLS server or client to overread up
142432b31808SJens Wiklander      to 64 kBytes of data and potentially overread the input buffer by that
142532b31808SJens Wiklander      amount minus the size of the input buffer. As overread data undergoes
142632b31808SJens Wiklander      various checks, the likelihood of reaching the boundary of the input
142732b31808SJens Wiklander      buffer is rather small but increases as its size
142832b31808SJens Wiklander      MBEDTLS_SSL_IN_CONTENT_LEN decreases.
142932b31808SJens Wiklander   * Fix check of certificate key usage in TLS 1.3. The usage of the public key
143032b31808SJens Wiklander     provided by a client or server certificate for authentication was not
143132b31808SJens Wiklander     checked properly when validating the certificate. This could cause a
143232b31808SJens Wiklander     client or server to be able to authenticate itself through a certificate
143332b31808SJens Wiklander     to an Mbed TLS TLS 1.3 server or client while it does not own a proper
143432b31808SJens Wiklander     certificate to do so.
1435039e02dfSJerome Forissier
1436039e02dfSJerome ForissierBugfix
143732b31808SJens Wiklander   * Declare or use PSA_WANT_ALG_CCM_STAR_NO_TAG following the general
143832b31808SJens Wiklander     pattern for PSA_WANT_xxx symbols. Previously you had to specify
143932b31808SJens Wiklander     PSA_WANT_ALG_CCM for PSA_ALG_CCM_STAR_NO_TAG.
1440039e02dfSJerome Forissier   * Fix a memory leak if mbedtls_ssl_config_defaults() is called twice.
144132b31808SJens Wiklander   * Fixed swap of client and server random bytes when exporting them alongside
144232b31808SJens Wiklander     TLS 1.3 handshake and application traffic secret.
1443039e02dfSJerome Forissier   * Fix several bugs (warnings, compiler and linker errors, test failures)
1444039e02dfSJerome Forissier     in reduced configurations when MBEDTLS_USE_PSA_CRYPTO is enabled.
1445039e02dfSJerome Forissier   * Fix a bug in (D)TLS curve negotiation: when MBEDTLS_USE_PSA_CRYPTO was
1446039e02dfSJerome Forissier     enabled and an ECDHE-ECDSA or ECDHE-RSA key exchange was used, the
1447039e02dfSJerome Forissier     client would fail to check that the curve selected by the server for
1448039e02dfSJerome Forissier     ECDHE was indeed one that was offered. As a result, the client would
1449039e02dfSJerome Forissier     accept any curve that it supported, even if that curve was not allowed
1450039e02dfSJerome Forissier     according to its configuration. Fixes #5291.
145132b31808SJens Wiklander   * The TLS 1.3 implementation is now compatible with the
145232b31808SJens Wiklander     MBEDTLS_USE_PSA_CRYPTO configuration option.
1453039e02dfSJerome Forissier   * Fix unit tests that used 0 as the file UID. This failed on some
1454039e02dfSJerome Forissier     implementations of PSA ITS. Fixes #3838.
145532b31808SJens Wiklander   * Fix mbedtls_ssl_get_version() not reporting TLSv1.3. Fixes #5406.
1456039e02dfSJerome Forissier   * Fix API violation in mbedtls_md_process() test by adding a call to
1457039e02dfSJerome Forissier     mbedtls_md_starts(). Fixes #2227.
1458039e02dfSJerome Forissier   * Fix compile errors when MBEDTLS_HAVE_TIME is not defined. Add tests
1459039e02dfSJerome Forissier     to catch bad uses of time.h.
146032b31808SJens Wiklander   * Fix a race condition in out-of-source builds with CMake when generated data
146132b31808SJens Wiklander     files are already present. Fixes #5374.
1462039e02dfSJerome Forissier   * Fix the library search path when building a shared library with CMake
1463039e02dfSJerome Forissier     on Windows.
1464039e02dfSJerome Forissier   * Fix bug in the alert sending function mbedtls_ssl_send_alert_message()
1465039e02dfSJerome Forissier     potentially leading to corrupted alert messages being sent in case
1466039e02dfSJerome Forissier     the function needs to be re-called after initially returning
1467039e02dfSJerome Forissier     MBEDTLS_SSL_WANT_WRITE. Fixes #1916.
146832b31808SJens Wiklander   * In configurations with MBEDTLS_SSL_DTLS_CONNECTION_ID enabled but not
146932b31808SJens Wiklander     MBEDTLS_DEBUG_C, DTLS handshakes using CID would crash due to a null
147032b31808SJens Wiklander     pointer dereference. Fix this. Fixes #3998.
147132b31808SJens Wiklander     The fix was released, but not announced, in Mbed TLS 3.1.0.
1472039e02dfSJerome Forissier   * Fix incorrect documentation of mbedtls_x509_crt_profile. The previous
1473039e02dfSJerome Forissier     documentation stated that the `allowed_pks` field applies to signatures
1474039e02dfSJerome Forissier     only, but in fact it does apply to the public key type of the end entity
1475039e02dfSJerome Forissier     certificate, too. Fixes #1992.
1476039e02dfSJerome Forissier   * Fix undefined behavior in mbedtls_asn1_find_named_data(), where val is
1477039e02dfSJerome Forissier     not NULL and val_len is zero.
147832b31808SJens Wiklander   * Fix compilation error with mingw32. Fixed by Cameron Cawley in #4211.
147932b31808SJens Wiklander   * Fix compilation error when using C++ Builder on Windows. Reported by
148032b31808SJens Wiklander     Miroslav Mastny in #4015.
1481039e02dfSJerome Forissier   * psa_raw_key_agreement() now returns PSA_ERROR_BUFFER_TOO_SMALL when
1482039e02dfSJerome Forissier     applicable. Fixes #5735.
1483039e02dfSJerome Forissier   * Fix a bug in the x25519 example program where the removal of
1484039e02dfSJerome Forissier     MBEDTLS_ECDH_LEGACY_CONTEXT caused the program not to run. Fixes #4901 and
1485039e02dfSJerome Forissier     #3191.
148632b31808SJens Wiklander   * Fix a TLS 1.3 handshake failure when the peer Finished message has not
148732b31808SJens Wiklander     been received yet when we first try to fetch it.
1488039e02dfSJerome Forissier   * Encode X.509 dates before 1/1/2000 as UTCTime rather than
1489039e02dfSJerome Forissier     GeneralizedTime. Fixes #5465.
149032b31808SJens Wiklander   * Add mbedtls_x509_dn_get_next function to return the next relative DN in
149132b31808SJens Wiklander     an X509 name, to allow walking the name list. Fixes #5431.
1492039e02dfSJerome Forissier    * Fix order value of curve x448.
1493039e02dfSJerome Forissier   * Fix string representation of DNs when outputting values containing commas
1494039e02dfSJerome Forissier     and other special characters, conforming to RFC 1779. Fixes #769.
1495039e02dfSJerome Forissier   * Silence a warning from GCC 12 in the selftest program. Fixes #5974.
149632b31808SJens Wiklander   * Fix check_config.h to check that we have MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
149732b31808SJens Wiklander     when MBEDTLS_SSL_PROTO_TLS1_3 is specified, and make this and other
149832b31808SJens Wiklander     dependencies explicit in the documentation. Fixes #5610.
1499039e02dfSJerome Forissier   * Fix mbedtls_asn1_write_mpi() writing an incorrect encoding of 0.
150032b31808SJens Wiklander   * Fix a TLS 1.3 handshake failure when the first attempt to send the client
150132b31808SJens Wiklander     Finished message on the network cannot be satisfied. Fixes #5499.
1502039e02dfSJerome Forissier   * Fix resource leaks in mbedtls_pk_parse_public_key() in low
1503039e02dfSJerome Forissier     memory conditions.
1504039e02dfSJerome Forissier   * Fix server connection identifier setting for outgoing encrypted records
1505039e02dfSJerome Forissier     on DTLS 1.2 session resumption. After DTLS 1.2 session resumption with
1506039e02dfSJerome Forissier     connection identifier, the Mbed TLS client now properly sends the server
1507039e02dfSJerome Forissier     connection identifier in encrypted record headers. Fix #5872.
1508039e02dfSJerome Forissier   * Fix a null pointer dereference when performing some operations on zero
1509039e02dfSJerome Forissier     represented with 0 limbs (specifically mbedtls_mpi_mod_int() dividing
1510039e02dfSJerome Forissier     by 2, and mbedtls_mpi_write_string() in base 2).
1511039e02dfSJerome Forissier   * Fix record sizes larger than 16384 being sometimes accepted despite being
1512039e02dfSJerome Forissier     non-compliant. This could not lead to a buffer overflow. In particular,
1513039e02dfSJerome Forissier     application data size was already checked correctly.
151432b31808SJens Wiklander   * Fix MBEDTLS_SVC_KEY_ID_GET_KEY_ID() and MBEDTLS_SVC_KEY_ID_GET_OWNER_ID()
151532b31808SJens Wiklander     which have been broken, resulting in compilation errors, since Mbed TLS
151632b31808SJens Wiklander     3.0.
151732b31808SJens Wiklander   * Ensure that TLS 1.2 ciphersuite/certificate and key selection takes into
151832b31808SJens Wiklander     account not just the type of the key (RSA vs EC) but also what it can
151932b31808SJens Wiklander     actually do. Resolves #5831.
152032b31808SJens Wiklander   * Fix CMake windows host detection, especially when cross compiling.
152132b31808SJens Wiklander   * Fix an error in make where the absence of a generated file caused
152232b31808SJens Wiklander     make to break on a clean checkout. Fixes #5340.
152332b31808SJens Wiklander   * Work around an MSVC ARM64 compiler bug causing incorrect behaviour
152432b31808SJens Wiklander     in mbedtls_mpi_exp_mod(). Reported by Tautvydas Žilys in #5467.
152532b31808SJens Wiklander   * Removed the prompt to exit from all windows build programs, which was causing
152632b31808SJens Wiklander     issues in CI/CD environments.
1527039e02dfSJerome Forissier
1528039e02dfSJerome ForissierChanges
152932b31808SJens Wiklander   * The file library/psa_crypto_driver_wrappers.c is now generated
153032b31808SJens Wiklander     from a template. In the future, the generation will support
153132b31808SJens Wiklander     driver descriptions. For the time being, to customize this file,
153232b31808SJens Wiklander     see docs/proposed/psa-driver-wrappers-codegen-migration-guide.md
153332b31808SJens Wiklander   * Return PSA_ERROR_INVALID_ARGUMENT if the algorithm passed to one-shot
153432b31808SJens Wiklander     AEAD functions is not an AEAD algorithm. This aligns them with the
153532b31808SJens Wiklander     multipart functions, and the PSA Crypto API 1.1 specification.
153632b31808SJens Wiklander   * In mbedtls_pk_parse_key(), if no password is provided, don't allocate a
153732b31808SJens Wiklander     temporary variable on the heap. Suggested by Sergey Kanatov in #5304.
1538039e02dfSJerome Forissier   * Assume source files are in UTF-8 when using MSVC with CMake.
153932b31808SJens Wiklander   * Fix runtime library install location when building with CMake and MinGW.
154032b31808SJens Wiklander     DLLs are now installed in the bin directory instead of lib.
154132b31808SJens Wiklander   * cmake: Use GnuInstallDirs to customize install directories
154232b31808SJens Wiklander     Replace custom LIB_INSTALL_DIR variable with standard CMAKE_INSTALL_LIBDIR
154332b31808SJens Wiklander     variable. For backward compatibility, set CMAKE_INSTALL_LIBDIR if
154432b31808SJens Wiklander     LIB_INSTALL_DIR is set.
154532b31808SJens Wiklander   * Add a CMake option that enables static linking of the runtime library
154632b31808SJens Wiklander     in Microsoft Visual C++ compiler. Contributed by Microplankton.
154732b31808SJens Wiklander   * In CMake builds, add aliases for libraries so that the normal MbedTLS::*
154832b31808SJens Wiklander     targets work when MbedTLS is built as a subdirectory. This allows the
154932b31808SJens Wiklander     use of FetchContent, as requested in #5688.
1550039e02dfSJerome Forissier
155132b31808SJens Wiklander= mbed TLS 3.1.0 branch released 2021-12-17
1552039e02dfSJerome Forissier
1553039e02dfSJerome ForissierAPI changes
155432b31808SJens Wiklander   * New error code for GCM: MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL.
155532b31808SJens Wiklander     Alternative GCM implementations are expected to verify
155632b31808SJens Wiklander     the length of the provided output buffers and to return the
155732b31808SJens Wiklander     MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL in case the buffer length is too small.
155832b31808SJens Wiklander   * You can configure groups for a TLS key exchange with the new function
155932b31808SJens Wiklander     mbedtls_ssl_conf_groups(). It extends mbedtls_ssl_conf_curves().
156032b31808SJens Wiklander   * Declare a number of structure fields as public: the fields of
156132b31808SJens Wiklander     mbedtls_ecp_curve_info, the fields describing the result of ASN.1 and
156232b31808SJens Wiklander     X.509 parsing, and finally the field fd of mbedtls_net_context on
156332b31808SJens Wiklander     POSIX/Unix-like platforms.
1564039e02dfSJerome Forissier
1565039e02dfSJerome ForissierRequirement changes
1566039e02dfSJerome Forissier   * Sign-magnitude and one's complement representations for signed integers are
1567039e02dfSJerome Forissier     not supported. Two's complement is the only supported representation.
1568039e02dfSJerome Forissier
156932b31808SJens WiklanderNew deprecations
157032b31808SJens Wiklander   * Deprecate mbedtls_ssl_conf_curves() in favor of the more generic
157132b31808SJens Wiklander     mbedtls_ssl_conf_groups().
157232b31808SJens Wiklander
1573039e02dfSJerome ForissierRemovals
1574039e02dfSJerome Forissier   * Remove the partial support for running unit tests via Greentea on Mbed OS,
1575039e02dfSJerome Forissier     which had been unmaintained since 2018.
1576039e02dfSJerome Forissier
1577039e02dfSJerome ForissierFeatures
157832b31808SJens Wiklander   * Enable support for Curve448 via the PSA API. Contributed by
157932b31808SJens Wiklander     Archana Madhavan in #4626. Fixes #3399 and #4249.
1580039e02dfSJerome Forissier   * The identifier of the CID TLS extension can be configured by defining
1581039e02dfSJerome Forissier     MBEDTLS_TLS_EXT_CID at compile time.
158232b31808SJens Wiklander   * Implement the PSA multipart AEAD interface, currently supporting
158332b31808SJens Wiklander     ChaChaPoly and GCM.
1584039e02dfSJerome Forissier   * Warn if errors from certain functions are ignored. This is currently
1585039e02dfSJerome Forissier     supported on GCC-like compilers and on MSVC and can be configured through
1586039e02dfSJerome Forissier     the macro MBEDTLS_CHECK_RETURN. The warnings are always enabled
1587039e02dfSJerome Forissier     (where supported) for critical functions where ignoring the return
1588039e02dfSJerome Forissier     value is almost always a bug. Enable the new configuration option
1589039e02dfSJerome Forissier     MBEDTLS_CHECK_RETURN_WARNING to get warnings for other functions. This
1590039e02dfSJerome Forissier     is currently implemented in the AES, DES and md modules, and will be
1591039e02dfSJerome Forissier     extended to other modules in the future.
1592039e02dfSJerome Forissier   * Add missing PSA macros declared by PSA Crypto API 1.0.0:
1593039e02dfSJerome Forissier     PSA_ALG_IS_SIGN_HASH, PSA_ALG_NONE, PSA_HASH_BLOCK_LENGTH, PSA_KEY_ID_NULL.
159432b31808SJens Wiklander   * Add support for CCM*-no-tag cipher to the PSA.
159532b31808SJens Wiklander     Currently only 13-byte long IV's are supported.
159632b31808SJens Wiklander     For decryption a minimum of 16-byte long input is expected.
159732b31808SJens Wiklander     These restrictions may be subject to change.
1598039e02dfSJerome Forissier   * Add new API mbedtls_ct_memcmp for constant time buffer comparison.
159932b31808SJens Wiklander   * Add functions to get the IV and block size from cipher_info structs.
160032b31808SJens Wiklander   * Add functions to check if a cipher supports variable IV or key size.
160132b31808SJens Wiklander   * Add the internal implementation of and support for CCM to the PSA multipart
160232b31808SJens Wiklander     AEAD interface.
160332b31808SJens Wiklander   * Mbed TLS provides a minimum viable implementation of the TLS 1.3
160432b31808SJens Wiklander     protocol. See docs/architecture/tls13-support.md for the definition of
160532b31808SJens Wiklander     the TLS 1.3 Minimum Viable Product (MVP). The MBEDTLS_SSL_PROTO_TLS1_3
160632b31808SJens Wiklander     configuration option controls the enablement of the support. The APIs
160732b31808SJens Wiklander     mbedtls_ssl_conf_min_version() and mbedtls_ssl_conf_max_version() allow
160832b31808SJens Wiklander     to select the 1.3 version of the protocol to establish a TLS connection.
1609039e02dfSJerome Forissier   * Add PSA API definition for ARIA.
1610039e02dfSJerome Forissier
1611039e02dfSJerome ForissierSecurity
1612039e02dfSJerome Forissier   * Zeroize several intermediate variables used to calculate the expected
1613039e02dfSJerome Forissier     value when verifying a MAC or AEAD tag. This hardens the library in
1614039e02dfSJerome Forissier     case the value leaks through a memory disclosure vulnerability. For
1615039e02dfSJerome Forissier     example, a memory disclosure vulnerability could have allowed a
1616039e02dfSJerome Forissier     man-in-the-middle to inject fake ciphertext into a DTLS connection.
161732b31808SJens Wiklander   * In psa_aead_generate_nonce(), do not read back from the output buffer.
161832b31808SJens Wiklander     This fixes a potential policy bypass or decryption oracle vulnerability
161932b31808SJens Wiklander     if the output buffer is in memory that is shared with an untrusted
162032b31808SJens Wiklander     application.
1621039e02dfSJerome Forissier   * In psa_cipher_generate_iv() and psa_cipher_encrypt(), do not read back
1622039e02dfSJerome Forissier     from the output buffer. This fixes a potential policy bypass or decryption
1623039e02dfSJerome Forissier     oracle vulnerability if the output buffer is in memory that is shared with
1624039e02dfSJerome Forissier     an untrusted application.
1625039e02dfSJerome Forissier   * Fix a double-free that happened after mbedtls_ssl_set_session() or
1626039e02dfSJerome Forissier     mbedtls_ssl_get_session() failed with MBEDTLS_ERR_SSL_ALLOC_FAILED
1627039e02dfSJerome Forissier     (out of memory). After that, calling mbedtls_ssl_session_free()
1628039e02dfSJerome Forissier     and mbedtls_ssl_free() would cause an internal session buffer to
1629039e02dfSJerome Forissier     be free()'d twice.
1630039e02dfSJerome Forissier
1631039e02dfSJerome ForissierBugfix
1632039e02dfSJerome Forissier   * Stop using reserved identifiers as local variables. Fixes #4630.
1633039e02dfSJerome Forissier   * The GNU makefiles invoke python3 in preference to python except on Windows.
1634039e02dfSJerome Forissier     The check was accidentally not performed when cross-compiling for Windows
1635039e02dfSJerome Forissier     on Linux. Fix this. Fixes #4774.
1636039e02dfSJerome Forissier   * Prevent divide by zero if either of PSA_CIPHER_ENCRYPT_OUTPUT_SIZE() or
1637039e02dfSJerome Forissier     PSA_CIPHER_UPDATE_OUTPUT_SIZE() were called using an asymmetric key type.
1638039e02dfSJerome Forissier   * Fix a parameter set but unused in psa_crypto_cipher.c. Fixes #4935.
1639039e02dfSJerome Forissier   * Don't use the obsolete header path sys/fcntl.h in unit tests.
1640039e02dfSJerome Forissier     These header files cause compilation errors in musl.
1641039e02dfSJerome Forissier     Fixes #4969.
1642039e02dfSJerome Forissier   * Fix missing constraints on x86_64 and aarch64 assembly code
1643039e02dfSJerome Forissier     for bignum multiplication that broke some bignum operations with
1644039e02dfSJerome Forissier     (at least) Clang 12.
1645039e02dfSJerome Forissier     Fixes #4116, #4786, #4917, #4962.
1646039e02dfSJerome Forissier   * Fix mbedtls_cipher_crypt: AES-ECB when MBEDTLS_USE_PSA_CRYPTO is enabled.
1647039e02dfSJerome Forissier   * Failures of alternative implementations of AES or DES single-block
1648039e02dfSJerome Forissier     functions enabled with MBEDTLS_AES_ENCRYPT_ALT, MBEDTLS_AES_DECRYPT_ALT,
1649039e02dfSJerome Forissier     MBEDTLS_DES_CRYPT_ECB_ALT or MBEDTLS_DES3_CRYPT_ECB_ALT were ignored.
1650039e02dfSJerome Forissier     This does not concern the implementation provided with Mbed TLS,
1651039e02dfSJerome Forissier     where this function cannot fail, or full-module replacements with
1652039e02dfSJerome Forissier     MBEDTLS_AES_ALT or MBEDTLS_DES_ALT. Reported by Armelle Duboc in #1092.
1653039e02dfSJerome Forissier   * Some failures of HMAC operations were ignored. These failures could only
1654039e02dfSJerome Forissier     happen with an alternative implementation of the underlying hash module.
1655039e02dfSJerome Forissier   * Fix the error returned by psa_generate_key() for a public key. Fixes #4551.
165632b31808SJens Wiklander   * Fix compile-time or run-time errors in PSA
165732b31808SJens Wiklander     AEAD functions when ChachaPoly is disabled. Fixes #5065.
165832b31808SJens Wiklander   * Remove PSA'a AEAD finish/verify output buffer limitation for GCM.
165932b31808SJens Wiklander     The requirement of minimum 15 bytes for output buffer in
166032b31808SJens Wiklander     psa_aead_finish() and psa_aead_verify() does not apply to the built-in
166132b31808SJens Wiklander     implementation of GCM.
166232b31808SJens Wiklander   * Move GCM's update output buffer length verification from PSA AEAD to
166332b31808SJens Wiklander     the built-in implementation of the GCM.
166432b31808SJens Wiklander     The requirement for output buffer size to be equal or greater then
166532b31808SJens Wiklander     input buffer size is valid only for the built-in implementation of GCM.
166632b31808SJens Wiklander     Alternative GCM implementations can process whole blocks only.
1667039e02dfSJerome Forissier   * Fix the build of sample programs when neither MBEDTLS_ERROR_C nor
1668039e02dfSJerome Forissier     MBEDTLS_ERROR_STRERROR_DUMMY is enabled.
1669039e02dfSJerome Forissier   * Fix PSA_ALG_RSA_PSS verification accepting an arbitrary salt length.
1670039e02dfSJerome Forissier     This algorithm now accepts only the same salt length for verification
1671039e02dfSJerome Forissier     that it produces when signing, as documented. Use the new algorithm
1672039e02dfSJerome Forissier     PSA_ALG_RSA_PSS_ANY_SALT to accept any salt length. Fixes #4946.
1673039e02dfSJerome Forissier   * The existing predicate macro name PSA_ALG_IS_HASH_AND_SIGN is now reserved
1674039e02dfSJerome Forissier     for algorithm values that fully encode the hashing step, as per the PSA
1675039e02dfSJerome Forissier     Crypto API specification. This excludes PSA_ALG_RSA_PKCS1V15_SIGN_RAW and
1676039e02dfSJerome Forissier     PSA_ALG_ECDSA_ANY. The new predicate macro PSA_ALG_IS_SIGN_HASH covers
1677039e02dfSJerome Forissier     all algorithms that can be used with psa_{sign,verify}_hash(), including
1678039e02dfSJerome Forissier     these two.
1679039e02dfSJerome Forissier   * Fix issue in Makefile on Linux with SHARED=1, that caused shared libraries
1680039e02dfSJerome Forissier     not to list other shared libraries they need.
1681039e02dfSJerome Forissier   * Fix a bug in mbedtls_gcm_starts() when the bit length of the iv
1682039e02dfSJerome Forissier     exceeds 2^32. Fixes #4884.
1683039e02dfSJerome Forissier   * Fix an uninitialized variable warning in test_suite_ssl.function with GCC
1684039e02dfSJerome Forissier     version 11.
1685039e02dfSJerome Forissier   * Fix the build when no SHA2 module is included. Fixes #4930.
1686039e02dfSJerome Forissier   * Fix the build when only the bignum module is included. Fixes #4929.
1687039e02dfSJerome Forissier   * Fix a potential invalid pointer dereference and infinite loop bugs in
1688039e02dfSJerome Forissier     pkcs12 functions when the password is empty. Fix the documentation to
1689039e02dfSJerome Forissier     better describe the inputs to these functions and their possible values.
1690039e02dfSJerome Forissier     Fixes #5136.
1691039e02dfSJerome Forissier   * The key usage flags PSA_KEY_USAGE_SIGN_MESSAGE now allows the MAC
1692039e02dfSJerome Forissier     operations psa_mac_compute() and psa_mac_sign_setup().
1693039e02dfSJerome Forissier   * The key usage flags PSA_KEY_USAGE_VERIFY_MESSAGE now allows the MAC
1694039e02dfSJerome Forissier     operations psa_mac_verify() and psa_mac_verify_setup().
1695039e02dfSJerome Forissier
1696039e02dfSJerome ForissierChanges
169732b31808SJens Wiklander    * Explicitly mark the fields mbedtls_ssl_session.exported and
169832b31808SJens Wiklander      mbedtls_ssl_config.respect_cli_pref as private. This was an
169932b31808SJens Wiklander      oversight during the run-up to the release of Mbed TLS 3.0.
170032b31808SJens Wiklander      The fields were never intended to be public.
170132b31808SJens Wiklander   * Implement multi-part CCM API.
170232b31808SJens Wiklander     The multi-part functions: mbedtls_ccm_starts(), mbedtls_ccm_set_lengths(),
170332b31808SJens Wiklander     mbedtls_ccm_update_ad(), mbedtls_ccm_update(), mbedtls_ccm_finish()
170432b31808SJens Wiklander     were introduced in mbedTLS 3.0 release, however their implementation was
170532b31808SJens Wiklander     postponed until now.
170632b31808SJens Wiklander     Implemented functions support chunked data input for both CCM and CCM*
170732b31808SJens Wiklander     algorithms.
170832b31808SJens Wiklander   * Remove MBEDTLS_SSL_EXPORT_KEYS, making it always on and increasing the
170932b31808SJens Wiklander     code size by about 80B on an M0 build. This option only gated an ability
171032b31808SJens Wiklander     to set a callback, but was deemed unnecessary as it was yet another define
171132b31808SJens Wiklander     to remember when writing tests, or test configurations. Fixes #4653.
1712039e02dfSJerome Forissier   * Improve the performance of base64 constant-flow code. The result is still
1713039e02dfSJerome Forissier     slower than the original non-constant-flow implementation, but much faster
1714039e02dfSJerome Forissier     than the previous constant-flow implementation. Fixes #4814.
171532b31808SJens Wiklander   * Ignore plaintext/ciphertext lengths for CCM*-no-tag operations.
171632b31808SJens Wiklander     For CCM* encryption/decryption without authentication, input
171732b31808SJens Wiklander     length will be ignored.
1718039e02dfSJerome Forissier   * Indicate in the error returned if the nonce length used with
1719039e02dfSJerome Forissier     ChaCha20-Poly1305 is invalid, and not just unsupported.
1720039e02dfSJerome Forissier   * The mbedcrypto library includes a new source code module constant_time.c,
1721039e02dfSJerome Forissier     containing various functions meant to resist timing side channel attacks.
1722039e02dfSJerome Forissier     This module does not have a separate configuration option, and functions
1723039e02dfSJerome Forissier     from this module will be included in the build as required. Currently
1724039e02dfSJerome Forissier     most of the interface of this module is private and may change at any
1725039e02dfSJerome Forissier     time.
172632b31808SJens Wiklander   * The generated configuration-independent files are now automatically
172732b31808SJens Wiklander     generated by the CMake build system on Unix-like systems. This is not
172832b31808SJens Wiklander     yet supported when cross-compiling.
1729817466cbSJens Wiklander
173032b31808SJens Wiklander= Mbed TLS 3.0.0 branch released 2021-07-07
17317901324dSJerome Forissier
17327901324dSJerome ForissierAPI changes
173332b31808SJens Wiklander   * Remove HAVEGE module.
173432b31808SJens Wiklander     The design of HAVEGE makes it unsuitable for microcontrollers. Platforms
173532b31808SJens Wiklander     with a more complex CPU usually have an operating system interface that
173632b31808SJens Wiklander     provides better randomness. Instead of HAVEGE, declare OS or hardware RNG
173732b31808SJens Wiklander     interfaces with mbedtls_entropy_add_source() and/or use an entropy seed
173832b31808SJens Wiklander     file created securely during device provisioning. See
173932b31808SJens Wiklander     https://mbed-tls.readthedocs.io/en/latest/kb/how-to/add-entropy-sources-to-entropy-pool/ for
174032b31808SJens Wiklander     more information.
174132b31808SJens Wiklander   * Add missing const attributes to API functions.
174232b31808SJens Wiklander   * Remove helpers for the transition from Mbed TLS 1.3 to Mbed TLS 2.0: the
174332b31808SJens Wiklander     header compat-1.3.h and the script rename.pl.
174432b31808SJens Wiklander   * Remove certs module from the API.
174532b31808SJens Wiklander     Transfer keys and certificates embedded in the library to the test
174632b31808SJens Wiklander     component. This contributes to minimizing library API and discourages
174732b31808SJens Wiklander     users from using unsafe keys in production.
174832b31808SJens Wiklander   * Move alt helpers and definitions.
174932b31808SJens Wiklander     Various helpers and definitions available for use in alt implementations
175032b31808SJens Wiklander     have been moved out of the include/ directory and into the library/
175132b31808SJens Wiklander     directory. The files concerned are ecp_internal.h and rsa_internal.h
175232b31808SJens Wiklander     which have also been renamed to ecp_internal_alt.h and rsa_alt_helpers.h
175332b31808SJens Wiklander     respectively.
175432b31808SJens Wiklander   * Move internal headers.
175532b31808SJens Wiklander     Header files that were only meant for the library's internal use and
175632b31808SJens Wiklander     were not meant to be used in application code have been moved out of
175732b31808SJens Wiklander     the include/ directory. The headers concerned are bn_mul.h, aesni.h,
175832b31808SJens Wiklander     padlock.h, entropy_poll.h and *_internal.h.
175932b31808SJens Wiklander   * Drop support for parsing SSLv2 ClientHello
176032b31808SJens Wiklander     (MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO).
176132b31808SJens Wiklander   * Drop support for SSLv3 (MBEDTLS_SSL_PROTO_SSL3).
176232b31808SJens Wiklander   * Drop support for TLS record-level compression (MBEDTLS_ZLIB_SUPPORT).
176332b31808SJens Wiklander   * Drop support for RC4 TLS ciphersuites.
176432b31808SJens Wiklander   * Drop support for single-DES ciphersuites.
176532b31808SJens Wiklander   * Drop support for MBEDTLS_SSL_HW_RECORD_ACCEL.
17667901324dSJerome Forissier   * Update AEAD output size macros to bring them in line with the PSA Crypto
17677901324dSJerome Forissier     API version 1.0 spec. This version of the spec parameterizes them on the
17687901324dSJerome Forissier     key type used, as well as the key bit-size in the case of
17697901324dSJerome Forissier     PSA_AEAD_TAG_LENGTH.
177032b31808SJens Wiklander   * Add configuration option MBEDTLS_X509_REMOVE_INFO which
177132b31808SJens Wiklander     removes the mbedtls_x509_*_info(), mbedtls_debug_print_crt()
177232b31808SJens Wiklander     as well as other functions and constants only used by
177332b31808SJens Wiklander     those functions. This reduces the code footprint by
177432b31808SJens Wiklander     several kB.
177532b31808SJens Wiklander   * Remove SSL error codes `MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED`
177632b31808SJens Wiklander     and `MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH` which are never
177732b31808SJens Wiklander     returned from the public SSL API.
177832b31808SJens Wiklander   * Remove `MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE` and return
177932b31808SJens Wiklander     `MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL` instead.
178032b31808SJens Wiklander   * The output parameter of mbedtls_sha512_finish, mbedtls_sha512,
178132b31808SJens Wiklander     mbedtls_sha256_finish and mbedtls_sha256 now has a pointer type
178232b31808SJens Wiklander     rather than array type. This removes spurious warnings in some compilers
178332b31808SJens Wiklander     when outputting a SHA-384 or SHA-224 hash into a buffer of exactly
178432b31808SJens Wiklander     the hash size.
178532b31808SJens Wiklander   * Remove the MBEDTLS_TEST_NULL_ENTROPY config option. Fixes #4388.
178632b31808SJens Wiklander   * The interface of the GCM module has changed to remove restrictions on
178732b31808SJens Wiklander     how the input to multipart operations is broken down. mbedtls_gcm_finish()
178832b31808SJens Wiklander     now takes extra output parameters for the last partial output block.
178932b31808SJens Wiklander     mbedtls_gcm_update() now takes extra parameters for the output length.
179032b31808SJens Wiklander     The software implementation always produces the full output at each
179132b31808SJens Wiklander     call to mbedtls_gcm_update(), but alternative implementations activated
179232b31808SJens Wiklander     by MBEDTLS_GCM_ALT may delay partial blocks to the next call to
179332b31808SJens Wiklander     mbedtls_gcm_update() or mbedtls_gcm_finish(). Furthermore, applications
179432b31808SJens Wiklander     no longer pass the associated data to mbedtls_gcm_starts(), but to the
179532b31808SJens Wiklander     new function mbedtls_gcm_update_ad().
179632b31808SJens Wiklander     These changes are backward compatible for users of the cipher API.
179732b31808SJens Wiklander   * Replace MBEDTLS_SHA512_NO_SHA384 config option with MBEDTLS_SHA384_C.
179832b31808SJens Wiklander     This separates config option enabling the SHA384 algorithm from option
179932b31808SJens Wiklander     enabling the SHA512 algorithm. Fixes #4034.
180032b31808SJens Wiklander   * Introduce MBEDTLS_SHA224_C.
180132b31808SJens Wiklander     This separates config option enabling the SHA224 algorithm from option
180232b31808SJens Wiklander     enabling SHA256.
180332b31808SJens Wiklander   * The getter and setter API of the SSL session cache (used for
180432b31808SJens Wiklander     session-ID based session resumption) has changed to that of
180532b31808SJens Wiklander     a key-value store with keys being session IDs and values
180632b31808SJens Wiklander     being opaque instances of `mbedtls_ssl_session`.
180732b31808SJens Wiklander   * Remove the mode parameter from RSA operation functions. Signature and
180832b31808SJens Wiklander     decryption functions now always use the private key and verification and
180932b31808SJens Wiklander     encryption use the public key. Verification functions also no longer have
181032b31808SJens Wiklander     RNG parameters.
181132b31808SJens Wiklander   * Modify semantics of `mbedtls_ssl_conf_[opaque_]psk()`:
181232b31808SJens Wiklander     In Mbed TLS 2.X, the API prescribes that later calls overwrite
181332b31808SJens Wiklander     the effect of earlier calls. In Mbed TLS 3.0, calling
181432b31808SJens Wiklander     `mbedtls_ssl_conf_[opaque_]psk()` more than once will fail,
181532b31808SJens Wiklander     leaving the PSK that was configured first intact.
181632b31808SJens Wiklander     Support for more than one PSK may be added in 3.X.
181732b31808SJens Wiklander   * The function mbedtls_x509write_csr_set_extension() has an extra parameter
181832b31808SJens Wiklander     which allows to mark an extension as critical. Fixes #4055.
181932b31808SJens Wiklander   * For multi-part AEAD operations with the cipher module, calling
182032b31808SJens Wiklander     mbedtls_cipher_finish() is now mandatory. Previously the documentation
182132b31808SJens Wiklander     was unclear on this point, and this function happened to never do
182232b31808SJens Wiklander     anything with the currently implemented AEADs, so in practice it was
182332b31808SJens Wiklander     possible to skip calling it, which is no longer supported.
182432b31808SJens Wiklander   * The option MBEDTLS_ECP_FIXED_POINT_OPTIM use pre-computed comb tables
182532b31808SJens Wiklander     instead of computing tables in runtime. Thus, this option now increase
182632b31808SJens Wiklander     code size, and it does not increase RAM usage in runtime anymore.
182732b31808SJens Wiklander   * Remove the SSL APIs mbedtls_ssl_get_input_max_frag_len() and
182832b31808SJens Wiklander     mbedtls_ssl_get_output_max_frag_len(), and add a new API
182932b31808SJens Wiklander     mbedtls_ssl_get_max_in_record_payload(), complementing the existing
183032b31808SJens Wiklander     mbedtls_ssl_get_max_out_record_payload().
183132b31808SJens Wiklander     Uses of mbedtls_ssl_get_input_max_frag_len() and
183232b31808SJens Wiklander     mbedtls_ssl_get_input_max_frag_len() should be replaced by
183332b31808SJens Wiklander     mbedtls_ssl_get_max_in_record_payload() and
183432b31808SJens Wiklander     mbedtls_ssl_get_max_out_record_payload(), respectively.
183532b31808SJens Wiklander   * mbedtls_rsa_init() now always selects the PKCS#1v1.5 encoding for an RSA
183632b31808SJens Wiklander     key. To use an RSA key with PSS or OAEP, call mbedtls_rsa_set_padding()
183732b31808SJens Wiklander     after initializing the context. mbedtls_rsa_set_padding() now returns an
183832b31808SJens Wiklander     error if its parameters are invalid.
183932b31808SJens Wiklander   * Replace MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE by a runtime
184032b31808SJens Wiklander     configuration function mbedtls_ssl_conf_preference_order(). Fixes #4398.
184132b31808SJens Wiklander   * Instead of accessing the len field of a DHM context, which is no longer
184232b31808SJens Wiklander     supported, use the new function mbedtls_dhm_get_len() .
184332b31808SJens Wiklander   * In modules that implement cryptographic hash functions, many functions
184432b31808SJens Wiklander     mbedtls_xxx() now return int instead of void, and the corresponding
184532b31808SJens Wiklander     function mbedtls_xxx_ret() which was identical except for returning int
184632b31808SJens Wiklander     has been removed. This also concerns mbedtls_xxx_drbg_update(). See the
184732b31808SJens Wiklander     migration guide for more information. Fixes #4212.
184832b31808SJens Wiklander   * For all functions that take a random number generator (RNG) as a
184932b31808SJens Wiklander     parameter, this parameter is now mandatory (that is, NULL is not an
185032b31808SJens Wiklander     acceptable value). Functions which previously accepted NULL and now
185132b31808SJens Wiklander     reject it are: the X.509 CRT and CSR writing functions; the PK and RSA
185232b31808SJens Wiklander     sign and decrypt function; mbedtls_rsa_private(); the functions
185332b31808SJens Wiklander     in DHM and ECDH that compute the shared secret; the scalar multiplication
185432b31808SJens Wiklander     functions in ECP.
185532b31808SJens Wiklander   * The following functions now require an RNG parameter:
185632b31808SJens Wiklander     mbedtls_ecp_check_pub_priv(), mbedtls_pk_check_pair(),
185732b31808SJens Wiklander     mbedtls_pk_parse_key(), mbedtls_pk_parse_keyfile().
185832b31808SJens Wiklander   * mbedtls_ssl_conf_export_keys_ext_cb() and
185932b31808SJens Wiklander     mbedtls_ssl_conf_export_keys_cb() have been removed and
186032b31808SJens Wiklander     replaced by a new API mbedtls_ssl_set_export_keys_cb().
186132b31808SJens Wiklander     Raw keys and IVs are no longer passed to the callback.
186232b31808SJens Wiklander     Further, callbacks now receive an additional parameter
186332b31808SJens Wiklander     indicating the type of secret that's being exported,
186432b31808SJens Wiklander     paving the way for the larger number of secrets
186532b31808SJens Wiklander     in TLS 1.3. Finally, the key export callback and
186632b31808SJens Wiklander     context are now connection-specific.
186732b31808SJens Wiklander   * Signature functions in the RSA and PK modules now require the hash
186832b31808SJens Wiklander     length parameter to be the size of the hash input. For RSA signatures
186932b31808SJens Wiklander     other than raw PKCS#1 v1.5, this must match the output size of the
187032b31808SJens Wiklander     specified hash algorithm.
187132b31808SJens Wiklander   * The functions mbedtls_pk_sign(), mbedtls_pk_sign_restartable(),
187232b31808SJens Wiklander     mbedtls_ecdsa_write_signature() and
187332b31808SJens Wiklander     mbedtls_ecdsa_write_signature_restartable() now take an extra parameter
187432b31808SJens Wiklander     indicating the size of the output buffer for the signature.
18757901324dSJerome Forissier   * Implement one-shot cipher functions, psa_cipher_encrypt and
18767901324dSJerome Forissier     psa_cipher_decrypt, according to the PSA Crypto API 1.0.0
18777901324dSJerome Forissier     specification.
187832b31808SJens Wiklander   * Direct access to fields of structures declared in public headers is no
187932b31808SJens Wiklander     longer supported except for fields that are documented public. Use accessor
188032b31808SJens Wiklander     functions instead. For more information, see the migration guide entry
188132b31808SJens Wiklander     "Most structure fields are now private".
188232b31808SJens Wiklander   * mbedtls_ssl_get_session_pointer() has been removed, and
188332b31808SJens Wiklander     mbedtls_ssl_{set,get}_session() may now only be called once for any given
188432b31808SJens Wiklander     SSL context.
188532b31808SJens Wiklander
188632b31808SJens WiklanderDefault behavior changes
188732b31808SJens Wiklander   * Enable by default the functionalities which have no reason to be disabled.
188832b31808SJens Wiklander     They are: ARIA block cipher, CMAC mode, elliptic curve J-PAKE library and
188932b31808SJens Wiklander     Key Wrapping mode as defined in NIST SP 800-38F. Fixes #4036.
189032b31808SJens Wiklander   * Some default policies for X.509 certificate verification and TLS have
189132b31808SJens Wiklander     changed: curves and hashes weaker than 255 bits are no longer accepted
189232b31808SJens Wiklander     by default. The default order in TLS now favors faster curves over larger
189332b31808SJens Wiklander     curves.
18947901324dSJerome Forissier
18957901324dSJerome ForissierRequirement changes
18967901324dSJerome Forissier   * The library now uses the %zu format specifier with the printf() family of
18977901324dSJerome Forissier     functions, so requires a toolchain that supports it. This change does not
18987901324dSJerome Forissier     affect the maintained LTS branches, so when contributing changes please
18997901324dSJerome Forissier     bear this in mind and do not add them to backported code.
190032b31808SJens Wiklander   * If you build the development version of Mbed TLS, rather than an official
190132b31808SJens Wiklander     release, some configuration-independent files are now generated at build
190232b31808SJens Wiklander     time rather than checked into source control. This includes some library
190332b31808SJens Wiklander     source files as well as the Visual Studio solution. Perl, Python 3 and a
190432b31808SJens Wiklander     C compiler for the host platform are required. See “Generated source files
190532b31808SJens Wiklander     in the development branch” in README.md for more information.
190632b31808SJens Wiklander   * Refresh the minimum supported versions of tools to build the
190732b31808SJens Wiklander     library. CMake versions older than 3.10.2 and Python older
190832b31808SJens Wiklander     than 3.6 are no longer supported.
190932b31808SJens Wiklander
191032b31808SJens WiklanderRemovals
191132b31808SJens Wiklander   * Remove the MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
191232b31808SJens Wiklander     compile-time option, which was off by default. Users should not trust
191332b31808SJens Wiklander     certificates signed with SHA-1 due to the known attacks against SHA-1.
191432b31808SJens Wiklander     If needed, SHA-1 certificates can still be verified by using a custom
191532b31808SJens Wiklander     verification profile.
191632b31808SJens Wiklander   * Removed deprecated things in psa/crypto_compat.h. Fixes #4284
191732b31808SJens Wiklander   * Removed deprecated functions from hashing modules. Fixes #4280.
191832b31808SJens Wiklander   * Remove PKCS#11 library wrapper. PKCS#11 has limited functionality,
191932b31808SJens Wiklander     lacks automated tests and has scarce documentation. Also, PSA Crypto
192032b31808SJens Wiklander     provides a more flexible private key management.
192132b31808SJens Wiklander     More details on PCKS#11 wrapper removal can be found in the mailing list
192232b31808SJens Wiklander     https://lists.trustedfirmware.org/pipermail/mbed-tls/2020-April/000024.html
192332b31808SJens Wiklander   * Remove deprecated error codes. Fix #4283
192432b31808SJens Wiklander   * Remove MBEDTLS_ENABLE_WEAK_CIPHERSUITES configuration option. Fixes #4416.
192532b31808SJens Wiklander   * Remove the MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
192632b31808SJens Wiklander     compile-time option. This option has been inactive for a long time.
192732b31808SJens Wiklander     Please use the `lifetime` parameter of `mbedtls_ssl_ticket_setup()`
192832b31808SJens Wiklander     instead.
192932b31808SJens Wiklander   * Remove the following deprecated functions and constants of hex-encoded
193032b31808SJens Wiklander     primes based on RFC 5114 and RFC 3526 from library code and tests:
193132b31808SJens Wiklander     mbedtls_aes_encrypt(), mbedtls_aes_decrypt(), mbedtls_mpi_is_prime(),
193232b31808SJens Wiklander     mbedtls_cipher_auth_encrypt(), mbedtls_cipher_auth_decrypt(),
193332b31808SJens Wiklander     mbedtls_ctr_drbg_update(), mbedtls_hmac_drbg_update(),
193432b31808SJens Wiklander     mbedtls_ecdsa_write_signature_det(), mbedtls_ecdsa_sign_det(),
193532b31808SJens Wiklander     mbedtls_ssl_conf_dh_param(), mbedtls_ssl_get_max_frag_len(),
193632b31808SJens Wiklander     MBEDTLS_DHM_RFC5114_MODP_2048_P, MBEDTLS_DHM_RFC5114_MODP_2048_G,
193732b31808SJens Wiklander     MBEDTLS_DHM_RFC3526_MODP_2048_P, MBEDTLS_DHM_RFC3526_MODP_2048_G,
193832b31808SJens Wiklander     MBEDTLS_DHM_RFC3526_MODP_3072_P, MBEDTLS_DHM_RFC3526_MODP_3072_G,
193932b31808SJens Wiklander     MBEDTLS_DHM_RFC3526_MODP_4096_P, MBEDTLS_DHM_RFC3526_MODP_4096_G.
194032b31808SJens Wiklander     Remove the deprecated file: include/mbedtls/net.h. Fixes #4282.
194132b31808SJens Wiklander   * Remove MBEDTLS_SSL_MAX_CONTENT_LEN configuration option, since
194232b31808SJens Wiklander     MBEDTLS_SSL_IN_CONTENT_LEN and MBEDTLS_SSL_OUT_CONTENT_LEN replace
194332b31808SJens Wiklander     it. Fixes #4362.
194432b31808SJens Wiklander   * Remove the MBEDTLS_SSL_RECORD_CHECKING option and enable by default its
194532b31808SJens Wiklander     previous action. Fixes #4361.
194632b31808SJens Wiklander   * Remove support for TLS 1.0, TLS 1.1 and DTLS 1.0, as well as support for
194732b31808SJens Wiklander     CBC record splitting, fallback SCSV, and the ability to configure
194832b31808SJens Wiklander     ciphersuites per version, which are no longer relevant. This removes the
194932b31808SJens Wiklander     configuration options MBEDTLS_SSL_PROTO_TLS1,
195032b31808SJens Wiklander     MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING and
195132b31808SJens Wiklander     MBEDTLS_SSL_FALLBACK_SCSV as well as the functions
195232b31808SJens Wiklander     mbedtls_ssl_conf_cbc_record_splitting(),
195332b31808SJens Wiklander     mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(),
195432b31808SJens Wiklander     and mbedtls_ssl_conf_ciphersuites_for_version(). Fixes #4286.
195532b31808SJens Wiklander   * The RSA module no longer supports private-key operations with the public
195632b31808SJens Wiklander     key and vice versa.
195732b31808SJens Wiklander   * Remove the MBEDTLS_SSL_DTLS_BADMAC_LIMIT config.h option. Fixes #4403.
195832b31808SJens Wiklander   * Remove all the 3DES ciphersuites:
195932b31808SJens Wiklander     MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
196032b31808SJens Wiklander     MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
196132b31808SJens Wiklander     MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
196232b31808SJens Wiklander     MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
196332b31808SJens Wiklander     MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
196432b31808SJens Wiklander     MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
196532b31808SJens Wiklander     MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA,
196632b31808SJens Wiklander     MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
196732b31808SJens Wiklander     MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA. Remove the
196832b31808SJens Wiklander     MBEDTLS_REMOVE_3DES_CIPHERSUITES option which is no longer relevant.
196932b31808SJens Wiklander     Fixes #4367.
197032b31808SJens Wiklander   * Remove the MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 option and let the code
197132b31808SJens Wiklander     behave as if it was always disabled. Fixes #4386.
197232b31808SJens Wiklander   * Remove MBEDTLS_ECDH_LEGACY_CONTEXT config option since this was purely for
197332b31808SJens Wiklander     backward compatibility which is no longer supported. Addresses #4404.
197432b31808SJens Wiklander   * Remove the following macros: MBEDTLS_CHECK_PARAMS,
197532b31808SJens Wiklander     MBEDTLS_CHECK_PARAMS_ASSERT, MBEDTLS_PARAM_FAILED,
197632b31808SJens Wiklander     MBEDTLS_PARAM_FAILED_ALT. Fixes #4313.
197732b31808SJens Wiklander   * Remove the  MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION config.h
197832b31808SJens Wiklander     option. The mbedtls_x509_crt_parse_der_with_ext_cb() is the way to go for
197932b31808SJens Wiklander     migration path. Fixes #4378.
198032b31808SJens Wiklander   * Remove the MBEDTLS_X509_CHECK_KEY_USAGE and
198132b31808SJens Wiklander     MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE config.h options and let the code
198232b31808SJens Wiklander     behave as if they were always enabled. Fixes #4405.
198332b31808SJens Wiklander   * MBEDTLS_ECP_MAX_BITS is no longer a configuration option because it is
198432b31808SJens Wiklander     now determined automatically based on supported curves.
198532b31808SJens Wiklander   * Remove the following functions: mbedtls_timing_self_test(),
198632b31808SJens Wiklander     mbedtls_hardclock_poll(), mbedtls_timing_hardclock() and
198732b31808SJens Wiklander     mbedtls_set_alarm(). Fixes #4083.
198832b31808SJens Wiklander   * The configuration option MBEDTLS_ECP_NO_INTERNAL_RNG has been removed as
198932b31808SJens Wiklander     it no longer had any effect.
199032b31808SJens Wiklander   * Remove all support for MD2, MD4, RC4, Blowfish and XTEA. This removes the
199132b31808SJens Wiklander     corresponding modules and all their APIs and related configuration
199232b31808SJens Wiklander     options. Fixes #4084.
199332b31808SJens Wiklander   * Remove MBEDTLS_SSL_TRUNCATED_HMAC and also remove
199432b31808SJens Wiklander     MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT config option. Users are better served by
199532b31808SJens Wiklander     using a CCM-8 ciphersuite than a CBC ciphersuite with truncated HMAC.
199632b31808SJens Wiklander     See issue #4341 for more details.
199732b31808SJens Wiklander   * Remove the compile-time option
199832b31808SJens Wiklander     MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE.
19997901324dSJerome Forissier
20007901324dSJerome ForissierFeatures
20017901324dSJerome Forissier   * Add mbedtls_rsa_rsassa_pss_sign_ext() function allowing to generate a
20027901324dSJerome Forissier     signature with a specific salt length. This function allows to validate
20037901324dSJerome Forissier     test cases provided in the NIST's CAVP test suite. Contributed by Cédric
20047901324dSJerome Forissier     Meuter in PR #3183.
20057901324dSJerome Forissier   * Added support for built-in driver keys through the PSA opaque crypto
20067901324dSJerome Forissier     driver interface. Refer to the documentation of
20077901324dSJerome Forissier     MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS for more information.
20087901324dSJerome Forissier   * Implement psa_sign_message() and psa_verify_message().
200932b31808SJens Wiklander   * The multi-part GCM interface (mbedtls_gcm_update() or
201032b31808SJens Wiklander     mbedtls_cipher_update()) no longer requires the size of partial inputs to
201132b31808SJens Wiklander     be a multiple of 16.
201232b31808SJens Wiklander   * The multi-part GCM interface now supports chunked associated data through
201332b31808SJens Wiklander     multiple calls to mbedtls_gcm_update_ad().
20147901324dSJerome Forissier   * The new function mbedtls_mpi_random() generates a random value in a
20157901324dSJerome Forissier     given range uniformly.
201632b31808SJens Wiklander   * Alternative implementations of the AES, DHM, ECJPAKE, ECP, RSA and timing
201732b31808SJens Wiklander     modules had undocumented constraints on their context types. These
201832b31808SJens Wiklander     constraints have been relaxed.
201932b31808SJens Wiklander     See docs/architecture/alternative-implementations.md for the remaining
202032b31808SJens Wiklander     constraints.
202132b31808SJens Wiklander   * The new functions mbedtls_dhm_get_len() and mbedtls_dhm_get_bitlen()
202232b31808SJens Wiklander     query the size of the modulus in a Diffie-Hellman context.
202332b31808SJens Wiklander   * The new function mbedtls_dhm_get_value() copy a field out of a
202432b31808SJens Wiklander     Diffie-Hellman context.
202532b31808SJens Wiklander   * Use the new function mbedtls_ecjpake_set_point_format() to select the
202632b31808SJens Wiklander     point format for ECJPAKE instead of accessing the point_format field
202732b31808SJens Wiklander     directly, which is no longer supported.
20287901324dSJerome Forissier   * Implement psa_mac_compute() and psa_mac_verify() as defined in the
20297901324dSJerome Forissier     PSA Cryptograpy API 1.0.0 specification.
20307901324dSJerome Forissier
20317901324dSJerome ForissierSecurity
20327901324dSJerome Forissier   * Fix a bias in the generation of finite-field Diffie-Hellman-Merkle (DHM)
20337901324dSJerome Forissier     private keys and of blinding values for DHM and elliptic curves (ECP)
20347901324dSJerome Forissier     computations. Reported by FlorianF89 in #4245.
20357901324dSJerome Forissier   * Fix a potential side channel vulnerability in ECDSA ephemeral key generation.
20367901324dSJerome Forissier     An adversary who is capable of very precise timing measurements could
20377901324dSJerome Forissier     learn partial information about the leading bits of the nonce used for the
20387901324dSJerome Forissier     signature, allowing the recovery of the private key after observing a
20397901324dSJerome Forissier     large number of signature operations. This completes a partial fix in
20407901324dSJerome Forissier     Mbed TLS 2.20.0.
204132b31808SJens Wiklander   * Fix an issue where an adversary with access to precise enough information
204232b31808SJens Wiklander     about memory accesses (typically, an untrusted operating system attacking
204332b31808SJens Wiklander     a secure enclave) could recover an RSA private key after observing the
204432b31808SJens Wiklander     victim performing a single private-key operation. Found and reported by
20457901324dSJerome Forissier     Zili KOU, Wenjian HE, Sharad Sinha, and Wei ZHANG.
204632b31808SJens Wiklander   * Fix an issue where an adversary with access to precise enough timing
204732b31808SJens Wiklander     information (typically, a co-located process) could recover a Curve25519
204832b31808SJens Wiklander     or Curve448 static ECDH key after inputting a chosen public key and
204932b31808SJens Wiklander     observing the victim performing the corresponding private-key operation.
205032b31808SJens Wiklander     Found and reported by Leila Batina, Lukas Chmielewski, Björn Haase, Niels
205132b31808SJens Wiklander     Samwel and Peter Schwabe.
20527901324dSJerome Forissier
20537901324dSJerome ForissierBugfix
20547901324dSJerome Forissier   * Fix premature fopen() call in mbedtls_entropy_write_seed_file which may
205532b31808SJens Wiklander     lead to the seed file corruption in case if the path to the seed file is
20567901324dSJerome Forissier     equal to MBEDTLS_PLATFORM_STD_NV_SEED_FILE. Contributed by Victor
20577901324dSJerome Forissier     Krasnoshchok in #3616.
20587901324dSJerome Forissier   * PSA functions creating a key now return PSA_ERROR_INVALID_ARGUMENT rather
20597901324dSJerome Forissier     than PSA_ERROR_INVALID_HANDLE when the identifier specified for the key
20607901324dSJerome Forissier     to create is not valid, bringing them in line with version 1.0.0 of the
20617901324dSJerome Forissier     specification. Fix #4271.
206232b31808SJens Wiklander   * Add printf function attributes to mbedtls_debug_print_msg to ensure we
206332b31808SJens Wiklander     get printf format specifier warnings.
206432b31808SJens Wiklander   * PSA functions other than psa_open_key now return PSA_ERROR_INVALID_HANDLE
206532b31808SJens Wiklander     rather than PSA_ERROR_DOES_NOT_EXIST for an invalid handle, bringing them
206632b31808SJens Wiklander     in line with version 1.0.0 of the specification. Fix #4162.
206732b31808SJens Wiklander   * Fix a bug in ECDSA that would cause it to fail when the hash is all-bits
206832b31808SJens Wiklander     zero. Fixes #1792
20697901324dSJerome Forissier   * Fix some cases in the bignum module where the library constructed an
20707901324dSJerome Forissier     unintended representation of the value 0 which was not processed
20717901324dSJerome Forissier     correctly by some bignum operations. This could happen when
20727901324dSJerome Forissier     mbedtls_mpi_read_string() was called on "-0", or when
20737901324dSJerome Forissier     mbedtls_mpi_mul_mpi() and mbedtls_mpi_mul_int() was called with one of
20747901324dSJerome Forissier     the arguments being negative and the other being 0. Fixes #4643.
20757901324dSJerome Forissier   * Fix a compilation error when MBEDTLS_ECP_RANDOMIZE_MXZ_ALT is
20767901324dSJerome Forissier     defined. Fixes #4217.
20777901324dSJerome Forissier   * Fix an incorrect error code when parsing a PKCS#8 private key.
20787901324dSJerome Forissier   * In a TLS client, enforce the Diffie-Hellman minimum parameter size
20797901324dSJerome Forissier     set with mbedtls_ssl_conf_dhm_min_bitlen() precisely. Before, the
20807901324dSJerome Forissier     minimum size was rounded down to the nearest multiple of 8.
20817901324dSJerome Forissier   * In library/net_sockets.c, _POSIX_C_SOURCE and _XOPEN_SOURCE are
20827901324dSJerome Forissier     defined to specific values.  If the code is used in a context
20837901324dSJerome Forissier     where these are already defined, this can result in a compilation
20847901324dSJerome Forissier     error.  Instead, assume that if they are defined, the values will
20857901324dSJerome Forissier     be adequate to build Mbed TLS.
208632b31808SJens Wiklander   * With MBEDTLS_PSA_CRYPTO_C disabled, some functions were getting built
208732b31808SJens Wiklander     nonetheless, resulting in undefined reference errors when building a
208832b31808SJens Wiklander     shared library. Reported by Guillermo Garcia M. in #4411.
20897901324dSJerome Forissier   * The cipher suite TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384 was not available
20907901324dSJerome Forissier     when SHA-1 was disabled and was offered when SHA-1 was enabled but SHA-384
20917901324dSJerome Forissier     was disabled. Fix the dependency. Fixes #4472.
20927901324dSJerome Forissier   * Do not offer SHA384 cipher suites when SHA-384 is disabled. Fixes #4499.
20937901324dSJerome Forissier   * Fix test suite code on platforms where int32_t is not int, such as
20947901324dSJerome Forissier     Arm Cortex-M. Fixes #4530.
20957901324dSJerome Forissier   * Fix some issues affecting MBEDTLS_ARIA_ALT implementations: a misplaced
20967901324dSJerome Forissier     directive in a header and a missing initialization in the self-test.
20977901324dSJerome Forissier   * Fix a missing initialization in the Camellia self-test, affecting
20987901324dSJerome Forissier     MBEDTLS_CAMELLIA_ALT implementations.
20997901324dSJerome Forissier   * Restore the ability to configure PSA via Mbed TLS options to support RSA
21007901324dSJerome Forissier     key pair operations but exclude RSA key generation. When MBEDTLS_GENPRIME
21017901324dSJerome Forissier     is not defined PSA will no longer attempt to use mbedtls_rsa_gen_key().
21027901324dSJerome Forissier     Fixes #4512.
21037901324dSJerome Forissier   * Fix a regression introduced in 2.24.0 which broke (D)TLS CBC ciphersuites
21047901324dSJerome Forissier     (when the encrypt-then-MAC extension is not in use) with some ALT
21057901324dSJerome Forissier     implementations of the underlying hash (SHA-1, SHA-256, SHA-384), causing
21067901324dSJerome Forissier     the affected side to wrongly reject valid messages. Fixes #4118.
21077901324dSJerome Forissier   * Remove outdated check-config.h check that prevented implementing the
21087901324dSJerome Forissier     timing module on Mbed OS. Fixes #4633.
21097901324dSJerome Forissier   * Fix PSA_ALG_TLS12_PRF and PSA_ALG_TLS12_PSK_TO_MS being too permissive
21107901324dSJerome Forissier     about missing inputs.
21117901324dSJerome Forissier   * Fix mbedtls_net_poll() and mbedtls_net_recv_timeout() often failing with
21127901324dSJerome Forissier     MBEDTLS_ERR_NET_POLL_FAILED on Windows. Fixes #4465.
21137901324dSJerome Forissier   * Fix a resource leak in a test suite with an alternative AES
21147901324dSJerome Forissier     implementation. Fixes #4176.
21157901324dSJerome Forissier   * Fix a crash in mbedtls_mpi_debug_mpi on a bignum having 0 limbs. This
21167901324dSJerome Forissier     could notably be triggered by setting the TLS debug level to 3 or above
21177901324dSJerome Forissier     and using a Montgomery curve for the key exchange. Reported by lhuang04
21187901324dSJerome Forissier     in #4578. Fixes #4608.
21197901324dSJerome Forissier   * psa_verify_hash() was relying on implementation-specific behavior of
21207901324dSJerome Forissier     mbedtls_rsa_rsassa_pss_verify() and was causing failures in some _ALT
21217901324dSJerome Forissier     implementations. This reliance is now removed. Fixes #3990.
21227901324dSJerome Forissier   * Disallow inputs of length different from the corresponding hash when
21237901324dSJerome Forissier     signing or verifying with PSA_ALG_RSA_PSS (The PSA Crypto API mandates
21247901324dSJerome Forissier     that PSA_ALG_RSA_PSS uses the same hash throughout the algorithm.)
21257901324dSJerome Forissier   * Fix a null pointer dereference when mbedtls_mpi_exp_mod() was called with
21267901324dSJerome Forissier     A=0 represented with 0 limbs. Up to and including Mbed TLS 2.26, this bug
21277901324dSJerome Forissier     could not be triggered by code that constructed A with one of the
21287901324dSJerome Forissier     mbedtls_mpi_read_xxx functions (including in particular TLS code) since
21297901324dSJerome Forissier     those always built an mpi object with at least one limb.
21307901324dSJerome Forissier     Credit to OSS-Fuzz. Fixes #4641.
21317901324dSJerome Forissier   * Fix mbedtls_mpi_gcd(G,A,B) when the value of B is zero. This had no
21327901324dSJerome Forissier     effect on Mbed TLS's internal use of mbedtls_mpi_gcd(), but may affect
21337901324dSJerome Forissier     applications that call mbedtls_mpi_gcd() directly. Fixes #4642.
21347901324dSJerome Forissier   * The PSA API no longer allows the creation or destruction of keys with a
21357901324dSJerome Forissier     read-only lifetime. The persistence level PSA_KEY_PERSISTENCE_READ_ONLY
21367901324dSJerome Forissier     can now only be used as intended, for keys that cannot be modified through
21377901324dSJerome Forissier     normal use of the API.
21387901324dSJerome Forissier   * When MBEDTLS_PSA_CRYPTO_SPM is enabled, crypto_spe.h was not included
21397901324dSJerome Forissier     in all the right places. Include it from crypto_platform.h, which is
21407901324dSJerome Forissier     the natural place. Fixes #4649.
21417901324dSJerome Forissier   * Fix which alert is sent in some cases to conform to the
21427901324dSJerome Forissier     applicable RFC: on an invalid Finished message value, an
21437901324dSJerome Forissier     invalid max_fragment_length extension, or an
21447901324dSJerome Forissier     unsupported extension used by the server.
21457901324dSJerome Forissier   * Correct (change from 12 to 13 bytes) the value of the macro describing the
21467901324dSJerome Forissier     maximum nonce length returned by psa_aead_generate_nonce().
21477901324dSJerome Forissier
21487901324dSJerome ForissierChanges
21497901324dSJerome Forissier   * Fix the setting of the read timeout in the DTLS sample programs.
215032b31808SJens Wiklander   * Add extra printf compiler warning flags to builds.
215132b31808SJens Wiklander   * Fix memsan build false positive in x509_crt.c with clang 11
21527901324dSJerome Forissier   * Alternative implementations of CMAC may now opt to not support 3DES as a
21537901324dSJerome Forissier     CMAC block cipher, and still pass the CMAC self test.
215432b31808SJens Wiklander   * Remove the AES sample application programs/aes/aescrypt2 which shows
215532b31808SJens Wiklander     bad cryptographic practice. Fix #1906.
215632b31808SJens Wiklander   * Remove configs/config-psa-crypto.h, which no longer had any intended
215732b31808SJens Wiklander     differences from the default configuration, but had accidentally diverged.
21587901324dSJerome Forissier   * When building the test suites with GNU make, invoke python3 or python, not
21597901324dSJerome Forissier     python2, which is no longer supported upstream.
216032b31808SJens Wiklander   * fix build failure on MinGW toolchain when __USE_MING_ANSI_STDIO is on.
21617901324dSJerome Forissier     When that flag is on, standard GNU C printf format specifiers
21627901324dSJerome Forissier     should be used.
216332b31808SJens Wiklander   * Replace MBEDTLS_SSL_CID_PADDING_GRANULARITY and
216432b31808SJens Wiklander     MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY with a new single unified option
216532b31808SJens Wiklander     MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY. Fixes #4335.
21667901324dSJerome Forissier   * Reduce the default value of MBEDTLS_ECP_WINDOW_SIZE. This reduces RAM usage
21677901324dSJerome Forissier     during ECC operations at a negligible performance cost.
21687901324dSJerome Forissier   * mbedtls_mpi_read_binary(), mbedtls_mpi_read_binary_le() and
21697901324dSJerome Forissier     mbedtls_mpi_read_string() now construct an mbedtls_mpi object with 0 limbs
21707901324dSJerome Forissier     when their input has length 0. Note that this is an implementation detail
21717901324dSJerome Forissier     and can change at any time, so this change should be transparent, but it
21727901324dSJerome Forissier     may result in mbedtls_mpi_write_binary() or mbedtls_mpi_write_string()
21737901324dSJerome Forissier     now writing an empty string where it previously wrote one or more
21747901324dSJerome Forissier     zero digits when operating from values constructed with an mpi_read
21757901324dSJerome Forissier     function and some mpi operations.
217632b31808SJens Wiklander   * Add CMake package config generation for CMake projects consuming Mbed TLS.
217732b31808SJens Wiklander   * config.h has been split into build_info.h and mbedtls_config.h
217832b31808SJens Wiklander     build_info.h is intended to be included from C code directly, while
217932b31808SJens Wiklander     mbedtls_config.h is intended to be edited by end users wishing to
218032b31808SJens Wiklander     change the build configuration, and should generally only be included from
218132b31808SJens Wiklander     build_info.h.
218232b31808SJens Wiklander   * The handling of MBEDTLS_CONFIG_FILE has been moved into build_info.h.
218332b31808SJens Wiklander   * A config file version symbol, MBEDTLS_CONFIG_VERSION was introduced.
218432b31808SJens Wiklander     Defining it to a particular value will ensure that Mbed TLS interprets
218532b31808SJens Wiklander     the config file in a way that's compatible with the config file format
218632b31808SJens Wiklander     used by the Mbed TLS release whose MBEDTLS_VERSION_NUMBER has the same
218732b31808SJens Wiklander     value.
218832b31808SJens Wiklander     The only value supported by Mbed TLS 3.0.0 is 0x03000000.
218932b31808SJens Wiklander   * Various changes to which alert and/or error code may be returned
219032b31808SJens Wiklander   * during the TLS handshake.
21917901324dSJerome Forissier   * Implicitly add PSA_KEY_USAGE_SIGN_MESSAGE key usage policy flag when
21927901324dSJerome Forissier     PSA_KEY_USAGE_SIGN_HASH flag is set and PSA_KEY_USAGE_VERIFY_MESSAGE flag
21937901324dSJerome Forissier     when PSA_KEY_USAGE_VERIFY_HASH flag is set. This usage flag extension
21947901324dSJerome Forissier     is also applied when loading a key from storage.
21957901324dSJerome Forissier
21967901324dSJerome Forissier= mbed TLS 2.26.0 branch released 2021-03-08
21977901324dSJerome Forissier
21987901324dSJerome ForissierAPI changes
21997901324dSJerome Forissier   * Renamed the PSA Crypto API output buffer size macros to bring them in line
22007901324dSJerome Forissier     with version 1.0.0 of the specification.
22017901324dSJerome Forissier   * The API glue function mbedtls_ecc_group_of_psa() now takes the curve size
22027901324dSJerome Forissier     in bits rather than bytes, with an additional flag to indicate if the
22037901324dSJerome Forissier     size may have been rounded up to a whole number of bytes.
22047901324dSJerome Forissier   * Renamed the PSA Crypto API AEAD tag length macros to bring them in line
22057901324dSJerome Forissier     with version 1.0.0 of the specification.
22067901324dSJerome Forissier
22077901324dSJerome ForissierDefault behavior changes
22087901324dSJerome Forissier   * In mbedtls_rsa_context objects, the ver field was formerly documented
22097901324dSJerome Forissier     as always 0. It is now reserved for internal purposes and may take
22107901324dSJerome Forissier     different values.
22117901324dSJerome Forissier
22127901324dSJerome ForissierNew deprecations
22137901324dSJerome Forissier   * PSA_KEY_EXPORT_MAX_SIZE, PSA_HASH_SIZE, PSA_MAC_FINAL_SIZE,
22147901324dSJerome Forissier     PSA_BLOCK_CIPHER_BLOCK_SIZE, PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE and
22157901324dSJerome Forissier     PSA_ALG_TLS12_PSK_TO_MS_MAX_PSK_LEN have been renamed, and the old names
22167901324dSJerome Forissier     deprecated.
22177901324dSJerome Forissier   * PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH and PSA_ALG_AEAD_WITH_TAG_LENGTH
22187901324dSJerome Forissier     have been renamed, and the old names deprecated.
22197901324dSJerome Forissier
22207901324dSJerome ForissierFeatures
22217901324dSJerome Forissier   * The PSA crypto subsystem can now use HMAC_DRBG instead of CTR_DRBG.
22227901324dSJerome Forissier     CTR_DRBG is used by default if it is available, but you can override
22237901324dSJerome Forissier     this choice by setting MBEDTLS_PSA_HMAC_DRBG_MD_TYPE at compile time.
22247901324dSJerome Forissier     Fix #3354.
22257901324dSJerome Forissier   * Automatic fallback to a software implementation of ECP when
22267901324dSJerome Forissier     MBEDTLS_ECP_xxx_ALT accelerator hooks are in use can now be turned off
22277901324dSJerome Forissier     through setting the new configuration flag MBEDTLS_ECP_NO_FALLBACK.
22287901324dSJerome Forissier   * The PSA crypto subsystem can now be configured to use less static RAM by
22297901324dSJerome Forissier     tweaking the setting for the maximum amount of keys simultaneously in RAM.
22307901324dSJerome Forissier     MBEDTLS_PSA_KEY_SLOT_COUNT sets the maximum number of volatile keys that
22317901324dSJerome Forissier     can exist simultaneously. It has a sensible default if not overridden.
22327901324dSJerome Forissier   * Partial implementation of the PSA crypto driver interface: Mbed TLS can
22337901324dSJerome Forissier     now use an external random generator instead of the library's own
22347901324dSJerome Forissier     entropy collection and DRBG code. Enable MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
22357901324dSJerome Forissier     and see the documentation of mbedtls_psa_external_get_random() for details.
22367901324dSJerome Forissier   * Applications using both mbedtls_xxx and psa_xxx functions (for example,
22377901324dSJerome Forissier     applications using TLS and MBEDTLS_USE_PSA_CRYPTO) can now use the PSA
22387901324dSJerome Forissier     random generator with mbedtls_xxx functions. See the documentation of
22397901324dSJerome Forissier     mbedtls_psa_get_random() for details.
22407901324dSJerome Forissier   * In the PSA API, the policy for a MAC or AEAD algorithm can specify a
22417901324dSJerome Forissier     minimum MAC or tag length thanks to the new wildcards
22427901324dSJerome Forissier     PSA_ALG_AT_LEAST_THIS_LENGTH_MAC and
22437901324dSJerome Forissier     PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG.
22447901324dSJerome Forissier
22457901324dSJerome ForissierSecurity
22467901324dSJerome Forissier   * Fix a security reduction in CTR_DRBG when the initial seeding obtained a
22477901324dSJerome Forissier     nonce from entropy. Applications were affected if they called
22487901324dSJerome Forissier     mbedtls_ctr_drbg_set_nonce_len(), if they called
22497901324dSJerome Forissier     mbedtls_ctr_drbg_set_entropy_len() with a size that was 3/2 times the key
22507901324dSJerome Forissier     length, or when the entropy module uses SHA-256 and CTR_DRBG uses AES-256.
22517901324dSJerome Forissier     In such cases, a random nonce was necessary to achieve the advertised
22527901324dSJerome Forissier     security strength, but the code incorrectly used a constant instead of
22537901324dSJerome Forissier     entropy from the nonce.
22547901324dSJerome Forissier     Found by John Stroebel in #3819 and fixed in #3973.
22557901324dSJerome Forissier   * Fix a buffer overflow in mbedtls_mpi_sub_abs() when calculating
22567901324dSJerome Forissier     |A| - |B| where |B| is larger than |A| and has more limbs (so the
22577901324dSJerome Forissier     function should return MBEDTLS_ERR_MPI_NEGATIVE_VALUE). Only
22587901324dSJerome Forissier     applications calling mbedtls_mpi_sub_abs() directly are affected:
22597901324dSJerome Forissier     all calls inside the library were safe since this function is
22607901324dSJerome Forissier     only called with |A| >= |B|. Reported by Guido Vranken in #4042.
22617901324dSJerome Forissier   * Fix an errorneous estimation for an internal buffer in
22627901324dSJerome Forissier     mbedtls_pk_write_key_pem(). If MBEDTLS_MPI_MAX_SIZE is set to an odd
22637901324dSJerome Forissier     value the function might fail to write a private RSA keys of the largest
22647901324dSJerome Forissier     supported size.
22657901324dSJerome Forissier     Found by Daniel Otte, reported in #4093 and fixed in #4094.
22667901324dSJerome Forissier   * Fix a stack buffer overflow with mbedtls_net_poll() and
22677901324dSJerome Forissier     mbedtls_net_recv_timeout() when given a file descriptor that is
22687901324dSJerome Forissier     beyond FD_SETSIZE. Reported by FigBug in #4169.
22697901324dSJerome Forissier   * Guard against strong local side channel attack against base64 tables by
22707901324dSJerome Forissier     making access aceess to them use constant flow code.
22717901324dSJerome Forissier
22727901324dSJerome ForissierBugfix
22737901324dSJerome Forissier   * Fix use-after-scope error in programs/ssl/ssl_client2.c and ssl_server2.c
22747901324dSJerome Forissier   * Fix memory leak that occured when calling psa_close_key() on a
22757901324dSJerome Forissier     wrapped key with MBEDTLS_PSA_CRYPTO_SE_C defined.
22767901324dSJerome Forissier   * Fix an incorrect error code if an RSA private operation glitched.
22777901324dSJerome Forissier   * Fix a memory leak in an error case in psa_generate_derived_key_internal().
22787901324dSJerome Forissier   * Fix a resource leak in CTR_DRBG and HMAC_DRBG when MBEDTLS_THREADING_C
22797901324dSJerome Forissier     is enabled, on platforms where initializing a mutex allocates resources.
22807901324dSJerome Forissier     This was a regression introduced in the previous release. Reported in
22817901324dSJerome Forissier     #4017, #4045 and #4071.
22827901324dSJerome Forissier   * Ensure that calling mbedtls_rsa_free() or mbedtls_entropy_free()
22837901324dSJerome Forissier     twice is safe. This happens for RSA when some Mbed TLS library functions
22847901324dSJerome Forissier     fail. Such a double-free was not safe when MBEDTLS_THREADING_C was
22857901324dSJerome Forissier     enabled on platforms where freeing a mutex twice is not safe.
22867901324dSJerome Forissier   * Fix a resource leak in a bad-arguments case of mbedtls_rsa_gen_key()
22877901324dSJerome Forissier     when MBEDTLS_THREADING_C is enabled on platforms where initializing
22887901324dSJerome Forissier     a mutex allocates resources.
22897901324dSJerome Forissier   * Fixes a bug where, if the library was configured to include support for
22907901324dSJerome Forissier     both the old SE interface and the new PSA driver interface, external keys were
22917901324dSJerome Forissier     not loaded from storage. This was fixed by #3996.
22927901324dSJerome Forissier   * This change makes 'mbedtls_x509write_crt_set_basic_constraints'
22937901324dSJerome Forissier     consistent with RFC 5280 4.2.1.9 which says: "Conforming CAs MUST
22947901324dSJerome Forissier     include this extension in all CA certificates that contain public keys
22957901324dSJerome Forissier     used to validate digital signatures on certificates and MUST mark the
22967901324dSJerome Forissier     extension as critical in such certificates." Previous to this change,
22977901324dSJerome Forissier     the extension was always marked as non-critical. This was fixed by
22987901324dSJerome Forissier     #3698.
22997901324dSJerome Forissier
23007901324dSJerome ForissierChanges
23017901324dSJerome Forissier   * A new library C file psa_crypto_client.c has been created to contain
23027901324dSJerome Forissier     the PSA code needed by a PSA crypto client when the PSA crypto
23037901324dSJerome Forissier     implementation is not included into the library.
23047901324dSJerome Forissier   * On recent enough versions of FreeBSD and DragonFlyBSD, the entropy module
23057901324dSJerome Forissier     now uses the getrandom syscall instead of reading from /dev/urandom.
23067901324dSJerome Forissier
23077901324dSJerome Forissier= mbed TLS 2.25.0 branch released 2020-12-11
23087901324dSJerome Forissier
23097901324dSJerome ForissierAPI changes
23107901324dSJerome Forissier   * The numerical values of the PSA Crypto API macros have been updated to
23117901324dSJerome Forissier     conform to version 1.0.0 of the specification.
23127901324dSJerome Forissier   * PSA_ALG_STREAM_CIPHER replaces PSA_ALG_CHACHA20 and PSA_ALG_ARC4.
23137901324dSJerome Forissier     The underlying stream cipher is determined by the key type
23147901324dSJerome Forissier     (PSA_KEY_TYPE_CHACHA20 or PSA_KEY_TYPE_ARC4).
23157901324dSJerome Forissier   * The functions mbedtls_cipher_auth_encrypt() and
23167901324dSJerome Forissier     mbedtls_cipher_auth_decrypt() no longer accept NIST_KW contexts,
23177901324dSJerome Forissier     as they have no way to check if the output buffer is large enough.
23187901324dSJerome Forissier     Please use mbedtls_cipher_auth_encrypt_ext() and
23197901324dSJerome Forissier     mbedtls_cipher_auth_decrypt_ext() instead. Credit to OSS-Fuzz and
23207901324dSJerome Forissier     Cryptofuzz. Fixes #3665.
23217901324dSJerome Forissier
23227901324dSJerome ForissierRequirement changes
23237901324dSJerome Forissier   * Update the minimum required CMake version to 2.8.12.  This silences a
23247901324dSJerome Forissier     warning on CMake 3.19.0. #3801
23257901324dSJerome Forissier
23267901324dSJerome ForissierNew deprecations
23277901324dSJerome Forissier   * PSA_ALG_CHACHA20 and PSA_ALG_ARC4 have been deprecated.
23287901324dSJerome Forissier     Use PSA_ALG_STREAM_CIPHER instead.
23297901324dSJerome Forissier   * The functions mbedtls_cipher_auth_encrypt() and
23307901324dSJerome Forissier     mbedtls_cipher_auth_decrypt() are deprecated in favour of the new
23317901324dSJerome Forissier     functions mbedtls_cipher_auth_encrypt_ext() and
23327901324dSJerome Forissier     mbedtls_cipher_auth_decrypt_ext(). Please note that with AEAD ciphers,
23337901324dSJerome Forissier     these new functions always append the tag to the ciphertext, and include
23347901324dSJerome Forissier     the tag in the ciphertext length.
23357901324dSJerome Forissier
23367901324dSJerome ForissierFeatures
23377901324dSJerome Forissier   * Partial implementation of the new PSA Crypto accelerator APIs. (Symmetric
23387901324dSJerome Forissier     ciphers, asymmetric signing/verification and key generation, validate_key
23397901324dSJerome Forissier     entry point, and export_public_key interface.)
23407901324dSJerome Forissier   * Add support for ECB to the PSA cipher API.
23417901324dSJerome Forissier   * In PSA, allow using a key declared with a base key agreement algorithm
23427901324dSJerome Forissier     in combined key agreement and derivation operations, as long as the key
23437901324dSJerome Forissier     agreement algorithm in use matches the algorithm the key was declared with.
23447901324dSJerome Forissier     This is currently non-standard behaviour, but expected to make it into a
23457901324dSJerome Forissier     future revision of the PSA Crypto standard.
23467901324dSJerome Forissier   * Add MBEDTLS_TARGET_PREFIX CMake variable, which is prefixed to the mbedtls,
23477901324dSJerome Forissier     mbedcrypto, mbedx509 and apidoc CMake target names. This can be used by
23487901324dSJerome Forissier     external CMake projects that include this one to avoid CMake target name
23497901324dSJerome Forissier     clashes.  The default value of this variable is "", so default target names
23507901324dSJerome Forissier     are unchanged.
23517901324dSJerome Forissier   * Add support for DTLS-SRTP as defined in RFC 5764. Contributed by Johan
23527901324dSJerome Forissier     Pascal, improved by Ron Eldor.
23537901324dSJerome Forissier   * In the PSA API, it is no longer necessary to open persistent keys:
23547901324dSJerome Forissier     operations now accept the key identifier. The type psa_key_handle_t is now
23557901324dSJerome Forissier     identical to psa_key_id_t instead of being platform-defined. This bridges
23567901324dSJerome Forissier     the last major gap to compliance with the PSA Cryptography specification
23577901324dSJerome Forissier     version 1.0.0. Opening persistent keys is still supported for backward
23587901324dSJerome Forissier     compatibility, but will be deprecated and later removed in future
23597901324dSJerome Forissier     releases.
23607901324dSJerome Forissier   * PSA_AEAD_NONCE_LENGTH, PSA_AEAD_NONCE_MAX_SIZE, PSA_CIPHER_IV_LENGTH and
23617901324dSJerome Forissier     PSA_CIPHER_IV_MAX_SIZE macros have been added as defined in version
23627901324dSJerome Forissier     1.0.0 of the PSA Crypto API specification.
23637901324dSJerome Forissier
23647901324dSJerome ForissierSecurity
23657901324dSJerome Forissier   * The functions mbedtls_cipher_auth_encrypt() and
23667901324dSJerome Forissier     mbedtls_cipher_auth_decrypt() would write past the minimum documented
23677901324dSJerome Forissier     size of the output buffer when used with NIST_KW. As a result, code using
23687901324dSJerome Forissier     those functions as documented with NIST_KW could have a buffer overwrite
23697901324dSJerome Forissier     of up to 15 bytes, with consequences ranging up to arbitrary code
23707901324dSJerome Forissier     execution depending on the location of the output buffer.
23717901324dSJerome Forissier   * Limit the size of calculations performed by mbedtls_mpi_exp_mod to
23727901324dSJerome Forissier     MBEDTLS_MPI_MAX_SIZE to prevent a potential denial of service when
23737901324dSJerome Forissier     generating Diffie-Hellman key pairs. Credit to OSS-Fuzz.
23747901324dSJerome Forissier   * A failure of the random generator was ignored in mbedtls_mpi_fill_random(),
23757901324dSJerome Forissier     which is how most uses of randomization in asymmetric cryptography
23767901324dSJerome Forissier     (including key generation, intermediate value randomization and blinding)
23777901324dSJerome Forissier     are implemented. This could cause failures or the silent use of non-random
23787901324dSJerome Forissier     values. A random generator can fail if it needs reseeding and cannot not
23797901324dSJerome Forissier     obtain entropy, or due to an internal failure (which, for Mbed TLS's own
23807901324dSJerome Forissier     CTR_DRBG or HMAC_DRBG, can only happen due to a misconfiguration).
23817901324dSJerome Forissier   * Fix a compliance issue whereby we were not checking the tag on the
23827901324dSJerome Forissier     algorithm parameters (only the size) when comparing the signature in the
23837901324dSJerome Forissier     description part of the cert to the real signature. This meant that a
23847901324dSJerome Forissier     NULL algorithm parameters entry would look identical to an array of REAL
23857901324dSJerome Forissier     (size zero) to the library and thus the certificate would be considered
23867901324dSJerome Forissier     valid. However, if the parameters do not match in *any* way then the
23877901324dSJerome Forissier     certificate should be considered invalid, and indeed OpenSSL marks these
23887901324dSJerome Forissier     certs as invalid when mbedtls did not.
23897901324dSJerome Forissier     Many thanks to guidovranken who found this issue via differential fuzzing
23907901324dSJerome Forissier     and reported it in #3629.
23917901324dSJerome Forissier   * Zeroising of local buffers and variables which are used for calculations
23927901324dSJerome Forissier     in mbedtls_pkcs5_pbkdf2_hmac(), mbedtls_internal_sha*_process(),
23937901324dSJerome Forissier     mbedtls_internal_md*_process() and mbedtls_internal_ripemd160_process()
23947901324dSJerome Forissier     functions to erase sensitive data from memory. Reported by
23957901324dSJerome Forissier     Johan Malmgren and Johan Uppman Bruce from Sectra.
23967901324dSJerome Forissier
23977901324dSJerome ForissierBugfix
239832b31808SJens Wiklander   * Fix an invalid (but nonzero) return code from mbedtls_pk_parse_subpubkey()
23997901324dSJerome Forissier     when the input has trailing garbage. Fixes #2512.
24007901324dSJerome Forissier   * Fix build failure in configurations where MBEDTLS_USE_PSA_CRYPTO is
24017901324dSJerome Forissier     enabled but ECDSA is disabled. Contributed by jdurkop. Fixes #3294.
24027901324dSJerome Forissier   * Include the psa_constant_names generated source code in the source tree
24037901324dSJerome Forissier     instead of generating it at build time. Fixes #3524.
24047901324dSJerome Forissier   * Fix rsa_prepare_blinding() to retry when the blinding value is not
24057901324dSJerome Forissier     invertible (mod N), instead of returning MBEDTLS_ERR_RSA_RNG_FAILED. This
24067901324dSJerome Forissier     addresses a regression but is rare in practice (approx. 1 in 2/sqrt(N)).
24077901324dSJerome Forissier     Found by Synopsys Coverity, fix contributed by Peter Kolbus (Garmin).
24087901324dSJerome Forissier     Fixes #3647.
24097901324dSJerome Forissier   * Use socklen_t on Android and other POSIX-compliant system
24107901324dSJerome Forissier   * Fix the build when the macro _GNU_SOURCE is defined to a non-empty value.
24117901324dSJerome Forissier     Fix #3432.
24127901324dSJerome Forissier   * Consistently return PSA_ERROR_INVALID_ARGUMENT on invalid cipher input
24137901324dSJerome Forissier     sizes (instead of PSA_ERROR_BAD_STATE in some cases) to make the
24147901324dSJerome Forissier     psa_cipher_* functions compliant with the PSA Crypto API specification.
24157901324dSJerome Forissier   * mbedtls_ecp_curve_list() now lists Curve25519 and Curve448 under the names
24167901324dSJerome Forissier     "x25519" and "x448". These curves support ECDH but not ECDSA. If you need
24177901324dSJerome Forissier     only the curves that support ECDSA, filter the list with
24187901324dSJerome Forissier     mbedtls_ecdsa_can_do().
24197901324dSJerome Forissier   * Fix psa_generate_key() returning an error when asked to generate
24207901324dSJerome Forissier     an ECC key pair on Curve25519 or secp244k1.
24217901324dSJerome Forissier   * Fix psa_key_derivation_output_key() to allow the output of a combined key
24227901324dSJerome Forissier     agreement and subsequent key derivation operation to be used as a key
24237901324dSJerome Forissier     inside of the PSA Crypto core.
24247901324dSJerome Forissier   * Fix handling of EOF against 0xff bytes and on platforms with unsigned
24257901324dSJerome Forissier     chars. Fixes a build failure on platforms where char is unsigned. Fixes
24267901324dSJerome Forissier     #3794.
24277901324dSJerome Forissier   * Fix an off-by-one error in the additional data length check for
24287901324dSJerome Forissier     CCM, which allowed encryption with a non-standard length field.
24297901324dSJerome Forissier     Fixes #3719.
24307901324dSJerome Forissier   * Correct the default IV size for mbedtls_cipher_info_t structures using
24317901324dSJerome Forissier     MBEDTLS_MODE_ECB to 0, since ECB mode ciphers don't use IVs.
24327901324dSJerome Forissier   * Make arc4random_buf available on NetBSD and OpenBSD when _POSIX_C_SOURCE is
24337901324dSJerome Forissier     defined. Fix contributed in #3571.
24347901324dSJerome Forissier   * Fix conditions for including string.h in error.c. Fixes #3866.
24357901324dSJerome Forissier   * psa_set_key_id() now also sets the lifetime to persistent for keys located
24367901324dSJerome Forissier     in a secure element.
24377901324dSJerome Forissier   * Attempting to create a volatile key with a non-zero key identifier now
24387901324dSJerome Forissier     fails. Previously the key identifier was just ignored when creating a
24397901324dSJerome Forissier     volatile key.
24407901324dSJerome Forissier   * Attempting to create or register a key with a key identifier in the vendor
24417901324dSJerome Forissier     range now fails.
24427901324dSJerome Forissier   * Fix build failures on GCC 11. Fixes #3782.
24437901324dSJerome Forissier   * Add missing arguments of debug message in mbedtls_ssl_decrypt_buf.
24447901324dSJerome Forissier   * Fix a memory leak in mbedtls_mpi_sub_abs() when the result was negative
24457901324dSJerome Forissier     (an error condition) and the second operand was aliased to the result.
24467901324dSJerome Forissier   * Fix a case in elliptic curve arithmetic where an out-of-memory condition
24477901324dSJerome Forissier     could go undetected, resulting in an incorrect result.
24487901324dSJerome Forissier   * In CTR_DRBG and HMAC_DRBG, don't reset the reseed interval in seed().
24497901324dSJerome Forissier     Fixes #2927.
24507901324dSJerome Forissier   * In PEM writing functions, fill the trailing part of the buffer with null
24517901324dSJerome Forissier     bytes. This guarantees that the corresponding parsing function can read
24527901324dSJerome Forissier     the buffer back, which was the case for mbedtls_x509write_{crt,csr}_pem
24537901324dSJerome Forissier     until this property was inadvertently broken in Mbed TLS 2.19.0.
24547901324dSJerome Forissier     Fixes #3682.
24557901324dSJerome Forissier   * Fix a build failure that occurred with the MBEDTLS_AES_SETKEY_DEC_ALT
24567901324dSJerome Forissier     option on. In this configuration key management methods that are required
24577901324dSJerome Forissier     for MBEDTLS_CIPHER_MODE_XTS were excluded from the build and made it fail.
24587901324dSJerome Forissier     Fixes #3818. Reported by John Stroebel.
24597901324dSJerome Forissier
24607901324dSJerome ForissierChanges
24617901324dSJerome Forissier   * Reduce stack usage significantly during sliding window exponentiation.
24627901324dSJerome Forissier     Reported in #3591 and fix contributed in #3592 by Daniel Otte.
24637901324dSJerome Forissier   * The PSA persistent storage format is updated to always store the key bits
24647901324dSJerome Forissier     attribute. No automatic upgrade path is provided. Previously stored keys
24657901324dSJerome Forissier     must be erased, or manually upgraded based on the key storage format
24667901324dSJerome Forissier     specification (docs/architecture/mbed-crypto-storage-specification.md).
24677901324dSJerome Forissier     Fixes #3740.
24687901324dSJerome Forissier   * Remove the zeroization of a pointer variable in AES rounds. It was valid
24697901324dSJerome Forissier     but spurious and misleading since it looked like a mistaken attempt to
24707901324dSJerome Forissier     zeroize the pointed-to buffer. Reported by Antonio de la Piedra, CEA
24717901324dSJerome Forissier     Leti, France.
24727901324dSJerome Forissier
24737901324dSJerome Forissier= mbed TLS 2.24.0 branch released 2020-09-01
24747901324dSJerome Forissier
24757901324dSJerome ForissierAPI changes
24767901324dSJerome Forissier   * In the PSA API, rename the types of elliptic curve and Diffie-Hellman
24777901324dSJerome Forissier     group families to psa_ecc_family_t and psa_dh_family_t, in line with the
24787901324dSJerome Forissier     PSA Crypto API specification version 1.0.0.
24797901324dSJerome Forissier     Rename associated macros as well:
24807901324dSJerome Forissier     PSA_ECC_CURVE_xxx renamed to PSA_ECC_FAMILY_xxx
24817901324dSJerome Forissier     PSA_DH_GROUP_xxx renamed to PSA_DH_FAMILY_xxx
24827901324dSJerome Forissier     PSA_KEY_TYPE_GET_CURVE renamed to to PSA_KEY_TYPE_ECC_GET_FAMILY
24837901324dSJerome Forissier     PSA_KEY_TYPE_GET_GROUP renamed to PSA_KEY_TYPE_DH_GET_FAMILY
24847901324dSJerome Forissier
24857901324dSJerome ForissierDefault behavior changes
24867901324dSJerome Forissier   * Stop storing persistent information about externally stored keys created
24877901324dSJerome Forissier     through PSA Crypto with a volatile lifetime. Reported in #3288 and
24887901324dSJerome Forissier     contributed by Steven Cooreman in #3382.
24897901324dSJerome Forissier
24907901324dSJerome ForissierFeatures
24917901324dSJerome Forissier   * The new function mbedtls_ecp_write_key() exports private ECC keys back to
24927901324dSJerome Forissier     a byte buffer. It is the inverse of the existing mbedtls_ecp_read_key().
24937901324dSJerome Forissier   * Support building on e2k (Elbrus) architecture: correctly enable
24947901324dSJerome Forissier     -Wformat-signedness, and fix the code that causes signed-one-bit-field
24957901324dSJerome Forissier     and sign-compare warnings. Contributed by makise-homura (Igor Molchanov)
24967901324dSJerome Forissier     <akemi_homura@kurisa.ch>.
24977901324dSJerome Forissier
24987901324dSJerome ForissierSecurity
24997901324dSJerome Forissier   * Fix a vulnerability in the verification of X.509 certificates when
25007901324dSJerome Forissier     matching the expected common name (the cn argument of
25017901324dSJerome Forissier     mbedtls_x509_crt_verify()) with the actual certificate name: when the
25027901324dSJerome Forissier     subjecAltName extension is present, the expected name was compared to any
25037901324dSJerome Forissier     name in that extension regardless of its type. This means that an
25047901324dSJerome Forissier     attacker could for example impersonate a 4-bytes or 16-byte domain by
25057901324dSJerome Forissier     getting a certificate for the corresponding IPv4 or IPv6 (this would
25067901324dSJerome Forissier     require the attacker to control that IP address, though). Similar attacks
25077901324dSJerome Forissier     using other subjectAltName name types might be possible. Found and
25087901324dSJerome Forissier     reported by kFYatek in #3498.
25097901324dSJerome Forissier   * When checking X.509 CRLs, a certificate was only considered as revoked if
25107901324dSJerome Forissier     its revocationDate was in the past according to the local clock if
25117901324dSJerome Forissier     available. In particular, on builds without MBEDTLS_HAVE_TIME_DATE,
25127901324dSJerome Forissier     certificates were never considered as revoked. On builds with
25137901324dSJerome Forissier     MBEDTLS_HAVE_TIME_DATE, an attacker able to control the local clock (for
25147901324dSJerome Forissier     example, an untrusted OS attacking a secure enclave) could prevent
25157901324dSJerome Forissier     revocation of certificates via CRLs. Fixed by no longer checking the
25167901324dSJerome Forissier     revocationDate field, in accordance with RFC 5280. Reported by
25177901324dSJerome Forissier     yuemonangong in #3340. Reported independently and fixed by
25187901324dSJerome Forissier     Raoul Strackx and Jethro Beekman in #3433.
25197901324dSJerome Forissier   * In (D)TLS record decryption, when using a CBC ciphersuites without the
25207901324dSJerome Forissier     Encrypt-then-Mac extension, use constant code flow memory access patterns
25217901324dSJerome Forissier     to extract and check the MAC. This is an improvement to the existing
25227901324dSJerome Forissier     countermeasure against Lucky 13 attacks. The previous countermeasure was
25237901324dSJerome Forissier     effective against network-based attackers, but less so against local
25247901324dSJerome Forissier     attackers. The new countermeasure defends against local attackers, even
25257901324dSJerome Forissier     if they have access to fine-grained measurements. In particular, this
25267901324dSJerome Forissier     fixes a local Lucky 13 cache attack found and reported by Tuba Yavuz,
25277901324dSJerome Forissier     Farhaan Fowze, Ken (Yihan) Bai, Grant Hernandez, and Kevin Butler
25287901324dSJerome Forissier     (University of Florida) and Dave Tian (Purdue University).
25297901324dSJerome Forissier   * Fix side channel in RSA private key operations and static (finite-field)
25307901324dSJerome Forissier     Diffie-Hellman. An adversary with precise enough timing and memory access
25317901324dSJerome Forissier     information (typically an untrusted operating system attacking a secure
25327901324dSJerome Forissier     enclave) could bypass an existing counter-measure (base blinding) and
25337901324dSJerome Forissier     potentially fully recover the private key.
25347901324dSJerome Forissier   * Fix a 1-byte buffer overread in mbedtls_x509_crl_parse_der().
25357901324dSJerome Forissier     Credit to OSS-Fuzz for detecting the problem and to Philippe Antoine
25367901324dSJerome Forissier     for pinpointing the problematic code.
25377901324dSJerome Forissier   * Zeroising of plaintext buffers in mbedtls_ssl_read() to erase unused
25387901324dSJerome Forissier     application data from memory. Reported in #689 by
25397901324dSJerome Forissier     Johan Uppman Bruce of Sectra.
25407901324dSJerome Forissier
25417901324dSJerome ForissierBugfix
25427901324dSJerome Forissier   * Library files installed after a CMake build no longer have execute
25437901324dSJerome Forissier     permission.
25447901324dSJerome Forissier   * Use local labels in mbedtls_padlock_has_support() to fix an invalid symbol
25457901324dSJerome Forissier     redefinition if the function is inlined.
25467901324dSJerome Forissier     Reported in #3451 and fix contributed in #3452 by okhowang.
25477901324dSJerome Forissier   * Fix the endianness of Curve25519 keys imported/exported through the PSA
25487901324dSJerome Forissier     APIs. psa_import_key and psa_export_key will now correctly expect/output
25497901324dSJerome Forissier     Montgomery keys in little-endian as defined by RFC7748. Contributed by
25507901324dSJerome Forissier     Steven Cooreman in #3425.
25517901324dSJerome Forissier   * Fix build errors when the only enabled elliptic curves are Montgomery
25527901324dSJerome Forissier     curves. Raised by signpainter in #941 and by Taiki-San in #1412. This
25537901324dSJerome Forissier     also fixes missing declarations reported by Steven Cooreman in #1147.
25547901324dSJerome Forissier   * Fix self-test failure when the only enabled short Weierstrass elliptic
25557901324dSJerome Forissier     curve is secp192k1. Fixes #2017.
25567901324dSJerome Forissier   * PSA key import will now correctly import a Curve25519/Curve448 public key
25577901324dSJerome Forissier     instead of erroring out. Contributed by Steven Cooreman in #3492.
25587901324dSJerome Forissier   * Use arc4random_buf on NetBSD instead of rand implementation with cyclical
25597901324dSJerome Forissier     lower bits. Fix contributed in #3540.
25607901324dSJerome Forissier   * Fix a memory leak in mbedtls_md_setup() when using HMAC under low memory
25617901324dSJerome Forissier     conditions. Reported and fix suggested by Guido Vranken in #3486.
25627901324dSJerome Forissier   * Fix bug in redirection of unit test outputs on platforms where stdout is
25637901324dSJerome Forissier     defined as a macro. First reported in #2311 and fix contributed in #3528.
25647901324dSJerome Forissier
25657901324dSJerome ForissierChanges
25667901324dSJerome Forissier   * Only pass -Wformat-signedness to versions of GCC that support it. Reported
25677901324dSJerome Forissier     in #3478 and fix contributed in #3479 by okhowang.
25687901324dSJerome Forissier   * Reduce the stack consumption of mbedtls_x509write_csr_der() which
25697901324dSJerome Forissier     previously could lead to stack overflow on constrained devices.
25707901324dSJerome Forissier     Contributed by Doru Gucea and Simon Leet in #3464.
25717901324dSJerome Forissier   * Undefine the ASSERT macro before defining it locally, in case it is defined
25727901324dSJerome Forissier     in a platform header. Contributed by Abdelatif Guettouche in #3557.
25737901324dSJerome Forissier   * Update copyright notices to use Linux Foundation guidance. As a result,
25747901324dSJerome Forissier     the copyright of contributors other than Arm is now acknowledged, and the
25757901324dSJerome Forissier     years of publishing are no longer tracked in the source files. This also
25767901324dSJerome Forissier     eliminates the need for the lines declaring the files to be part of
25777901324dSJerome Forissier     MbedTLS. Fixes #3457.
25787901324dSJerome Forissier   * Add the command line parameter key_pwd to the ssl_client2 and ssl_server2
25797901324dSJerome Forissier     example applications which allows to provide a password for the key file
25807901324dSJerome Forissier     specified through the existing key_file argument. This allows the use of
25817901324dSJerome Forissier     these applications with password-protected key files. Analogously but for
25827901324dSJerome Forissier     ssl_server2 only, add the command line parameter key_pwd2 which allows to
25837901324dSJerome Forissier     set a password for the key file provided through the existing key_file2
25847901324dSJerome Forissier     argument.
25857901324dSJerome Forissier
25867901324dSJerome Forissier= mbed TLS 2.23.0 branch released 2020-07-01
25877901324dSJerome Forissier
25887901324dSJerome ForissierDefault behavior changes
25897901324dSJerome Forissier   * In the experimental PSA secure element interface, change the encoding of
25907901324dSJerome Forissier     key lifetimes to encode a persistence level and the location. Although C
25917901324dSJerome Forissier     prototypes do not effectively change, code calling
25927901324dSJerome Forissier     psa_register_se_driver() must be modified to pass the driver's location
25937901324dSJerome Forissier     instead of the keys' lifetime. If the library is upgraded on an existing
25947901324dSJerome Forissier     device, keys created with the old lifetime value will not be readable or
25957901324dSJerome Forissier     removable through Mbed TLS after the upgrade.
25967901324dSJerome Forissier
25977901324dSJerome ForissierFeatures
25987901324dSJerome Forissier   * New functions in the error module return constant strings for
25997901324dSJerome Forissier     high- and low-level error codes, complementing mbedtls_strerror()
26007901324dSJerome Forissier     which constructs a string for any error code, including compound
26017901324dSJerome Forissier     ones, but requires a writable buffer. Contributed by Gaurav Aggarwal
26027901324dSJerome Forissier     in #3176.
26037901324dSJerome Forissier   * The new utility programs/ssl/ssl_context_info prints a human-readable
26047901324dSJerome Forissier     dump of an SSL context saved with mbedtls_ssl_context_save().
26057901324dSJerome Forissier   * Add support for midipix, a POSIX layer for Microsoft Windows.
26067901324dSJerome Forissier   * Add new mbedtls_x509_crt_parse_der_with_ext_cb() routine which allows
26077901324dSJerome Forissier     parsing unsupported certificate extensions via user provided callback.
26087901324dSJerome Forissier     Contributed by Nicola Di Lieto <nicola.dilieto@gmail.com> in #3243 as
26097901324dSJerome Forissier     a solution to #3241.
26107901324dSJerome Forissier   * Pass the "certificate policies" extension to the callback supplied to
26117901324dSJerome Forissier     mbedtls_x509_crt_parse_der_with_ext_cb() if it contains unsupported
26127901324dSJerome Forissier     policies (#3419).
26137901324dSJerome Forissier   * Added support to entropy_poll for the kern.arandom syscall supported on
26147901324dSJerome Forissier     some BSD systems. Contributed by Nia Alarie in #3423.
26157901324dSJerome Forissier   * Add support for Windows 2000 in net_sockets. Contributed by opatomic. #3239
26167901324dSJerome Forissier
26177901324dSJerome ForissierSecurity
26187901324dSJerome Forissier   * Fix a side channel vulnerability in modular exponentiation that could
26197901324dSJerome Forissier     reveal an RSA private key used in a secure enclave. Noticed by Sangho Lee,
26207901324dSJerome Forissier     Ming-Wei Shih, Prasun Gera, Taesoo Kim and Hyesoon Kim (Georgia Institute
26217901324dSJerome Forissier     of Technology); and Marcus Peinado (Microsoft Research). Reported by Raoul
26227901324dSJerome Forissier     Strackx (Fortanix) in #3394.
26237901324dSJerome Forissier   * Fix side channel in mbedtls_ecp_check_pub_priv() and
26247901324dSJerome Forissier     mbedtls_pk_parse_key() / mbedtls_pk_parse_keyfile() (when loading a
26257901324dSJerome Forissier     private key that didn't include the uncompressed public key), as well as
26267901324dSJerome Forissier     mbedtls_ecp_mul() / mbedtls_ecp_mul_restartable() when called with a NULL
26277901324dSJerome Forissier     f_rng argument. An attacker with access to precise enough timing and
26287901324dSJerome Forissier     memory access information (typically an untrusted operating system
26297901324dSJerome Forissier     attacking a secure enclave) could fully recover the ECC private key.
26307901324dSJerome Forissier     Found and reported by Alejandro Cabrera Aldaya and Billy Brumley.
26317901324dSJerome Forissier   * Fix issue in Lucky 13 counter-measure that could make it ineffective when
26327901324dSJerome Forissier     hardware accelerators were used (using one of the MBEDTLS_SHAxxx_ALT
26337901324dSJerome Forissier     macros). This would cause the original Lucky 13 attack to be possible in
26347901324dSJerome Forissier     those configurations, allowing an active network attacker to recover
26357901324dSJerome Forissier     plaintext after repeated timing measurements under some conditions.
26367901324dSJerome Forissier     Reported and fix suggested by Luc Perneel in #3246.
26377901324dSJerome Forissier
26387901324dSJerome ForissierBugfix
26397901324dSJerome Forissier   * Fix the Visual Studio Release x64 build configuration for mbedtls itself.
26407901324dSJerome Forissier     Completes a previous fix in Mbed TLS 2.19 that only fixed the build for
26417901324dSJerome Forissier     the example programs. Reported in #1430 and fix contributed by irwir.
26427901324dSJerome Forissier   * Fix undefined behavior in X.509 certificate parsing if the
26437901324dSJerome Forissier     pathLenConstraint basic constraint value is equal to INT_MAX.
26447901324dSJerome Forissier     The actual effect with almost every compiler is the intended
26457901324dSJerome Forissier     behavior, so this is unlikely to be exploitable anywhere. #3192
26467901324dSJerome Forissier   * Fix issue with a detected HW accelerated record error not being exposed
26477901324dSJerome Forissier     due to shadowed variable. Contributed by Sander Visser in #3310.
26487901324dSJerome Forissier   * Avoid NULL pointer dereferencing if mbedtls_ssl_free() is called with a
26497901324dSJerome Forissier     NULL pointer argument. Contributed by Sander Visser in #3312.
26507901324dSJerome Forissier   * Fix potential linker errors on dual world platforms by inlining
26517901324dSJerome Forissier     mbedtls_gcc_group_to_psa(). This allows the pk.c module to link separately
26527901324dSJerome Forissier     from psa_crypto.c. Fixes #3300.
26537901324dSJerome Forissier   * Remove dead code in X.509 certificate parsing. Contributed by irwir in
26547901324dSJerome Forissier     #2855.
26557901324dSJerome Forissier   * Include asn1.h in error.c. Fixes #3328 reported by David Hu.
26567901324dSJerome Forissier   * Fix potential memory leaks in ecp_randomize_jac() and ecp_randomize_mxz()
26577901324dSJerome Forissier     when PRNG function fails. Contributed by Jonas Lejeune in #3318.
26587901324dSJerome Forissier   * Remove unused macros from MSVC projects. Reported in #3297 and fix
26597901324dSJerome Forissier     submitted in #3333 by irwir.
26607901324dSJerome Forissier   * Add additional bounds checks in ssl_write_client_hello() preventing
26617901324dSJerome Forissier     output buffer overflow if the configuration declared a buffer that was
26627901324dSJerome Forissier     too small.
26637901324dSJerome Forissier   * Set _POSIX_C_SOURCE to at least 200112L in C99 code. Reported in #3420 and
26647901324dSJerome Forissier     fix submitted in #3421 by Nia Alarie.
26657901324dSJerome Forissier   * Fix building library/net_sockets.c and the ssl_mail_client program on
26667901324dSJerome Forissier     NetBSD. Contributed by Nia Alarie in #3422.
26677901324dSJerome Forissier   * Fix false positive uninitialised variable reported by cpp-check.
26687901324dSJerome Forissier     Contributed by Sander Visser in #3311.
26697901324dSJerome Forissier   * Update iv and len context pointers manually when reallocating buffers
26707901324dSJerome Forissier     using the MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH feature. This caused issues
26717901324dSJerome Forissier     when receiving a connection with CID, when these fields were shifted
26727901324dSJerome Forissier     in ssl_parse_record_header().
26737901324dSJerome Forissier
26747901324dSJerome ForissierChanges
26757901324dSJerome Forissier   * Fix warnings about signedness issues in format strings. The build is now
26767901324dSJerome Forissier     clean of -Wformat-signedness warnings. Contributed by Kenneth Soerensen
26777901324dSJerome Forissier     in #3153.
26787901324dSJerome Forissier   * Fix minor performance issue in operations on Curve25519 caused by using a
26797901324dSJerome Forissier     suboptimal modular reduction in one place. Found and fix contributed by
26807901324dSJerome Forissier     Aurelien Jarno in #3209.
26817901324dSJerome Forissier   * Combine identical cases in switch statements in md.c. Contributed
26827901324dSJerome Forissier     by irwir in #3208.
26837901324dSJerome Forissier   * Simplify a bounds check in ssl_write_certificate_request(). Contributed
26847901324dSJerome Forissier     by irwir in #3150.
26857901324dSJerome Forissier   * Unify the example programs termination to call mbedtls_exit() instead of
26867901324dSJerome Forissier     using a return command. This has been done to enable customization of the
26877901324dSJerome Forissier     behavior in bare metal environments.
26887901324dSJerome Forissier   * Fix mbedtls_x509_dn_gets to escape non-ASCII characters as "?".
26897901324dSJerome Forissier     Contributed by Koh M. Nakagawa in #3326.
26907901324dSJerome Forissier   * Use FindPython3 when cmake version >= 3.15.0
26917901324dSJerome Forissier   * Abort the ClientHello writing function as soon as some extension doesn't
26927901324dSJerome Forissier     fit into the record buffer. Previously, such extensions were silently
26937901324dSJerome Forissier     dropped. As a consequence, the TLS handshake now fails when the output
26947901324dSJerome Forissier     buffer is not large enough to hold the ClientHello.
2695*c3deb3d6SEtienne Carriere   * The unit tests now rely on header files in framework/tests/include/test and source
2696*c3deb3d6SEtienne Carriere     files in framework/tests/src. When building with make or cmake, the files in
2697*c3deb3d6SEtienne Carriere     framework/tests/src are compiled and the resulting object linked into each test
26987901324dSJerome Forissier     executable.
26997901324dSJerome Forissier   * The ECP module, enabled by `MBEDTLS_ECP_C`, now depends on
27007901324dSJerome Forissier     `MBEDTLS_CTR_DRBG_C` or `MBEDTLS_HMAC_DRBG_C` for some side-channel
27017901324dSJerome Forissier     coutermeasures. If side channels are not a concern, this dependency can
27027901324dSJerome Forissier     be avoided by enabling the new option `MBEDTLS_ECP_NO_INTERNAL_RNG`.
27037901324dSJerome Forissier   * Align MSVC error flag with GCC and Clang. Contributed by Carlos Gomes
27047901324dSJerome Forissier     Martinho. #3147
27057901324dSJerome Forissier   * Remove superfluous assignment in mbedtls_ssl_parse_certificate(). Reported
27067901324dSJerome Forissier     in #3182 and fix submitted by irwir. #3217
27077901324dSJerome Forissier   * Fix typo in XTS tests. Reported and fix submitted by Kxuan. #3319
27087901324dSJerome Forissier
270911fa71b9SJerome Forissier= mbed TLS 2.22.0 branch released 2020-04-14
271011fa71b9SJerome Forissier
271111fa71b9SJerome ForissierNew deprecations
271211fa71b9SJerome Forissier   * Deprecate MBEDTLS_SSL_HW_RECORD_ACCEL that enables function hooks in the
271311fa71b9SJerome Forissier     SSL module for hardware acceleration of individual records.
271411fa71b9SJerome Forissier   * Deprecate mbedtls_ssl_get_max_frag_len() in favour of
271511fa71b9SJerome Forissier     mbedtls_ssl_get_output_max_frag_len() and
271611fa71b9SJerome Forissier     mbedtls_ssl_get_input_max_frag_len() to be more precise about which max
271711fa71b9SJerome Forissier     fragment length is desired.
271811fa71b9SJerome Forissier
271911fa71b9SJerome ForissierSecurity
272011fa71b9SJerome Forissier   * Fix issue in DTLS handling of new associations with the same parameters
272111fa71b9SJerome Forissier     (RFC 6347 section 4.2.8): an attacker able to send forged UDP packets to
272211fa71b9SJerome Forissier     the server could cause it to drop established associations with
272311fa71b9SJerome Forissier     legitimate clients, resulting in a Denial of Service. This could only
272411fa71b9SJerome Forissier     happen when MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE was enabled in config.h
272511fa71b9SJerome Forissier     (which it is by default).
272611fa71b9SJerome Forissier   * Fix side channel in ECC code that allowed an adversary with access to
272711fa71b9SJerome Forissier     precise enough timing and memory access information (typically an
272811fa71b9SJerome Forissier     untrusted operating system attacking a secure enclave) to fully recover
272911fa71b9SJerome Forissier     an ECDSA private key. Found and reported by Alejandro Cabrera Aldaya,
273011fa71b9SJerome Forissier     Billy Brumley and Cesar Pereida Garcia. CVE-2020-10932
273111fa71b9SJerome Forissier   * Fix a potentially remotely exploitable buffer overread in a
273211fa71b9SJerome Forissier     DTLS client when parsing the Hello Verify Request message.
273311fa71b9SJerome Forissier
273411fa71b9SJerome ForissierFeatures
273511fa71b9SJerome Forissier   * The new build option MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH automatically
273611fa71b9SJerome Forissier     resizes the I/O buffers before and after handshakes, reducing the memory
273711fa71b9SJerome Forissier     consumption during application data transfer.
273811fa71b9SJerome Forissier
273911fa71b9SJerome ForissierBugfix
274011fa71b9SJerome Forissier   * Fix compilation failure when both MBEDTLS_SSL_PROTO_DTLS and
274111fa71b9SJerome Forissier     MBEDTLS_SSL_HW_RECORD_ACCEL are enabled.
274211fa71b9SJerome Forissier   * Remove a spurious check in ssl_parse_client_psk_identity that triggered
274311fa71b9SJerome Forissier     a warning with some compilers. Fix contributed by irwir in #2856.
274411fa71b9SJerome Forissier   * Fix a function name in a debug message. Contributed by Ercan Ozturk in
274511fa71b9SJerome Forissier     #3013.
274611fa71b9SJerome Forissier
274711fa71b9SJerome ForissierChanges
274811fa71b9SJerome Forissier   * Mbed Crypto is no longer a Git submodule. The crypto part of the library
274911fa71b9SJerome Forissier     is back directly in the present repository.
275011fa71b9SJerome Forissier   * Split mbedtls_ssl_get_max_frag_len() into
275111fa71b9SJerome Forissier     mbedtls_ssl_get_output_max_frag_len() and
275211fa71b9SJerome Forissier     mbedtls_ssl_get_input_max_frag_len() to ensure that a sufficient input
275311fa71b9SJerome Forissier     buffer is allocated by the server (if MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
275411fa71b9SJerome Forissier     is defined), regardless of what MFL was configured for it.
275511fa71b9SJerome Forissier
275611fa71b9SJerome Forissier= mbed TLS 2.21.0 branch released 2020-02-20
275711fa71b9SJerome Forissier
275811fa71b9SJerome ForissierNew deprecations
275911fa71b9SJerome Forissier   * Deprecate MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO that enables parsing
276011fa71b9SJerome Forissier     SSLv2 ClientHello messages.
276111fa71b9SJerome Forissier   * Deprecate MBEDTLS_SSL_PROTO_SSL3 that enables support for SSLv3.
276211fa71b9SJerome Forissier   * Deprecate for MBEDTLS_PKCS11_C, the wrapper around the pkcs11-helper
276311fa71b9SJerome Forissier     library which allows TLS authentication to use keys stored in a
276411fa71b9SJerome Forissier     PKCS#11 token such as a smartcard.
27655b25c76aSJerome Forissier
27665b25c76aSJerome ForissierSecurity
27675b25c76aSJerome Forissier   * Fix potential memory overread when performing an ECDSA signature
27685b25c76aSJerome Forissier     operation. The overread only happens with cryptographically low
27695b25c76aSJerome Forissier     probability (of the order of 2^-n where n is the bitsize of the curve)
27705b25c76aSJerome Forissier     unless the RNG is broken, and could result in information disclosure or
27715b25c76aSJerome Forissier     denial of service (application crash or extra resource consumption).
27725b25c76aSJerome Forissier     Found by Auke Zeilstra and Peter Schwabe, using static analysis.
27735b25c76aSJerome Forissier   * To avoid a side channel vulnerability when parsing an RSA private key,
27745b25c76aSJerome Forissier     read all the CRT parameters from the DER structure rather than
27755b25c76aSJerome Forissier     reconstructing them. Found by Alejandro Cabrera Aldaya and Billy Bob
27765b25c76aSJerome Forissier     Brumley. Reported and fix contributed by Jack Lloyd.
27775b25c76aSJerome Forissier     ARMmbed/mbed-crypto#352
27785b25c76aSJerome Forissier
277911fa71b9SJerome ForissierFeatures
278011fa71b9SJerome Forissier   * The new build option MBEDTLS_SHA512_NO_SHA384 allows building SHA-512
278111fa71b9SJerome Forissier     support without SHA-384.
278211fa71b9SJerome Forissier
278311fa71b9SJerome ForissierAPI changes
278411fa71b9SJerome Forissier   * Change the encoding of key types and curves in the PSA API. The new
278511fa71b9SJerome Forissier     values are aligned with the upcoming release of the PSA Crypto API
278611fa71b9SJerome Forissier     specification version 1.0.0. The main change which may break some
278711fa71b9SJerome Forissier     existing code is that elliptic curve key types no longer encode the
278811fa71b9SJerome Forissier     exact curve: a psa_ecc_curve_t or psa_key_type_t value only encodes
278911fa71b9SJerome Forissier     a curve family and the key size determines the exact curve (for example,
279011fa71b9SJerome Forissier     PSA_ECC_CURVE_SECP_R1 with 256 bits is P256R1). ARMmbed/mbed-crypto#330
279111fa71b9SJerome Forissier
27925b25c76aSJerome ForissierBugfix
27935b25c76aSJerome Forissier   * Fix an unchecked call to mbedtls_md() in the x509write module.
279411fa71b9SJerome Forissier   * Fix build failure with MBEDTLS_ZLIB_SUPPORT enabled. Reported by
279511fa71b9SJerome Forissier     Jack Lloyd in #2859. Fix submitted by jiblime in #2963.
279611fa71b9SJerome Forissier   * Fix some false-positive uninitialized variable warnings in X.509. Fix
279711fa71b9SJerome Forissier     contributed by apple-ihack-geek in #2663.
279811fa71b9SJerome Forissier   * Fix a possible error code mangling in psa_mac_verify_finish() when
279911fa71b9SJerome Forissier     a cryptographic accelerator fails. ARMmbed/mbed-crypto#345
28005b25c76aSJerome Forissier   * Fix a bug in mbedtls_pk_parse_key() that would cause it to accept some
28015b25c76aSJerome Forissier     RSA keys that would later be rejected by functions expecting private
28025b25c76aSJerome Forissier     keys. Found by Catena cyber using oss-fuzz (issue 20467).
280311fa71b9SJerome Forissier   * Fix a bug in mbedtls_pk_parse_key() that would cause it to
280411fa71b9SJerome Forissier     accept some RSA keys with invalid values by silently fixing those values.
28055b25c76aSJerome Forissier
280611fa71b9SJerome Forissier= mbed TLS 2.20.0 branch released 2020-01-15
280711fa71b9SJerome Forissier
280811fa71b9SJerome ForissierDefault behavior changes
280911fa71b9SJerome Forissier   * The initial seeding of a CTR_DRBG instance makes a second call to the
281011fa71b9SJerome Forissier     entropy function to obtain entropy for a nonce if the entropy size is less
281111fa71b9SJerome Forissier     than 3/2 times the key size. In case you want to disable the extra call to
281211fa71b9SJerome Forissier     grab entropy, you can call mbedtls_ctr_drbg_set_nonce_len() to force the
281311fa71b9SJerome Forissier     nonce length to 0.
28145b25c76aSJerome Forissier
28155b25c76aSJerome ForissierSecurity
281611fa71b9SJerome Forissier   * Enforce that mbedtls_entropy_func() gathers a total of
281711fa71b9SJerome Forissier     MBEDTLS_ENTROPY_BLOCK_SIZE bytes or more from strong sources. In the
281811fa71b9SJerome Forissier     default configuration, on a platform with a single entropy source, the
281911fa71b9SJerome Forissier     entropy module formerly only grabbed 32 bytes, which is good enough for
282011fa71b9SJerome Forissier     security if the source is genuinely strong, but less than the expected 64
282111fa71b9SJerome Forissier     bytes (size of the entropy accumulator).
28225b25c76aSJerome Forissier   * Zeroize local variables in mbedtls_internal_aes_encrypt() and
28235b25c76aSJerome Forissier     mbedtls_internal_aes_decrypt() before exiting the function. The value of
28245b25c76aSJerome Forissier     these variables can be used to recover the last round key. To follow best
28255b25c76aSJerome Forissier     practice and to limit the impact of buffer overread vulnerabilities (like
28265b25c76aSJerome Forissier     Heartbleed) we need to zeroize them before exiting the function.
28275b25c76aSJerome Forissier     Issue reported by Tuba Yavuz, Farhaan Fowze, Ken (Yihang) Bai,
28285b25c76aSJerome Forissier     Grant Hernandez, and Kevin Butler (University of Florida) and
28295b25c76aSJerome Forissier     Dave Tian (Purdue University).
283011fa71b9SJerome Forissier   * Fix side channel vulnerability in ECDSA. Our bignum implementation is not
283111fa71b9SJerome Forissier     constant time/constant trace, so side channel attacks can retrieve the
283211fa71b9SJerome Forissier     blinded value, factor it (as it is smaller than RSA keys and not guaranteed
283311fa71b9SJerome Forissier     to have only large prime factors), and then, by brute force, recover the
283411fa71b9SJerome Forissier     key. Reported by Alejandro Cabrera Aldaya and Billy Brumley.
28355b25c76aSJerome Forissier   * Fix side channel vulnerability in ECDSA key generation. Obtaining precise
28365b25c76aSJerome Forissier     timings on the comparison in the key generation enabled the attacker to
28375b25c76aSJerome Forissier     learn leading bits of the ephemeral key used during ECDSA signatures and to
28385b25c76aSJerome Forissier     recover the private key. Reported by Jeremy Dubeuf.
28395b25c76aSJerome Forissier   * Catch failure of AES functions in mbedtls_ctr_drbg_random(). Uncaught
28405b25c76aSJerome Forissier     failures could happen with alternative implementations of AES. Bug
28415b25c76aSJerome Forissier     reported and fix proposed by Johan Uppman Bruce and Christoffer Lauri,
28425b25c76aSJerome Forissier     Sectra.
28435b25c76aSJerome Forissier
284411fa71b9SJerome ForissierFeatures
284511fa71b9SJerome Forissier   * Key derivation inputs in the PSA API can now either come from a key object
284611fa71b9SJerome Forissier     or from a buffer regardless of the step type.
284711fa71b9SJerome Forissier   * The CTR_DRBG module can grab a nonce from the entropy source during the
284811fa71b9SJerome Forissier     initial seeding. The default nonce length is chosen based on the key size
284911fa71b9SJerome Forissier     to achieve the security strength defined by NIST SP 800-90A. You can
285011fa71b9SJerome Forissier     change it with mbedtls_ctr_drbg_set_nonce_len().
285111fa71b9SJerome Forissier   * Add ENUMERATED tag support to the ASN.1 module. Contributed by
285211fa71b9SJerome Forissier     msopiha-linaro in ARMmbed/mbed-crypto#307.
285311fa71b9SJerome Forissier
285411fa71b9SJerome ForissierAPI changes
285511fa71b9SJerome Forissier   * In the PSA API, forbid zero-length keys. To pass a zero-length input to a
285611fa71b9SJerome Forissier     key derivation function, use a buffer instead (this is now always
285711fa71b9SJerome Forissier     possible).
285811fa71b9SJerome Forissier   * Rename psa_asymmetric_sign() to psa_sign_hash() and
285911fa71b9SJerome Forissier     psa_asymmetric_verify() to psa_verify_hash().
286011fa71b9SJerome Forissier
28615b25c76aSJerome ForissierBugfix
286211fa71b9SJerome Forissier   * Fix an incorrect size in a debugging message. Reported and fix
286311fa71b9SJerome Forissier     submitted by irwir. Fixes #2717.
286411fa71b9SJerome Forissier   * Fix an unused variable warning when compiling without DTLS.
286511fa71b9SJerome Forissier     Reported and fix submitted by irwir. Fixes #2800.
286611fa71b9SJerome Forissier   * Remove a useless assignment. Reported and fix submitted by irwir.
286711fa71b9SJerome Forissier     Fixes #2801.
286811fa71b9SJerome Forissier   * Fix a buffer overflow in the PSA HMAC code when using a long key with an
286911fa71b9SJerome Forissier     unsupported algorithm. Fixes ARMmbed/mbed-crypto#254.
287011fa71b9SJerome Forissier   * Fix mbedtls_asn1_get_int to support any number of leading zeros. Credit
287111fa71b9SJerome Forissier     to OSS-Fuzz for finding a bug in an intermediate version of the fix.
287211fa71b9SJerome Forissier   * Fix mbedtls_asn1_get_bitstring_null to correctly parse bitstrings of at
287311fa71b9SJerome Forissier     most 2 bytes.
287411fa71b9SJerome Forissier   * mbedtls_ctr_drbg_set_entropy_len() and
287511fa71b9SJerome Forissier     mbedtls_hmac_drbg_set_entropy_len() now work if you call them before
287611fa71b9SJerome Forissier     mbedtls_ctr_drbg_seed() or mbedtls_hmac_drbg_seed().
28775b25c76aSJerome Forissier
28785b25c76aSJerome ForissierChanges
287911fa71b9SJerome Forissier   * Remove the technical possibility to define custom mbedtls_md_info
288011fa71b9SJerome Forissier     structures, which was exposed only in an internal header.
288111fa71b9SJerome Forissier   * psa_close_key(0) and psa_destroy_key(0) now succeed (doing nothing, as
288211fa71b9SJerome Forissier     before).
288311fa71b9SJerome Forissier   * Variables containing error codes are now initialized to an error code
288411fa71b9SJerome Forissier     rather than success, so that coding mistakes or memory corruption tends to
288511fa71b9SJerome Forissier     cause functions to return this error code rather than a success. There are
288611fa71b9SJerome Forissier     no known instances where this changes the behavior of the library: this is
288711fa71b9SJerome Forissier     merely a robustness improvement. ARMmbed/mbed-crypto#323
288811fa71b9SJerome Forissier   * Remove a useless call to mbedtls_ecp_group_free(). Contributed by
288911fa71b9SJerome Forissier     Alexander Krizhanovsky in ARMmbed/mbed-crypto#210.
289011fa71b9SJerome Forissier   * Speed up PBKDF2 by caching the digest calculation. Contributed by Jack
289111fa71b9SJerome Forissier     Lloyd and Fortanix Inc in ARMmbed/mbed-crypto#277.
289211fa71b9SJerome Forissier   * Small performance improvement of mbedtls_mpi_div_mpi(). Contributed by
289311fa71b9SJerome Forissier     Alexander Krizhanovsky in ARMmbed/mbed-crypto#308.
28945b25c76aSJerome Forissier
289511fa71b9SJerome Forissier= mbed TLS 2.19.1 branch released 2019-09-16
289611fa71b9SJerome Forissier
289711fa71b9SJerome ForissierFeatures
289811fa71b9SJerome Forissier   * Declare include headers as PUBLIC to propagate to CMake project consumers
289911fa71b9SJerome Forissier     Contributed by Zachary J. Fields in PR #2949.
290011fa71b9SJerome Forissier   * Add nss_keylog to ssl_client2 and ssl_server2, enabling easier analysis of
290111fa71b9SJerome Forissier     TLS sessions with tools like Wireshark.
290211fa71b9SJerome Forissier
290311fa71b9SJerome ForissierAPI Changes
290411fa71b9SJerome Forissier   * Make client_random and server_random const in
290511fa71b9SJerome Forissier     mbedtls_ssl_export_keys_ext_t, so that the key exporter is discouraged
290611fa71b9SJerome Forissier     from modifying the client/server hello.
290711fa71b9SJerome Forissier
290811fa71b9SJerome ForissierBugfix
290911fa71b9SJerome Forissier   * Fix some false-positive uninitialized variable warnings in crypto. Fix
291011fa71b9SJerome Forissier     contributed by apple-ihack-geek in #2663.
291111fa71b9SJerome Forissier
291211fa71b9SJerome Forissier= mbed TLS 2.19.0 branch released 2019-09-06
29135b25c76aSJerome Forissier
29145b25c76aSJerome ForissierSecurity
29155b25c76aSJerome Forissier   * Fix a missing error detection in ECJPAKE. This could have caused a
29165b25c76aSJerome Forissier     predictable shared secret if a hardware accelerator failed and the other
29175b25c76aSJerome Forissier     side of the key exchange had a similar bug.
29185b25c76aSJerome Forissier   * When writing a private EC key, use a constant size for the private
29195b25c76aSJerome Forissier     value, as specified in RFC 5915. Previously, the value was written
29205b25c76aSJerome Forissier     as an ASN.1 INTEGER, which caused the size of the key to leak
29215b25c76aSJerome Forissier     about 1 bit of information on average and could cause the value to be
29225b25c76aSJerome Forissier     1 byte too large for the output buffer.
292311fa71b9SJerome Forissier   * The deterministic ECDSA calculation reused the scheme's HMAC-DRBG to
292411fa71b9SJerome Forissier     implement blinding. Because of this for the same key and message the same
292511fa71b9SJerome Forissier     blinding value was generated. This reduced the effectiveness of the
292611fa71b9SJerome Forissier     countermeasure and leaked information about the private key through side
292711fa71b9SJerome Forissier     channels. Reported by Jack Lloyd.
292811fa71b9SJerome Forissier
292911fa71b9SJerome ForissierFeatures
293011fa71b9SJerome Forissier   * Add new API functions mbedtls_ssl_session_save() and
293111fa71b9SJerome Forissier     mbedtls_ssl_session_load() to allow serializing a session, for example to
293211fa71b9SJerome Forissier     store it in non-volatile storage, and later using it for TLS session
293311fa71b9SJerome Forissier     resumption.
293411fa71b9SJerome Forissier   * Add a new API function mbedtls_ssl_check_record() to allow checking that
293511fa71b9SJerome Forissier     an incoming record is valid, authentic and has not been seen before. This
293611fa71b9SJerome Forissier     feature can be used alongside Connection ID and SSL context serialisation.
293711fa71b9SJerome Forissier     The feature is enabled at compile-time by MBEDTLS_SSL_RECORD_CHECKING
293811fa71b9SJerome Forissier     option.
293911fa71b9SJerome Forissier   * New implementation of X25519 (ECDH using Curve25519) from Project Everest
294011fa71b9SJerome Forissier     (https://project-everest.github.io/). It can be enabled at compile time
294111fa71b9SJerome Forissier     with MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED. This implementation is formally
294211fa71b9SJerome Forissier     verified and significantly faster, but is only supported on x86 platforms
294311fa71b9SJerome Forissier     (32-bit and 64-bit) using GCC, Clang or Visual Studio. Contributed by
294411fa71b9SJerome Forissier     Christoph Wintersteiger from Microsoft Research.
294511fa71b9SJerome Forissier   * Add mbedtls_net_close(), enabling the building of forking servers where
294611fa71b9SJerome Forissier     the parent process closes the client socket and continue accepting, and
294711fa71b9SJerome Forissier     the child process closes the listening socket and handles the client
294811fa71b9SJerome Forissier     socket. Contributed by Robert Larsen in #2803.
29495b25c76aSJerome Forissier
29505b25c76aSJerome ForissierAPI Changes
295111fa71b9SJerome Forissier   * Add DER-encoded test CRTs to library/certs.c, allowing
295211fa71b9SJerome Forissier     the example programs ssl_server2 and ssl_client2 to be run
295311fa71b9SJerome Forissier     if MBEDTLS_FS_IO and MBEDTLS_PEM_PARSE_C are unset. Fixes #2254.
295411fa71b9SJerome Forissier   * The HAVEGE state type now uses uint32_t elements instead of int.
295511fa71b9SJerome Forissier   * The functions mbedtls_ecp_curve_list() and mbedtls_ecp_grp_id_list() now
295611fa71b9SJerome Forissier     list all curves for which at least one of ECDH or ECDSA is supported, not
295711fa71b9SJerome Forissier     just curves for which both are supported. Call mbedtls_ecdsa_can_do() or
295811fa71b9SJerome Forissier     mbedtls_ecdh_can_do() on each result to check whether each algorithm is
295911fa71b9SJerome Forissier     supported.
29605b25c76aSJerome Forissier   * The new function mbedtls_ecdsa_sign_det_ext() is similar to
29615b25c76aSJerome Forissier     mbedtls_ecdsa_sign_det() but allows passing an external RNG for the
29625b25c76aSJerome Forissier     purpose of blinding.
29635b25c76aSJerome Forissier
296411fa71b9SJerome ForissierNew deprecations
296511fa71b9SJerome Forissier   * Deprecate mbedtls_ecdsa_sign_det() in favor of a functions that can take an
296611fa71b9SJerome Forissier     RNG function as an input.
296711fa71b9SJerome Forissier   * Calling mbedtls_ecdsa_write_signature() with NULL as the f_rng argument
296811fa71b9SJerome Forissier     is now deprecated.
296911fa71b9SJerome Forissier
29705b25c76aSJerome ForissierBugfix
297111fa71b9SJerome Forissier   * Fix missing bounds checks in X.509 parsing functions that could
297211fa71b9SJerome Forissier     lead to successful parsing of ill-formed X.509 CRTs. Fixes #2437.
297311fa71b9SJerome Forissier   * Fix multiple X.509 functions previously returning ASN.1 low-level error
297411fa71b9SJerome Forissier     codes to always wrap these codes into X.509 high level error codes before
297511fa71b9SJerome Forissier     returning. Fixes #2431.
29765b25c76aSJerome Forissier   * Fix to allow building test suites with any warning that detects unused
29775b25c76aSJerome Forissier     functions. Fixes #1628.
29785b25c76aSJerome Forissier   * Fix typo in net_would_block(). Fixes #528 reported by github-monoculture.
29795b25c76aSJerome Forissier   * Remove redundant include file in timing.c. Fixes #2640 reported by irwir.
298011fa71b9SJerome Forissier   * Fix build failure when building with mingw on Windows by including
298111fa71b9SJerome Forissier     stdarg.h where needed. Fixes #2656.
29825b25c76aSJerome Forissier   * Fix Visual Studio Release x64 build configuration by inheriting
29835b25c76aSJerome Forissier     PlatformToolset from the project configuration. Fixes #1430 reported by
29845b25c76aSJerome Forissier     irwir.
29855b25c76aSJerome Forissier   * Enable Suite B with subset of ECP curves. Make sure the code compiles even
29865b25c76aSJerome Forissier     if some curves are not defined. Fixes #1591 reported by dbedev.
29875b25c76aSJerome Forissier   * Fix misuse of signed arithmetic in the HAVEGE module. #2598
298811fa71b9SJerome Forissier   * Avoid use of statically sized stack buffers for certificate writing.
298911fa71b9SJerome Forissier     This previously limited the maximum size of DER encoded certificates
299011fa71b9SJerome Forissier     in mbedtls_x509write_crt_der() to 2Kb. Reported by soccerGB in #2631.
299111fa71b9SJerome Forissier   * Fix partial zeroing in x509_get_other_name. Found and fixed by ekse, #2716.
29925b25c76aSJerome Forissier   * Update test certificates that were about to expire. Reported by
29935b25c76aSJerome Forissier     Bernhard M. Wiedemann in #2357.
29945b25c76aSJerome Forissier   * Fix the build on ARMv5TE in ARM mode to not use assembly instructions
29955b25c76aSJerome Forissier     that are only available in Thumb mode. Fix contributed by Aurelien Jarno
29965b25c76aSJerome Forissier     in #2169.
29975b25c76aSJerome Forissier   * Fix propagation of restart contexts in restartable EC operations.
29985b25c76aSJerome Forissier     This could previously lead to segmentation faults in builds using an
29995b25c76aSJerome Forissier     address-sanitizer and enabling but not using MBEDTLS_ECP_RESTARTABLE.
30005b25c76aSJerome Forissier   * Fix memory leak in in mpi_miller_rabin(). Contributed by
30015b25c76aSJerome Forissier     Jens Wiklander <jens.wiklander@linaro.org> in #2363
30025b25c76aSJerome Forissier   * Improve code clarity in x509_crt module, removing false-positive
30035b25c76aSJerome Forissier     uninitialized variable warnings on some recent toolchains (GCC8, etc).
30045b25c76aSJerome Forissier     Discovered and fixed by Andy Gross (Linaro), #2392.
30055b25c76aSJerome Forissier   * Fix bug in endianness conversion in bignum module. This lead to
30065b25c76aSJerome Forissier     functionally incorrect code on bigendian systems which don't have
30075b25c76aSJerome Forissier     __BYTE_ORDER__ defined. Reported by Brendan Shanks. Fixes #2622.
30085b25c76aSJerome Forissier
30095b25c76aSJerome ForissierChanges
301011fa71b9SJerome Forissier   * Replace multiple uses of MD2 by SHA-256 in X.509 test suite. Fixes #821.
30115b25c76aSJerome Forissier   * Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h
30125b25c76aSJerome Forissier     suggests). #2671
30135b25c76aSJerome Forissier   * Make `make clean` clean all programs always. Fixes #1862.
301411fa71b9SJerome Forissier   * Add a Dockerfile and helper scripts (all-in-docker.sh, basic-in-docker.sh,
301511fa71b9SJerome Forissier     docker-env.sh) to simplify running test suites on a Linux host. Contributed
301611fa71b9SJerome Forissier     by Peter Kolbus (Garmin).
301711fa71b9SJerome Forissier   * Add `reproducible` option to `ssl_client2` and `ssl_server2` to enable
301811fa71b9SJerome Forissier     test runs without variability. Contributed by Philippe Antoine (Catena
301911fa71b9SJerome Forissier     cyber) in #2681.
302011fa71b9SJerome Forissier   * Extended .gitignore to ignore Visual Studio artifacts. Fixed by ConfusedSushi.
302111fa71b9SJerome Forissier   * Adds fuzz targets, especially for continuous fuzzing with OSS-Fuzz.
302211fa71b9SJerome Forissier     Contributed by Philippe Antoine (Catena cyber).
302311fa71b9SJerome Forissier   * Remove the crypto part of the library from Mbed TLS. The crypto
302411fa71b9SJerome Forissier     code and tests are now only available via Mbed Crypto, which
302511fa71b9SJerome Forissier     Mbed TLS references as a Git submodule.
30265b25c76aSJerome Forissier
302711fa71b9SJerome Forissier= mbed TLS 2.18.1 branch released 2019-07-12
30285b25c76aSJerome Forissier
30295b25c76aSJerome ForissierBugfix
303011fa71b9SJerome Forissier   * Fix build failure when building with mingw on Windows by including
303111fa71b9SJerome Forissier     stdarg.h where needed. Fixes #2656.
303211fa71b9SJerome Forissier
303311fa71b9SJerome ForissierChanges
303411fa71b9SJerome Forissier   * Enable building of Mbed TLS as a CMake subproject. Suggested and fixed by
303511fa71b9SJerome Forissier     Ashley Duncan in #2609.
303611fa71b9SJerome Forissier
303711fa71b9SJerome Forissier= mbed TLS 2.18.0 branch released 2019-06-11
303811fa71b9SJerome Forissier
303911fa71b9SJerome ForissierFeatures
304011fa71b9SJerome Forissier   * Add the Any Policy certificate policy oid, as defined in
304111fa71b9SJerome Forissier     rfc 5280 section 4.2.1.4.
304211fa71b9SJerome Forissier   * It is now possible to use NIST key wrap mode via the mbedtls_cipher API.
304311fa71b9SJerome Forissier     Contributed by Jack Lloyd and Fortanix Inc.
304411fa71b9SJerome Forissier   * Add the Wi-SUN Field Area Network (FAN) device extended key usage.
304511fa71b9SJerome Forissier   * Add the oid certificate policy x509 extension.
304611fa71b9SJerome Forissier   * It is now possible to perform RSA PKCS v1.5 signatures with RIPEMD-160 digest.
304711fa71b9SJerome Forissier     Contributed by Jack Lloyd and Fortanix Inc.
304811fa71b9SJerome Forissier   * Extend the MBEDTLS_SSL_EXPORT_KEYS to export the handshake randbytes,
304911fa71b9SJerome Forissier     and the used tls-prf.
305011fa71b9SJerome Forissier   * Add public API for tls-prf function, according to requested enum.
305111fa71b9SJerome Forissier   * Add support for parsing otherName entries in the Subject Alternative Name
305211fa71b9SJerome Forissier     X.509 certificate extension, specifically type hardware module name,
305311fa71b9SJerome Forissier     as defined in RFC 4108 section 5.
305411fa71b9SJerome Forissier   * Add support for parsing certificate policies extension, as defined in
305511fa71b9SJerome Forissier     RFC 5280 section 4.2.1.4. Currently, only the "Any Policy" policy is
305611fa71b9SJerome Forissier     supported.
305711fa71b9SJerome Forissier   * List all SAN types in the subject_alt_names field of the certificate.
305811fa71b9SJerome Forissier     Resolves #459.
305911fa71b9SJerome Forissier   * Add support for draft-05 of the Connection ID extension, as specified
306011fa71b9SJerome Forissier     in https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05.
306111fa71b9SJerome Forissier     The Connection ID extension allows to keep DTLS connections beyond the
306211fa71b9SJerome Forissier     lifetime of the underlying transport by adding a connection identifier
306311fa71b9SJerome Forissier     to the DTLS record header. This identifier can be used to associated an
306411fa71b9SJerome Forissier     incoming record with the correct connection data even after the peer has
306511fa71b9SJerome Forissier     changed its IP or port. The feature is enabled at compile-time by setting
306611fa71b9SJerome Forissier     MBEDTLS_SSL_DTLS_CONNECTION_ID (disabled by default), and at run-time
306711fa71b9SJerome Forissier     through the new APIs mbedtls_ssl_conf_cid() and mbedtls_ssl_set_cid().
306811fa71b9SJerome Forissier
306911fa71b9SJerome Forissier
307011fa71b9SJerome ForissierAPI Changes
307111fa71b9SJerome Forissier   * Extend the MBEDTLS_SSL_EXPORT_KEYS to export the handshake randbytes,
307211fa71b9SJerome Forissier     and the used tls-prf.
307311fa71b9SJerome Forissier   * Add public API for tls-prf function, according to requested enum.
307411fa71b9SJerome Forissier
307511fa71b9SJerome ForissierBugfix
30765b25c76aSJerome Forissier   * Fix private key DER output in the key_app_writer example. File contents
30775b25c76aSJerome Forissier     were shifted by one byte, creating an invalid ASN.1 tag. Fixed by
30785b25c76aSJerome Forissier     Christian Walther in #2239.
30795b25c76aSJerome Forissier   * Fix potential memory leak in X.509 self test. Found and fixed by
30805b25c76aSJerome Forissier     Junhwan Park, #2106.
30815b25c76aSJerome Forissier   * Reduce stack usage of hkdf tests. Fixes #2195.
30825b25c76aSJerome Forissier   * Fix 1-byte buffer overflow in mbedtls_mpi_write_string() when
30835b25c76aSJerome Forissier     used with negative inputs. Found by Guido Vranken in #2404. Credit to
30845b25c76aSJerome Forissier     OSS-Fuzz.
30855b25c76aSJerome Forissier   * Fix bugs in the AEAD test suite which would be exposed by ciphers which
30865b25c76aSJerome Forissier     either used both encrypt and decrypt key schedules, or which perform padding.
30875b25c76aSJerome Forissier     GCM and CCM were not affected. Fixed by Jack Lloyd.
30885b25c76aSJerome Forissier   * Fix incorrect default port number in ssl_mail_client example's usage.
30895b25c76aSJerome Forissier     Found and fixed by irwir. #2337
309011fa71b9SJerome Forissier   * Add psa_util.h to test/cpp_dummy_build to fix build_default_make_gcc_and_cxx.
309111fa71b9SJerome Forissier     Fixed by Peter Kolbus (Garmin). #2579
30925b25c76aSJerome Forissier   * Add missing parentheses around parameters in the definition of the
30935b25c76aSJerome Forissier     public macro MBEDTLS_X509_ID_FLAG. This could lead to invalid evaluation
30945b25c76aSJerome Forissier     in case operators binding less strongly than subtraction were used
30955b25c76aSJerome Forissier     for the parameter.
30965b25c76aSJerome Forissier   * Add a check for MBEDTLS_X509_CRL_PARSE_C in ssl_server2, guarding the crl
30975b25c76aSJerome Forissier     sni entry parameter. Reported by inestlerode in #560.
309811fa71b9SJerome Forissier   * Set the next sequence of the subject_alt_name to NULL when deleting
309911fa71b9SJerome Forissier     sequence on failure. Found and fix suggested by Philippe Antoine.
310011fa71b9SJerome Forissier     Credit to OSS-Fuzz.
31015b25c76aSJerome Forissier
31025b25c76aSJerome ForissierChanges
310311fa71b9SJerome Forissier   * Server's RSA certificate in certs.c was SHA-1 signed. In the default
310411fa71b9SJerome Forissier     mbedTLS configuration only SHA-2 signed certificates are accepted.
310511fa71b9SJerome Forissier     This certificate is used in the demo server programs, which lead the
310611fa71b9SJerome Forissier     client programs to fail at the peer's certificate verification
310711fa71b9SJerome Forissier     due to an unacceptable hash signature. The certificate has been
310811fa71b9SJerome Forissier     updated to one that is SHA-256 signed. Fix contributed by
310911fa71b9SJerome Forissier     Illya Gerasymchuk.
31105b25c76aSJerome Forissier   * Return from various debugging routines immediately if the
31115b25c76aSJerome Forissier     provided SSL context is unset.
31125b25c76aSJerome Forissier   * Remove dead code from bignum.c in the default configuration.
31135b25c76aSJerome Forissier     Found by Coverity, reported and fixed by Peter Kolbus (Garmin). Fixes #2309.
31145b25c76aSJerome Forissier   * Add test for minimal value of MBEDTLS_MPI_WINDOW_SIZE to all.sh.
31155b25c76aSJerome Forissier     Contributed by Peter Kolbus (Garmin).
31165b25c76aSJerome Forissier   * Change wording in the `mbedtls_ssl_conf_max_frag_len()`'s documentation to
31175b25c76aSJerome Forissier     improve clarity. Fixes #2258.
31185b25c76aSJerome Forissier
311911fa71b9SJerome Forissier= mbed TLS 2.17.0 branch released 2019-03-19
31205b25c76aSJerome Forissier
31215b25c76aSJerome ForissierFeatures
312211fa71b9SJerome Forissier   * Add a new X.509 API call `mbedtls_x509_parse_der_nocopy()`
312311fa71b9SJerome Forissier     which allows copy-less parsing of DER encoded X.509 CRTs,
312411fa71b9SJerome Forissier     at the cost of additional lifetime constraints on the input
312511fa71b9SJerome Forissier     buffer, but at the benefit of reduced RAM consumption.
312611fa71b9SJerome Forissier   * Add a new function mbedtls_asn1_write_named_bitstring() to write ASN.1
312711fa71b9SJerome Forissier     named bitstring in DER as required by RFC 5280 Appendix B.
31285b25c76aSJerome Forissier   * Add MBEDTLS_REMOVE_3DES_CIPHERSUITES to allow removing 3DES ciphersuites
31295b25c76aSJerome Forissier     from the default list (enabled by default). See
31305b25c76aSJerome Forissier     https://sweet32.info/SWEET32_CCS16.pdf.
31315b25c76aSJerome Forissier
313211fa71b9SJerome ForissierAPI Changes
313311fa71b9SJerome Forissier   * Add a new X.509 API call `mbedtls_x509_parse_der_nocopy()`.
313411fa71b9SJerome Forissier     See the Features section for more information.
313511fa71b9SJerome Forissier   * Allow to opt in to the removal the API mbedtls_ssl_get_peer_cert()
313611fa71b9SJerome Forissier     for the benefit of saving RAM, by disabling the new compile-time
313711fa71b9SJerome Forissier     option MBEDTLS_SSL_KEEP_PEER_CERTIFICATE (enabled by default for
313811fa71b9SJerome Forissier     API stability). Disabling this option makes mbedtls_ssl_get_peer_cert()
313911fa71b9SJerome Forissier     always return NULL, and removes the peer_cert field from the
314011fa71b9SJerome Forissier     mbedtls_ssl_session structure which otherwise stores the peer's
314111fa71b9SJerome Forissier     certificate.
314211fa71b9SJerome Forissier
314311fa71b9SJerome ForissierSecurity
314411fa71b9SJerome Forissier   * Make mbedtls_ecdh_get_params return an error if the second key
314511fa71b9SJerome Forissier     belongs to a different group from the first. Before, if an application
314611fa71b9SJerome Forissier     passed keys that belonged to different group, the first key's data was
314711fa71b9SJerome Forissier     interpreted according to the second group, which could lead to either
314811fa71b9SJerome Forissier     an error or a meaningless output from mbedtls_ecdh_get_params. In the
314911fa71b9SJerome Forissier     latter case, this could expose at most 5 bits of the private key.
315011fa71b9SJerome Forissier
31515b25c76aSJerome ForissierBugfix
31525b25c76aSJerome Forissier   * Fix a compilation issue with mbedtls_ecp_restart_ctx not being defined
31535b25c76aSJerome Forissier     when MBEDTLS_ECP_ALT is defined. Reported by jwhui. Fixes #2242.
31545b25c76aSJerome Forissier   * Run the AD too long test only if MBEDTLS_CCM_ALT is not defined.
31555b25c76aSJerome Forissier     Raised as a comment in #1996.
31565b25c76aSJerome Forissier   * Reduce the stack consumption of mbedtls_mpi_fill_random() which could
31575b25c76aSJerome Forissier     previously lead to a stack overflow on constrained targets.
31585b25c76aSJerome Forissier   * Add `MBEDTLS_SELF_TEST` for the mbedtls_self_test functions
31595b25c76aSJerome Forissier     in the header files, which missed the precompilation check. #971
316011fa71b9SJerome Forissier   * Fix returning the value 1 when mbedtls_ecdsa_genkey failed.
316111fa71b9SJerome Forissier   * Remove a duplicate #include in a sample program. Fixed by Masashi Honma #2326.
316211fa71b9SJerome Forissier   * Remove the mbedtls namespacing from the header file, to fix a "file not found"
316311fa71b9SJerome Forissier     build error. Fixed by Haijun Gu #2319.
31645b25c76aSJerome Forissier   * Fix signed-to-unsigned integer conversion warning
31655b25c76aSJerome Forissier     in X.509 module. Fixes #2212.
31665b25c76aSJerome Forissier   * Reduce stack usage of `mpi_write_hlp()` by eliminating recursion.
31675b25c76aSJerome Forissier     Fixes #2190.
31685b25c76aSJerome Forissier   * Fix false failure in all.sh when backup files exist in include/mbedtls
31695b25c76aSJerome Forissier     (e.g. config.h.bak). Fixed by Peter Kolbus (Garmin) #2407.
31705b25c76aSJerome Forissier   * Ensure that unused bits are zero when writing ASN.1 bitstrings when using
31715b25c76aSJerome Forissier     mbedtls_asn1_write_bitstring().
31725b25c76aSJerome Forissier   * Fix issue when writing the named bitstrings in KeyUsage and NsCertType
31735b25c76aSJerome Forissier     extensions in CSRs and CRTs that caused these bitstrings to not be encoded
31745b25c76aSJerome Forissier     correctly as trailing zeroes were not accounted for as unused bits in the
31755b25c76aSJerome Forissier     leading content octet. Fixes #1610.
31765b25c76aSJerome Forissier
31775b25c76aSJerome ForissierChanges
317811fa71b9SJerome Forissier   * Reduce RAM consumption during session renegotiation by not storing
317911fa71b9SJerome Forissier     the peer CRT chain and session ticket twice.
31805b25c76aSJerome Forissier   * Include configuration file in all header files that use configuration,
31815b25c76aSJerome Forissier     instead of relying on other header files that they include.
31825b25c76aSJerome Forissier     Inserted as an enhancement for #1371
31835b25c76aSJerome Forissier   * Add support for alternative CSR headers, as used by Microsoft and defined
31845b25c76aSJerome Forissier     in RFC 7468. Found by Michael Ernst. Fixes #767.
318511fa71b9SJerome Forissier   * Correct many misspellings. Fixed by MisterDA #2371.
318611fa71b9SJerome Forissier   * Provide an abstraction of vsnprintf to allow alternative implementations
318711fa71b9SJerome Forissier     for platforms that don't provide it. Based on contributions by Joris Aerts
318811fa71b9SJerome Forissier     and Nathaniel Wesley Filardo.
318911fa71b9SJerome Forissier   * Fix clobber list in MIPS assembly for large integer multiplication.
319011fa71b9SJerome Forissier     Previously, this could lead to functionally incorrect assembly being
319111fa71b9SJerome Forissier     produced by some optimizing compilers, showing up as failures in
319211fa71b9SJerome Forissier     e.g. RSA or ECC signature operations. Reported in #1722, fix suggested
319311fa71b9SJerome Forissier     by Aurelien Jarno and submitted by Jeffrey Martin.
31945b25c76aSJerome Forissier   * Reduce the complexity of the timing tests. They were assuming more than the
31955b25c76aSJerome Forissier     underlying OS actually guarantees.
319611fa71b9SJerome Forissier   * Fix configuration queries in ssl-opt.h. #2030
319711fa71b9SJerome Forissier   * Ensure that ssl-opt.h can be run in OS X. #2029
31985b25c76aSJerome Forissier   * Re-enable certain interoperability tests in ssl-opt.sh which had previously
31995b25c76aSJerome Forissier     been disabled for lack of a sufficiently recent version of GnuTLS on the CI.
32005b25c76aSJerome Forissier   * Ciphersuites based on 3DES now have the lowest priority by default when
32015b25c76aSJerome Forissier     they are enabled.
32025b25c76aSJerome Forissier
32033d3b0591SJens Wiklander= mbed TLS 2.16.0 branch released 2018-12-21
32043d3b0591SJens Wiklander
32053d3b0591SJens WiklanderFeatures
32063d3b0591SJens Wiklander   * Add a new config.h option of MBEDTLS_CHECK_PARAMS that enables validation
32073d3b0591SJens Wiklander     of parameters in the API. This allows detection of obvious misuses of the
32083d3b0591SJens Wiklander     API, such as passing NULL pointers. The API of existing functions hasn't
32093d3b0591SJens Wiklander     changed, but requirements on parameters have been made more explicit in
32103d3b0591SJens Wiklander     the documentation. See the corresponding API documentation for each
32113d3b0591SJens Wiklander     function to see for which parameter values it is defined. This feature is
32123d3b0591SJens Wiklander     disabled by default. See its API documentation in config.h for additional
32133d3b0591SJens Wiklander     steps you have to take when enabling it.
32143d3b0591SJens Wiklander
32153d3b0591SJens WiklanderAPI Changes
32163d3b0591SJens Wiklander   * The following functions in the random generator modules have been
32173d3b0591SJens Wiklander     deprecated and replaced as shown below. The new functions change
32183d3b0591SJens Wiklander     the return type from void to int to allow returning error codes when
32193d3b0591SJens Wiklander     using MBEDTLS_<MODULE>_ALT for the underlying AES or message digest
32203d3b0591SJens Wiklander     primitive. Fixes #1798.
32213d3b0591SJens Wiklander     mbedtls_ctr_drbg_update() -> mbedtls_ctr_drbg_update_ret()
32223d3b0591SJens Wiklander     mbedtls_hmac_drbg_update() -> mbedtls_hmac_drbg_update_ret()
32233d3b0591SJens Wiklander   * Extend ECDH interface to enable alternative implementations.
32243d3b0591SJens Wiklander   * Deprecate error codes of the form MBEDTLS_ERR_xxx_INVALID_KEY_LENGTH for
32253d3b0591SJens Wiklander     ARIA, CAMELLIA and Blowfish. These error codes will be replaced by
32263d3b0591SJens Wiklander     the more generic per-module error codes MBEDTLS_ERR_xxx_BAD_INPUT_DATA.
32273d3b0591SJens Wiklander   * Additional parameter validation checks have been added for the following
32283d3b0591SJens Wiklander     modules - AES, ARIA, Blowfish, CAMELLIA, CCM, GCM, DHM, ECP, ECDSA, ECDH,
32293d3b0591SJens Wiklander     ECJPAKE, SHA, Chacha20 and Poly1305, cipher, pk, RSA, and MPI.
32303d3b0591SJens Wiklander     Where modules have had parameter validation added, existing parameter
32313d3b0591SJens Wiklander     checks may have changed. Some modules, such as Chacha20 had existing
32323d3b0591SJens Wiklander     parameter validation whereas other modules had little. This has now been
32333d3b0591SJens Wiklander     changed so that the same level of validation is present in all modules, and
32343d3b0591SJens Wiklander     that it is now optional with the MBEDTLS_CHECK_PARAMS flag which by default
32353d3b0591SJens Wiklander     is off. That means that checks which were previously present by default
32363d3b0591SJens Wiklander     will no longer be.
32373d3b0591SJens Wiklander
32383d3b0591SJens WiklanderNew deprecations
32393d3b0591SJens Wiklander   * Deprecate mbedtls_ctr_drbg_update and mbedtls_hmac_drbg_update
32403d3b0591SJens Wiklander     in favor of functions that can return an error code.
3241817466cbSJens Wiklander
3242817466cbSJens WiklanderBugfix
32433d3b0591SJens Wiklander   * Fix for Clang, which was reporting a warning for the bignum.c inline
32443d3b0591SJens Wiklander     assembly for AMD64 targets creating string literals greater than those
32453d3b0591SJens Wiklander     permitted by the ISO C99 standard. Found by Aaron Jones. Fixes #482.
32463d3b0591SJens Wiklander   * Fix runtime error in `mbedtls_platform_entropy_poll()` when run
32473d3b0591SJens Wiklander     through qemu user emulation. Reported and fix suggested by randombit
32483d3b0591SJens Wiklander     in #1212. Fixes #1212.
32493d3b0591SJens Wiklander   * Fix an unsafe bounds check when restoring an SSL session from a ticket.
32503d3b0591SJens Wiklander     This could lead to a buffer overflow, but only in case ticket authentication
32513d3b0591SJens Wiklander     was broken. Reported and fix suggested by Guido Vranken in #659.
32523d3b0591SJens Wiklander   * Add explicit integer to enumeration type casts to example program
32533d3b0591SJens Wiklander     programs/pkey/gen_key which previously led to compilation failure
32543d3b0591SJens Wiklander     on some toolchains. Reported by phoenixmcallister. Fixes #2170.
32553d3b0591SJens Wiklander   * Fix double initialization of ECC hardware that made some accelerators
32563d3b0591SJens Wiklander     hang.
32573d3b0591SJens Wiklander   * Clarify documentation of mbedtls_ssl_set_own_cert() regarding the absence
32583d3b0591SJens Wiklander     of check for certificate/key matching. Reported by Attila Molnar, #507.
32593d3b0591SJens Wiklander
326011fa71b9SJerome Forissier = mbed TLS 2.15.1 branch released 2018-11-30
326111fa71b9SJerome Forissier
326211fa71b9SJerome Forissier Changes
326311fa71b9SJerome Forissier    * Update the Mbed Crypto submodule to version 0.1.0b2.
326411fa71b9SJerome Forissier
326511fa71b9SJerome Forissier = mbed TLS 2.15.0 branch released 2018-11-23
326611fa71b9SJerome Forissier
326711fa71b9SJerome Forissier Features
326811fa71b9SJerome Forissier    * Add an experimental build option, USE_CRYPTO_SUBMODULE, to enable use of
326911fa71b9SJerome Forissier      Mbed Crypto as the source of the cryptography implementation.
327011fa71b9SJerome Forissier    * Add an experimental configuration option, MBEDTLS_PSA_CRYPTO_C, to enable
327111fa71b9SJerome Forissier      the PSA Crypto API from Mbed Crypto when additionally used with the
327211fa71b9SJerome Forissier      USE_CRYPTO_SUBMODULE build option.
327311fa71b9SJerome Forissier
327411fa71b9SJerome Forissier Changes
327511fa71b9SJerome Forissier    * Add unit tests for AES-GCM when called through mbedtls_cipher_auth_xxx()
327611fa71b9SJerome Forissier      from the cipher abstraction layer. Fixes #2198.
327711fa71b9SJerome Forissier
32783d3b0591SJens Wiklander= mbed TLS 2.14.1 branch released 2018-11-30
32793d3b0591SJens Wiklander
32803d3b0591SJens WiklanderSecurity
32813d3b0591SJens Wiklander   * Fix timing variations and memory access variations in RSA PKCS#1 v1.5
32823d3b0591SJens Wiklander     decryption that could lead to a Bleichenbacher-style padding oracle
32833d3b0591SJens Wiklander     attack. In TLS, this affects servers that accept ciphersuites based on
32843d3b0591SJens Wiklander     RSA decryption (i.e. ciphersuites whose name contains RSA but not
32853d3b0591SJens Wiklander     (EC)DH(E)). Discovered by Eyal Ronen (Weizmann Institute),  Robert Gillham
32863d3b0591SJens Wiklander     (University of Adelaide), Daniel Genkin (University of Michigan),
32873d3b0591SJens Wiklander     Adi Shamir (Weizmann Institute), David Wong (NCC Group), and Yuval Yarom
32883d3b0591SJens Wiklander     (University of Adelaide, Data61). The attack is described in more detail
32893d3b0591SJens Wiklander     in the paper available here: http://cat.eyalro.net/cat.pdf  CVE-2018-19608
32903d3b0591SJens Wiklander   * In mbedtls_mpi_write_binary(), don't leak the exact size of the number
32913d3b0591SJens Wiklander     via branching and memory access patterns. An attacker who could submit
32923d3b0591SJens Wiklander     a plaintext for RSA PKCS#1 v1.5 decryption but only observe the timing
32933d3b0591SJens Wiklander     of the decryption and not its result could nonetheless decrypt RSA
32943d3b0591SJens Wiklander     plaintexts and forge RSA signatures. Other asymmetric algorithms may
32953d3b0591SJens Wiklander     have been similarly vulnerable. Reported by Eyal Ronen, Robert Gillham,
32963d3b0591SJens Wiklander     Daniel Genkin, Adi Shamir, David Wong and Yuval Yarom.
32973d3b0591SJens Wiklander   * Wipe sensitive buffers on the stack in the CTR_DRBG and HMAC_DRBG
32983d3b0591SJens Wiklander     modules.
32993d3b0591SJens Wiklander
33003d3b0591SJens WiklanderAPI Changes
33013d3b0591SJens Wiklander   * The new functions mbedtls_ctr_drbg_update_ret() and
33023d3b0591SJens Wiklander     mbedtls_hmac_drbg_update_ret() are similar to mbedtls_ctr_drbg_update()
33033d3b0591SJens Wiklander     and mbedtls_hmac_drbg_update() respectively, but the new functions
33043d3b0591SJens Wiklander     report errors whereas the old functions return void. We recommend that
33053d3b0591SJens Wiklander     applications use the new functions.
33063d3b0591SJens Wiklander
33073d3b0591SJens Wiklander= mbed TLS 2.14.0 branch released 2018-11-19
33083d3b0591SJens Wiklander
33093d3b0591SJens WiklanderSecurity
33103d3b0591SJens Wiklander   * Fix overly strict DN comparison when looking for CRLs belonging to a
33113d3b0591SJens Wiklander     particular CA. This previously led to ignoring CRLs when the CRL's issuer
33123d3b0591SJens Wiklander     name and the CA's subject name differed in their string encoding (e.g.,
33133d3b0591SJens Wiklander     one using PrintableString and the other UTF8String) or in the choice of
33143d3b0591SJens Wiklander     upper and lower case. Reported by Henrik Andersson of Bosch GmbH in issue
33153d3b0591SJens Wiklander     #1784.
33163d3b0591SJens Wiklander   * Fix a flawed bounds check in server PSK hint parsing. In case the
33173d3b0591SJens Wiklander     incoming message buffer was placed within the first 64KiB of address
33183d3b0591SJens Wiklander     space and a PSK-(EC)DHE ciphersuite was used, this allowed an attacker
33193d3b0591SJens Wiklander     to trigger a memory access up to 64KiB beyond the incoming message buffer,
33203d3b0591SJens Wiklander     potentially leading to an application crash or information disclosure.
33213d3b0591SJens Wiklander   * Fix mbedtls_mpi_is_prime() to use more rounds of probabilistic testing. The
33223d3b0591SJens Wiklander     previous settings for the number of rounds made it practical for an
33233d3b0591SJens Wiklander     adversary to construct non-primes that would be erroneously accepted as
33243d3b0591SJens Wiklander     primes with high probability. This does not have an impact on the
33253d3b0591SJens Wiklander     security of TLS, but can matter in other contexts with numbers chosen
33263d3b0591SJens Wiklander     potentially by an adversary that should be prime and can be validated.
33273d3b0591SJens Wiklander     For example, the number of rounds was enough to securely generate RSA key
33283d3b0591SJens Wiklander     pairs or Diffie-Hellman parameters, but was insufficient to validate
33293d3b0591SJens Wiklander     Diffie-Hellman parameters properly.
33303d3b0591SJens Wiklander     See "Prime and Prejudice" by by Martin R. Albrecht and Jake Massimo and
33313d3b0591SJens Wiklander     Kenneth G. Paterson and Juraj Somorovsky.
33323d3b0591SJens Wiklander
33333d3b0591SJens WiklanderFeatures
33343d3b0591SJens Wiklander   * Add support for temporarily suspending expensive ECC computations after
33353d3b0591SJens Wiklander     some configurable amount of operations. This is intended to be used in
33363d3b0591SJens Wiklander     constrained, single-threaded systems where ECC is time consuming and can
33373d3b0591SJens Wiklander     block other operations until they complete. This is disabled by default,
33383d3b0591SJens Wiklander     but can be enabled by MBEDTLS_ECP_RESTARTABLE at compile time and
33393d3b0591SJens Wiklander     configured by mbedtls_ecp_set_max_ops() at runtime. It applies to the new
33403d3b0591SJens Wiklander     xxx_restartable functions in ECP, ECDSA, PK and X.509 (CRL not supported
33413d3b0591SJens Wiklander     yet), and to existing functions in ECDH and SSL (currently only
33423d3b0591SJens Wiklander     implemented client-side, for ECDHE-ECDSA ciphersuites in TLS 1.2,
33433d3b0591SJens Wiklander     including client authentication).
33443d3b0591SJens Wiklander   * Add support for Arm CPU DSP extensions to accelerate asymmetric key
33453d3b0591SJens Wiklander     operations. On CPUs where the extensions are available, they can accelerate
33463d3b0591SJens Wiklander     MPI multiplications used in ECC and RSA cryptography. Contributed by
33473d3b0591SJens Wiklander     Aurelien Jarno.
33483d3b0591SJens Wiklander   * Extend RSASSA-PSS signature to allow a smaller salt size. Previously, PSS
33493d3b0591SJens Wiklander     signature always used a salt with the same length as the hash, and returned
33503d3b0591SJens Wiklander     an error if this was not possible. Now the salt size may be up to two bytes
33513d3b0591SJens Wiklander     shorter. This allows the library to support all hash and signature sizes
33523d3b0591SJens Wiklander     that comply with FIPS 186-4, including SHA-512 with a 1024-bit key.
33533d3b0591SJens Wiklander   * Add support for 128-bit keys in CTR_DRBG. Note that using keys shorter
33543d3b0591SJens Wiklander     than 256 bits limits the security of generated material to 128 bits.
33553d3b0591SJens Wiklander
33563d3b0591SJens WiklanderAPI Changes
33573d3b0591SJens Wiklander   * Add a common error code of `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` for
33583d3b0591SJens Wiklander     a feature that is not supported by underlying alternative
33593d3b0591SJens Wiklander     implementations implementing cryptographic primitives. This is useful for
33603d3b0591SJens Wiklander     hardware accelerators that don't implement all options or features.
33613d3b0591SJens Wiklander
33623d3b0591SJens WiklanderNew deprecations
33633d3b0591SJens Wiklander   * All module specific errors following the form
33643d3b0591SJens Wiklander     MBEDTLS_ERR_XXX_FEATURE_UNAVAILABLE that indicate a feature is not
33653d3b0591SJens Wiklander     supported are deprecated and are now replaced by the new equivalent
33663d3b0591SJens Wiklander     platform error.
33673d3b0591SJens Wiklander   * All module specific generic hardware acceleration errors following the
33683d3b0591SJens Wiklander     form MBEDTLS_ERR_XXX_HW_ACCEL_FAILED that are deprecated and are replaced
33693d3b0591SJens Wiklander     by the equivalent plaform error.
33703d3b0591SJens Wiklander   * Deprecate the function mbedtls_mpi_is_prime() in favor of
33713d3b0591SJens Wiklander     mbedtls_mpi_is_prime_ext() which allows specifying the number of
33723d3b0591SJens Wiklander     Miller-Rabin rounds.
33733d3b0591SJens Wiklander
33743d3b0591SJens WiklanderBugfix
33753d3b0591SJens Wiklander   * Fix wrong order of freeing in programs/ssl/ssl_server2 example
33763d3b0591SJens Wiklander     application leading to a memory leak in case both
33773d3b0591SJens Wiklander     MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE are set.
33783d3b0591SJens Wiklander     Fixes #2069.
33793d3b0591SJens Wiklander   * Fix a bug in the update function for SSL ticket keys which previously
33803d3b0591SJens Wiklander     invalidated keys of a lifetime of less than a 1s. Fixes #1968.
33813d3b0591SJens Wiklander   * Fix failure in hmac_drbg in the benchmark sample application, when
33823d3b0591SJens Wiklander     MBEDTLS_THREADING_C is defined. Found by TrinityTonic, #1095
33833d3b0591SJens Wiklander   * Fix a bug in the record decryption routine ssl_decrypt_buf()
33843d3b0591SJens Wiklander     which lead to accepting properly authenticated but improperly
33853d3b0591SJens Wiklander     padded records in case of CBC ciphersuites using Encrypt-then-MAC.
33863d3b0591SJens Wiklander   * Fix memory leak and freeing without initialization in the example
33873d3b0591SJens Wiklander     program programs/x509/cert_write. Fixes #1422.
33883d3b0591SJens Wiklander   * Ignore IV in mbedtls_cipher_set_iv() when the cipher mode is
33893d3b0591SJens Wiklander     MBEDTLS_MODE_ECB. Found by ezdevelop. Fixes #1091.
33903d3b0591SJens Wiklander   * Zeroize memory used for buffering or reassembling handshake messages
33913d3b0591SJens Wiklander     after use.
33923d3b0591SJens Wiklander   * Use `mbedtls_platform_zeroize()` instead of `memset()` for zeroization
33933d3b0591SJens Wiklander     of sensitive data in the example programs aescrypt2 and crypt_and_hash.
33943d3b0591SJens Wiklander   * Change the default string format used for various X.509 DN attributes to
33953d3b0591SJens Wiklander     UTF8String. Previously, the use of the PrintableString format led to
33963d3b0591SJens Wiklander     wildcards and non-ASCII characters being unusable in some DN attributes.
33973d3b0591SJens Wiklander     Reported by raprepo in #1860 and by kevinpt in #468. Fix contributed by
33983d3b0591SJens Wiklander     Thomas-Dee.
33993d3b0591SJens Wiklander   * Fix compilation failure for configurations which use compile time
34003d3b0591SJens Wiklander     replacements of standard calloc/free functions through the macros
34013d3b0591SJens Wiklander     MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_FREE_MACRO.
34023d3b0591SJens Wiklander     Reported by ole-de and ddhome2006. Fixes #882, #1642 and #1706.
34033d3b0591SJens Wiklander
34043d3b0591SJens WiklanderChanges
34053d3b0591SJens Wiklander   * Removed support for Yotta as a build tool.
34063d3b0591SJens Wiklander   * Add tests for session resumption in DTLS.
34073d3b0591SJens Wiklander   * Close a test gap in (D)TLS between the client side and the server side:
34083d3b0591SJens Wiklander     test the handling of large packets and small packets on the client side
34093d3b0591SJens Wiklander     in the same way as on the server side.
34103d3b0591SJens Wiklander   * Change the dtls_client and dtls_server samples to work by default over
34113d3b0591SJens Wiklander     IPv6 and optionally by a build option over IPv4.
34123d3b0591SJens Wiklander   * Change the use of Windows threading to use Microsoft Visual C++ runtime
34133d3b0591SJens Wiklander     calls, rather than Win32 API calls directly. This is necessary to avoid
34143d3b0591SJens Wiklander     conflict with C runtime usage. Found and fixed by irwir.
34153d3b0591SJens Wiklander   * Remember the string format of X.509 DN attributes when replicating
34163d3b0591SJens Wiklander     X.509 DNs. Previously, DN attributes were always written in their default
34173d3b0591SJens Wiklander     string format (mostly PrintableString), which could lead to CRTs being
34183d3b0591SJens Wiklander     created which used PrintableStrings in the issuer field even though the
34193d3b0591SJens Wiklander     signing CA used UTF8Strings in its subject field; while X.509 compliant,
34203d3b0591SJens Wiklander     such CRTs were rejected in some applications, e.g. some versions of
34213d3b0591SJens Wiklander     Firefox, curl and GnuTLS. Reported in #1033 by Moschn. Fix contributed by
34223d3b0591SJens Wiklander     Thomas-Dee.
34233d3b0591SJens Wiklander   * Improve documentation of mbedtls_ssl_get_verify_result().
34243d3b0591SJens Wiklander     Fixes #517 reported by github-monoculture.
34253d3b0591SJens Wiklander   * Add MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR flag to mbedtls_mpi_gen_prime() and
34263d3b0591SJens Wiklander     use it to reduce error probability in RSA key generation to levels mandated
34273d3b0591SJens Wiklander     by FIPS-186-4.
34283d3b0591SJens Wiklander
34293d3b0591SJens Wiklander= mbed TLS 2.13.1 branch released 2018-09-06
34303d3b0591SJens Wiklander
34313d3b0591SJens WiklanderAPI Changes
34323d3b0591SJens Wiklander   * Extend the platform module with an abstraction mbedtls_platform_gmtime_r()
34333d3b0591SJens Wiklander     whose implementation should behave as a thread-safe version of gmtime().
34343d3b0591SJens Wiklander     This allows users to configure such an implementation at compile time when
34353d3b0591SJens Wiklander     the target system cannot be deduced automatically, by setting the option
34363d3b0591SJens Wiklander     MBEDTLS_PLATFORM_GMTIME_R_ALT. At this stage Mbed TLS is only able to
34373d3b0591SJens Wiklander     automatically select implementations for Windows and POSIX C libraries.
34383d3b0591SJens Wiklander
34393d3b0591SJens WiklanderBugfix
34403d3b0591SJens Wiklander   * Fix build failures on platforms where only gmtime() is available but
34413d3b0591SJens Wiklander     neither gmtime_r() nor gmtime_s() are present. Fixes #1907.
34423d3b0591SJens Wiklander
34433d3b0591SJens Wiklander= mbed TLS 2.13.0 branch released 2018-08-31
34443d3b0591SJens Wiklander
34453d3b0591SJens WiklanderSecurity
34463d3b0591SJens Wiklander   * Fix an issue in the X.509 module which could lead to a buffer overread
34473d3b0591SJens Wiklander     during certificate extensions parsing. In case of receiving malformed
34483d3b0591SJens Wiklander     input (extensions length field equal to 0), an illegal read of one byte
34493d3b0591SJens Wiklander     beyond the input buffer is made. Found and analyzed by Nathan Crandall.
34503d3b0591SJens Wiklander
34513d3b0591SJens WiklanderFeatures
34523d3b0591SJens Wiklander   * Add support for fragmentation of outgoing DTLS handshake messages. This
34533d3b0591SJens Wiklander     is controlled by the maximum fragment length as set locally or negotiated
34543d3b0591SJens Wiklander     with the peer, as well as by a new per-connection MTU option, set using
34553d3b0591SJens Wiklander     mbedtls_ssl_set_mtu().
34563d3b0591SJens Wiklander   * Add support for auto-adjustment of MTU to a safe value during the
34573d3b0591SJens Wiklander     handshake when flights do not get through (RFC 6347, section 4.1.1.1,
34583d3b0591SJens Wiklander     last paragraph).
34593d3b0591SJens Wiklander   * Add support for packing multiple records within a single datagram,
34603d3b0591SJens Wiklander     enabled by default.
34613d3b0591SJens Wiklander   * Add support for buffering out-of-order handshake messages in DTLS.
34623d3b0591SJens Wiklander     The maximum amount of RAM used for this can be controlled by the
34633d3b0591SJens Wiklander     compile-time constant MBEDTLS_SSL_DTLS_MAX_BUFFERING defined
34643d3b0591SJens Wiklander     in mbedtls/config.h.
34653d3b0591SJens Wiklander
34663d3b0591SJens WiklanderAPI Changes
34673d3b0591SJens Wiklander   * Add function mbedtls_ssl_set_datagram_packing() to configure
34683d3b0591SJens Wiklander     the use of datagram packing (enabled by default).
34693d3b0591SJens Wiklander
34703d3b0591SJens WiklanderBugfix
34713d3b0591SJens Wiklander   * Fix a potential memory leak in mbedtls_ssl_setup() function. An allocation
34723d3b0591SJens Wiklander     failure in the function could lead to other buffers being leaked.
34733d3b0591SJens Wiklander   * Fixes an issue with MBEDTLS_CHACHAPOLY_C which would not compile if
34743d3b0591SJens Wiklander     MBEDTLS_ARC4_C and MBEDTLS_CIPHER_NULL_CIPHER weren't also defined. #1890
34753d3b0591SJens Wiklander   * Fix a memory leak in ecp_mul_comb() if ecp_precompute_comb() fails.
34763d3b0591SJens Wiklander     Fix contributed by Espressif Systems.
34773d3b0591SJens Wiklander   * Add ecc extensions only if an ecc based ciphersuite is used.
34783d3b0591SJens Wiklander     This improves compliance to RFC 4492, and as a result, solves
34793d3b0591SJens Wiklander     interoperability issues with BouncyCastle. Raised by milenamil in #1157.
34803d3b0591SJens Wiklander   * Replace printf with mbedtls_printf in the ARIA module. Found by
34813d3b0591SJens Wiklander     TrinityTonic in #1908.
34823d3b0591SJens Wiklander   * Fix potential use-after-free in mbedtls_ssl_get_max_frag_len()
34833d3b0591SJens Wiklander     and mbedtls_ssl_get_record_expansion() after a session reset. Fixes #1941.
34843d3b0591SJens Wiklander   * Fix a bug that caused SSL/TLS clients to incorrectly abort the handshake
34853d3b0591SJens Wiklander     with TLS versions 1.1 and earlier when the server requested authentication
34863d3b0591SJens Wiklander     without providing a list of CAs. This was due to an overly strict bounds
34873d3b0591SJens Wiklander     check in parsing the CertificateRequest message,
34883d3b0591SJens Wiklander     introduced in Mbed TLS 2.12.0. Fixes #1954.
34893d3b0591SJens Wiklander   * Fix a miscalculation of the maximum record expansion in
34903d3b0591SJens Wiklander     mbedtls_ssl_get_record_expansion() in case of ChachaPoly ciphersuites,
34913d3b0591SJens Wiklander     or CBC ciphersuites in (D)TLS versions 1.1 or higher. Fixes #1913, #1914.
34923d3b0591SJens Wiklander   * Fix undefined shifts with negative values in certificates parsing
34933d3b0591SJens Wiklander     (found by Catena cyber using oss-fuzz)
34943d3b0591SJens Wiklander   * Fix memory leak and free without initialization in pk_encrypt
34953d3b0591SJens Wiklander     and pk_decrypt example programs. Reported by Brace Stout. Fixes #1128.
34963d3b0591SJens Wiklander   * Remove redundant else statement. Raised by irwir. Fixes #1776.
34973d3b0591SJens Wiklander
34983d3b0591SJens WiklanderChanges
34993d3b0591SJens Wiklander   * Copy headers preserving timestamps when doing a "make install".
35003d3b0591SJens Wiklander     Contributed by xueruini.
35013d3b0591SJens Wiklander   * Allow the forward declaration of public structs. Contributed by Dawid
35023d3b0591SJens Wiklander     Drozd. Fixes #1215 raised by randombit.
35033d3b0591SJens Wiklander   * Improve compatibility with some alternative CCM implementations by using
35043d3b0591SJens Wiklander     CCM test vectors from RAM.
35053d3b0591SJens Wiklander   * Add support for buffering of out-of-order handshake messages.
35063d3b0591SJens Wiklander   * Add warnings to the documentation of the HKDF module to reduce the risk
35073d3b0591SJens Wiklander     of misusing the mbedtls_hkdf_extract() and mbedtls_hkdf_expand()
35083d3b0591SJens Wiklander     functions. Fixes #1775. Reported by Brian J. Murray.
35093d3b0591SJens Wiklander
35103d3b0591SJens Wiklander= mbed TLS 2.12.0 branch released 2018-07-25
35113d3b0591SJens Wiklander
35123d3b0591SJens WiklanderSecurity
35133d3b0591SJens Wiklander   * Fix a vulnerability in TLS ciphersuites based on CBC and using SHA-384,
35143d3b0591SJens Wiklander     in (D)TLS 1.0 to 1.2, that allowed an active network attacker to
35153d3b0591SJens Wiklander     partially recover the plaintext of messages under some conditions by
35163d3b0591SJens Wiklander     exploiting timing measurements. With DTLS, the attacker could perform
35173d3b0591SJens Wiklander     this recovery by sending many messages in the same connection. With TLS
35183d3b0591SJens Wiklander     or if mbedtls_ssl_conf_dtls_badmac_limit() was used, the attack only
35193d3b0591SJens Wiklander     worked if the same secret (for example a HTTP Cookie) has been repeatedly
35203d3b0591SJens Wiklander     sent over connections manipulated by the attacker. Connections using GCM
35213d3b0591SJens Wiklander     or CCM instead of CBC, using hash sizes other than SHA-384, or using
35223d3b0591SJens Wiklander     Encrypt-then-Mac (RFC 7366) were not affected. The vulnerability was
35233d3b0591SJens Wiklander     caused by a miscalculation (for SHA-384) in a countermeasure to the
35243d3b0591SJens Wiklander     original Lucky 13 attack. Found by Kenny Paterson, Eyal Ronen and Adi
35253d3b0591SJens Wiklander     Shamir.
35263d3b0591SJens Wiklander   * Fix a vulnerability in TLS ciphersuites based on CBC, in (D)TLS 1.0 to
35273d3b0591SJens Wiklander     1.2, that allowed a local attacker, able to execute code on the local
35283d3b0591SJens Wiklander     machine as well as manipulate network packets, to partially recover the
35293d3b0591SJens Wiklander     plaintext of messages under some conditions by using a cache attack
35305b25c76aSJerome Forissier     targeting an internal MD/SHA buffer. With TLS or if
35313d3b0591SJens Wiklander     mbedtls_ssl_conf_dtls_badmac_limit() was used, the attack only worked if
35323d3b0591SJens Wiklander     the same secret (for example a HTTP Cookie) has been repeatedly sent over
35333d3b0591SJens Wiklander     connections manipulated by the attacker. Connections using GCM or CCM
35343d3b0591SJens Wiklander     instead of CBC or using Encrypt-then-Mac (RFC 7366) were not affected.
35353d3b0591SJens Wiklander     Found by Kenny Paterson, Eyal Ronen and Adi Shamir.
35363d3b0591SJens Wiklander   * Add a counter-measure against a vulnerability in TLS ciphersuites based
35373d3b0591SJens Wiklander     on CBC, in (D)TLS 1.0 to 1.2, that allowed a local attacker, able to
35383d3b0591SJens Wiklander     execute code on the local machine as well as manipulate network packets,
35393d3b0591SJens Wiklander     to partially recover the plaintext of messages under some conditions (see
35403d3b0591SJens Wiklander     previous entry) by using a cache attack targeting the SSL input record
35413d3b0591SJens Wiklander     buffer. Connections using GCM or CCM instead of CBC or using
35423d3b0591SJens Wiklander     Encrypt-then-Mac (RFC 7366) were not affected. Found by Kenny Paterson,
35433d3b0591SJens Wiklander     Eyal Ronen and Adi Shamir.
35443d3b0591SJens Wiklander
35453d3b0591SJens WiklanderFeatures
35463d3b0591SJens Wiklander   * Add new crypto primitives from RFC 7539: stream cipher Chacha20, one-time
35473d3b0591SJens Wiklander     authenticator Poly1305 and AEAD construct Chacha20-Poly1305. Contributed
35483d3b0591SJens Wiklander     by Daniel King.
35493d3b0591SJens Wiklander   * Add support for CHACHA20-POLY1305 ciphersuites from RFC 7905.
35503d3b0591SJens Wiklander   * Add platform support for the Haiku OS. (https://www.haiku-os.org).
35513d3b0591SJens Wiklander     Contributed by Augustin Cavalier.
35523d3b0591SJens Wiklander   * Make the receive and transmit buffers independent sizes, for situations
35533d3b0591SJens Wiklander     where the outgoing buffer can be fixed at a smaller size than the incoming
35543d3b0591SJens Wiklander     buffer, which can save some RAM. If buffer lengths are kept equal, there
35553d3b0591SJens Wiklander     is no functional difference. Contributed by Angus Gratton, and also
35563d3b0591SJens Wiklander     independently contributed again by Paul Sokolovsky.
35573d3b0591SJens Wiklander   * Add support for key wrapping modes based on AES as defined by
35583d3b0591SJens Wiklander     NIST SP 800-38F algorithms KW and KWP and by RFC 3394 and RFC 5649.
35593d3b0591SJens Wiklander
35603d3b0591SJens WiklanderBugfix
35613d3b0591SJens Wiklander   * Fix the key_app_writer example which was writing a leading zero byte which
35623d3b0591SJens Wiklander     was creating an invalid ASN.1 tag. Found by Aryeh R. Fixes #1257.
35633d3b0591SJens Wiklander   * Fix compilation error on C++, because of a variable named new.
35643d3b0591SJens Wiklander     Found and fixed by Hirotaka Niisato in #1783.
35653d3b0591SJens Wiklander   * Fix "no symbols" warning issued by ranlib when building on Mac OS X. Fix
35663d3b0591SJens Wiklander     contributed by tabascoeye.
35673d3b0591SJens Wiklander   * Clarify documentation for mbedtls_ssl_write() to include 0 as a valid
35683d3b0591SJens Wiklander     return value. Found by @davidwu2000. #839
35693d3b0591SJens Wiklander   * Fix a memory leak in mbedtls_x509_csr_parse(), found by catenacyber,
35703d3b0591SJens Wiklander     Philippe Antoine. Fixes #1623.
35713d3b0591SJens Wiklander   * Remove unused headers included in x509.c. Found by Chris Hanson and fixed
35723d3b0591SJens Wiklander     by Brendan Shanks. Part of a fix for #992.
35733d3b0591SJens Wiklander   * Fix compilation error when MBEDTLS_ARC4_C is disabled and
35743d3b0591SJens Wiklander     MBEDTLS_CIPHER_NULL_CIPHER is enabled. Found by TrinityTonic in #1719.
35753d3b0591SJens Wiklander   * Added length checks to some TLS parsing functions. Found and fixed by
35763d3b0591SJens Wiklander     Philippe Antoine from Catena cyber. #1663.
35773d3b0591SJens Wiklander   * Fix the inline assembly for the MPI multiply helper function for i386 and
35783d3b0591SJens Wiklander     i386 with SSE2. Found by László Langó. Fixes #1550
35793d3b0591SJens Wiklander   * Fix namespacing in header files. Remove the `mbedtls` namespacing in
35803d3b0591SJens Wiklander     the `#include` in the header files. Resolves #857
35813d3b0591SJens Wiklander   * Fix compiler warning of 'use before initialisation' in
35823d3b0591SJens Wiklander     mbedtls_pk_parse_key(). Found by Martin Boye Petersen and fixed by Dawid
35833d3b0591SJens Wiklander     Drozd. #1098
35843d3b0591SJens Wiklander   * Fix decryption for zero length messages (which contain all padding) when a
35853d3b0591SJens Wiklander     CBC based ciphersuite is used together with Encrypt-then-MAC. Previously,
35863d3b0591SJens Wiklander     such a message was wrongly reported as an invalid record and therefore lead
35873d3b0591SJens Wiklander     to the connection being terminated. Seen most often with OpenSSL using
35883d3b0591SJens Wiklander     TLS 1.0. Reported by @kFYatek and by Conor Murphy on the forum. Fix
35893d3b0591SJens Wiklander     contributed by Espressif Systems. Fixes #1632
35903d3b0591SJens Wiklander   * Fix ssl_client2 example to send application data with 0-length content
35913d3b0591SJens Wiklander     when the request_size argument is set to 0 as stated in the documentation.
35923d3b0591SJens Wiklander     Fixes #1833.
35933d3b0591SJens Wiklander   * Correct the documentation for `mbedtls_ssl_get_session()`. This API has
35943d3b0591SJens Wiklander     deep copy of the session, and the peer certificate is not lost. Fixes #926.
35953d3b0591SJens Wiklander   * Fix build using -std=c99. Fixed by Nick Wilson.
35963d3b0591SJens Wiklander
35973d3b0591SJens WiklanderChanges
35983d3b0591SJens Wiklander   * Fail when receiving a TLS alert message with an invalid length, or invalid
35993d3b0591SJens Wiklander     zero-length messages when using TLS 1.2. Contributed by Espressif Systems.
36003d3b0591SJens Wiklander   * Change the default behaviour of mbedtls_hkdf_extract() to return an error
36013d3b0591SJens Wiklander     when calling with a NULL salt and non-zero salt_len. Contributed by
36023d3b0591SJens Wiklander     Brian J Murray
36033d3b0591SJens Wiklander   * Change the shebang line in Perl scripts to look up perl in the PATH.
36043d3b0591SJens Wiklander     Contributed by fbrosson.
36053d3b0591SJens Wiklander   * Allow overriding the time on Windows via the platform-time abstraction.
36063d3b0591SJens Wiklander     Fixed by Nick Wilson.
36073d3b0591SJens Wiklander   * Use gmtime_r/gmtime_s for thread-safety. Fixed by Nick Wilson.
36083d3b0591SJens Wiklander
36093d3b0591SJens Wiklander= mbed TLS 2.11.0 branch released 2018-06-18
36103d3b0591SJens Wiklander
36113d3b0591SJens WiklanderFeatures
36123d3b0591SJens Wiklander   * Add additional block mode, OFB (Output Feedback), to the AES module and
36133d3b0591SJens Wiklander     cipher abstraction module.
36143d3b0591SJens Wiklander   * Implement the HMAC-based extract-and-expand key derivation function
36153d3b0591SJens Wiklander     (HKDF) per RFC 5869. Contributed by Thomas Fossati.
36163d3b0591SJens Wiklander   * Add support for the CCM* block cipher mode as defined in IEEE Std. 802.15.4.
36173d3b0591SJens Wiklander   * Add support for the XTS block cipher mode with AES (AES-XTS).
36183d3b0591SJens Wiklander     Contributed by Aorimn in pull request #414.
36193d3b0591SJens Wiklander   * In TLS servers, support offloading private key operations to an external
36203d3b0591SJens Wiklander     cryptoprocessor. Private key operations can be asynchronous to allow
36213d3b0591SJens Wiklander     non-blocking operation of the TLS server stack.
36223d3b0591SJens Wiklander
36233d3b0591SJens WiklanderBugfix
36243d3b0591SJens Wiklander   * Fix the cert_write example to handle certificates signed with elliptic
36253d3b0591SJens Wiklander     curves as well as RSA. Fixes #777 found by dbedev.
36263d3b0591SJens Wiklander   * Fix for redefinition of _WIN32_WINNT to avoid overriding a definition
36273d3b0591SJens Wiklander     used by user applications. Found and fixed by Fabio Alessandrelli.
36283d3b0591SJens Wiklander   * Fix compilation warnings with IAR toolchain, on 32 bit platform.
36293d3b0591SJens Wiklander     Reported by rahmanih in #683
36303d3b0591SJens Wiklander   * Fix braces in mbedtls_memory_buffer_alloc_status(). Found by sbranden, #552.
36313d3b0591SJens Wiklander
36323d3b0591SJens WiklanderChanges
36333d3b0591SJens Wiklander   * Changed CMake defaults for IAR to treat all compiler warnings as errors.
36343d3b0591SJens Wiklander   * Changed the Clang parameters used in the CMake build files to work for
36353d3b0591SJens Wiklander     versions later than 3.6. Versions of Clang earlier than this may no longer
36363d3b0591SJens Wiklander     work. Fixes #1072
36373d3b0591SJens Wiklander
36383d3b0591SJens Wiklander= mbed TLS 2.10.0 branch released 2018-06-06
36393d3b0591SJens Wiklander
36403d3b0591SJens WiklanderFeatures
36413d3b0591SJens Wiklander   * Add support for ARIA cipher (RFC 5794) and associated TLS ciphersuites
36423d3b0591SJens Wiklander     (RFC 6209). Disabled by default, see MBEDTLS_ARIA_C in config.h
36433d3b0591SJens Wiklander
36443d3b0591SJens WiklanderAPI Changes
36453d3b0591SJens Wiklander   * Extend the platform module with a util component that contains
36463d3b0591SJens Wiklander     functionality shared by multiple Mbed TLS modules. At this stage
36473d3b0591SJens Wiklander     platform_util.h (and its associated platform_util.c) only contain
36483d3b0591SJens Wiklander     mbedtls_platform_zeroize(), which is a critical function from a security
36493d3b0591SJens Wiklander     point of view. mbedtls_platform_zeroize() needs to be regularly tested
36503d3b0591SJens Wiklander     against compilers to ensure that calls to it are not removed from the
36513d3b0591SJens Wiklander     output binary as part of redundant code elimination optimizations.
36523d3b0591SJens Wiklander     Therefore, mbedtls_platform_zeroize() is moved to the platform module to
36533d3b0591SJens Wiklander     facilitate testing and maintenance.
36543d3b0591SJens Wiklander
36553d3b0591SJens WiklanderBugfix
36563d3b0591SJens Wiklander   * Fix an issue with MicroBlaze support in bn_mul.h which was causing the
36573d3b0591SJens Wiklander     build to fail. Found by zv-io. Fixes #1651.
36583d3b0591SJens Wiklander
36593d3b0591SJens WiklanderChanges
36603d3b0591SJens Wiklander   * Support TLS testing in out-of-source builds using cmake. Fixes #1193.
36613d3b0591SJens Wiklander   * Fix redundant declaration of mbedtls_ssl_list_ciphersuites. Raised by
36623d3b0591SJens Wiklander     TrinityTonic. #1359.
36633d3b0591SJens Wiklander
36643d3b0591SJens Wiklander= mbed TLS 2.9.0 branch released 2018-04-30
36653d3b0591SJens Wiklander
36663d3b0591SJens WiklanderSecurity
36673d3b0591SJens Wiklander   * Fix an issue in the X.509 module which could lead to a buffer overread
36683d3b0591SJens Wiklander     during certificate validation. Additionally, the issue could also lead to
36693d3b0591SJens Wiklander     unnecessary callback checks being made or to some validation checks to be
36703d3b0591SJens Wiklander     omitted. The overread could be triggered remotely, while the other issues
36713d3b0591SJens Wiklander     would require a non DER-compliant certificate to be correctly signed by a
36723d3b0591SJens Wiklander     trusted CA, or a trusted CA with a non DER-compliant certificate. Found by
36733d3b0591SJens Wiklander     luocm. Fixes #825.
36743d3b0591SJens Wiklander   * Fix the buffer length assertion in the ssl_parse_certificate_request()
36753d3b0591SJens Wiklander     function which led to an arbitrary overread of the message buffer. The
36763d3b0591SJens Wiklander     overreads could be caused by receiving a malformed message at the point
36773d3b0591SJens Wiklander     where an optional signature algorithms list is expected when the signature
36783d3b0591SJens Wiklander     algorithms section is too short. In builds with debug output, the overread
36793d3b0591SJens Wiklander     data is output with the debug data.
36803d3b0591SJens Wiklander   * Fix a client-side bug in the validation of the server's ciphersuite choice
36813d3b0591SJens Wiklander     which could potentially lead to the client accepting a ciphersuite it didn't
36823d3b0591SJens Wiklander     offer or a ciphersuite that cannot be used with the TLS or DTLS version
36833d3b0591SJens Wiklander     chosen by the server. This could lead to corruption of internal data
36843d3b0591SJens Wiklander     structures for some configurations.
36853d3b0591SJens Wiklander
36863d3b0591SJens WiklanderFeatures
36873d3b0591SJens Wiklander   * Add an option, MBEDTLS_AES_FEWER_TABLES, to dynamically compute smaller AES
36883d3b0591SJens Wiklander     tables during runtime, thereby reducing the RAM/ROM footprint by ~6KiB.
36893d3b0591SJens Wiklander     Suggested and contributed by jkivilin in pull request #394.
36903d3b0591SJens Wiklander   * Add initial support for Curve448 (RFC 7748). Only mbedtls_ecp_mul() and
36913d3b0591SJens Wiklander     ECDH primitive functions (mbedtls_ecdh_gen_public(),
36923d3b0591SJens Wiklander     mbedtls_ecdh_compute_shared()) are supported for now. Contributed by
36933d3b0591SJens Wiklander     Nicholas Wilson in pull request #348.
36943d3b0591SJens Wiklander
36953d3b0591SJens WiklanderAPI Changes
36963d3b0591SJens Wiklander   * Extend the public API with the function of mbedtls_net_poll() to allow user
36973d3b0591SJens Wiklander     applications to wait for a network context to become ready before reading
36983d3b0591SJens Wiklander     or writing.
36993d3b0591SJens Wiklander   * Add function mbedtls_ssl_check_pending() to the public API to allow
37003d3b0591SJens Wiklander     a check for whether more more data is pending to be processed in the
37013d3b0591SJens Wiklander     internal message buffers.
37023d3b0591SJens Wiklander     This function is necessary to determine when it is safe to idle on the
37033d3b0591SJens Wiklander     underlying transport in case event-driven IO is used.
37043d3b0591SJens Wiklander
37053d3b0591SJens WiklanderBugfix
37063d3b0591SJens Wiklander   * Fix a spurious uninitialized variable warning in cmac.c. Fix independently
37073d3b0591SJens Wiklander     contributed by Brian J Murray and David Brown.
37083d3b0591SJens Wiklander   * Add missing dependencies in test suites that led to build failures
37093d3b0591SJens Wiklander     in configurations that omit certain hashes or public-key algorithms.
37103d3b0591SJens Wiklander     Fixes #1040.
37113d3b0591SJens Wiklander   * Fix C89 incompatibility in benchmark.c. Contributed by Brendan Shanks.
37123d3b0591SJens Wiklander     #1353
37133d3b0591SJens Wiklander   * Add missing dependencies for MBEDTLS_HAVE_TIME_DATE and
37143d3b0591SJens Wiklander     MBEDTLS_VERSION_FEATURES in some test suites. Contributed by
37153d3b0591SJens Wiklander     Deomid Ryabkov. Fixes #1299, #1475.
37163d3b0591SJens Wiklander   * Fix the Makefile build process for building shared libraries on Mac OS X.
37173d3b0591SJens Wiklander     Fixed by mnacamura.
37183d3b0591SJens Wiklander   * Fix parsing of PKCS#8 encoded Elliptic Curve keys. Previously Mbed TLS was
37193d3b0591SJens Wiklander     unable to parse keys which had only the optional parameters field of the
37203d3b0591SJens Wiklander     ECPrivateKey structure. Found by Jethro Beekman, fixed in #1379.
37213d3b0591SJens Wiklander   * Return the plaintext data more quickly on unpadded CBC decryption, as
37223d3b0591SJens Wiklander     stated in the mbedtls_cipher_update() documentation. Contributed by
37233d3b0591SJens Wiklander     Andy Leiserson.
37243d3b0591SJens Wiklander   * Fix overriding and ignoring return values when parsing and writing to
37253d3b0591SJens Wiklander     a file in pk_sign program. Found by kevlut in #1142.
37263d3b0591SJens Wiklander   * Restrict usage of error code MBEDTLS_ERR_SSL_WANT_READ to situations
37273d3b0591SJens Wiklander     where data needs to be fetched from the underlying transport in order
37283d3b0591SJens Wiklander     to make progress. Previously, this error code was also occasionally
37293d3b0591SJens Wiklander     returned when unexpected messages were being discarded, ignoring that
37303d3b0591SJens Wiklander     further messages could potentially already be pending to be processed
37313d3b0591SJens Wiklander     in the internal buffers; these cases led to deadlocks when event-driven
37323d3b0591SJens Wiklander     I/O was used. Found and reported by Hubert Mis in #772.
37333d3b0591SJens Wiklander   * Fix buffer length assertions in the ssl_parse_certificate_request()
37343d3b0591SJens Wiklander     function which leads to a potential one byte overread of the message
37353d3b0591SJens Wiklander     buffer.
37363d3b0591SJens Wiklander   * Fix invalid buffer sizes passed to zlib during record compression and
37373d3b0591SJens Wiklander     decompression.
37383d3b0591SJens Wiklander   * Fix the soversion of libmbedcrypto to match the soversion of the
37393d3b0591SJens Wiklander     maintained 2.7 branch. The soversion was increased in Mbed TLS
37403d3b0591SJens Wiklander     version 2.7.1 to reflect breaking changes in that release, but the
37413d3b0591SJens Wiklander     increment was missed in 2.8.0 and later releases outside of the 2.7 branch.
37423d3b0591SJens Wiklander
37433d3b0591SJens WiklanderChanges
37443d3b0591SJens Wiklander   * Remove some redundant code in bignum.c. Contributed by Alexey Skalozub.
37453d3b0591SJens Wiklander   * Support cmake builds where Mbed TLS is a subproject. Fix contributed
37463d3b0591SJens Wiklander     independently by Matthieu Volat and Arne Schwabe.
37473d3b0591SJens Wiklander   * Improve testing in configurations that omit certain hashes or
37483d3b0591SJens Wiklander     public-key algorithms. Includes contributions by Gert van Dijk.
37493d3b0591SJens Wiklander   * Improve negative testing of X.509 parsing.
37503d3b0591SJens Wiklander   * Do not define global mutexes around readdir() and gmtime() in
37513d3b0591SJens Wiklander     configurations where the feature is disabled. Found and fixed by Gergely
37523d3b0591SJens Wiklander     Budai.
37533d3b0591SJens Wiklander   * Harden the function mbedtls_ssl_config_free() against misuse, so that it
37543d3b0591SJens Wiklander     doesn't leak memory if the user doesn't use mbedtls_ssl_conf_psk() and
37553d3b0591SJens Wiklander     instead incorrectly manipulates the configuration structure directly.
37563d3b0591SJens Wiklander     Found and fix submitted by junyeonLEE in #1220.
37573d3b0591SJens Wiklander   * Provide an empty implementation of mbedtls_pkcs5_pbes2() when
37583d3b0591SJens Wiklander     MBEDTLS_ASN1_PARSE_C is not enabled. This allows the use of PBKDF2
37593d3b0591SJens Wiklander     without PBES2. Fixed by Marcos Del Sol Vives.
37603d3b0591SJens Wiklander   * Add the order of the base point as N in the mbedtls_ecp_group structure
37613d3b0591SJens Wiklander     for Curve25519 (other curves had it already). Contributed by Nicholas
37623d3b0591SJens Wiklander     Wilson #481
37633d3b0591SJens Wiklander   * Improve the documentation of mbedtls_net_accept(). Contributed by Ivan
37643d3b0591SJens Wiklander     Krylov.
37653d3b0591SJens Wiklander   * Improve the documentation of mbedtls_ssl_write(). Suggested by
37663d3b0591SJens Wiklander     Paul Sokolovsky in #1356.
37673d3b0591SJens Wiklander   * Add an option in the Makefile to support ar utilities where the operation
37683d3b0591SJens Wiklander     letter must not be prefixed by '-', such as LLVM. Found and fixed by
37693d3b0591SJens Wiklander     Alex Hixon.
37703d3b0591SJens Wiklander   * Allow configuring the shared library extension by setting the DLEXT
37713d3b0591SJens Wiklander     environment variable when using the project makefiles.
37723d3b0591SJens Wiklander   * Optimize unnecessary zeroing in mbedtls_mpi_copy. Based on a contribution
37733d3b0591SJens Wiklander     by Alexey Skalozub in #405.
37743d3b0591SJens Wiklander   * In the SSL module, when f_send, f_recv or f_recv_timeout report
37753d3b0591SJens Wiklander     transmitting more than the required length, return an error. Raised by
37763d3b0591SJens Wiklander     Sam O'Connor in #1245.
37773d3b0591SJens Wiklander   * Improve robustness of mbedtls_ssl_derive_keys against the use of
37783d3b0591SJens Wiklander     HMAC functions with non-HMAC ciphersuites. Independently contributed
37793d3b0591SJens Wiklander     by Jiayuan Chen in #1377. Fixes #1437.
37803d3b0591SJens Wiklander   * Improve security of RSA key generation by including criteria from
37813d3b0591SJens Wiklander     FIPS 186-4. Contributed by Jethro Beekman. #1380
37823d3b0591SJens Wiklander   * Declare functions in header files even when an alternative implementation
37833d3b0591SJens Wiklander     of the corresponding module is activated by defining the corresponding
37843d3b0591SJens Wiklander     MBEDTLS_XXX_ALT macro. This means that alternative implementations do
37853d3b0591SJens Wiklander     not need to copy the declarations, and ensures that they will have the
37863d3b0591SJens Wiklander     same API.
37873d3b0591SJens Wiklander   * Add platform setup and teardown calls in test suites.
37883d3b0591SJens Wiklander
37893d3b0591SJens Wiklander= mbed TLS 2.8.0 branch released 2018-03-16
37903d3b0591SJens Wiklander
37913d3b0591SJens WiklanderDefault behavior changes
37923d3b0591SJens Wiklander   * The truncated HMAC extension now conforms to RFC 6066. This means
37933d3b0591SJens Wiklander     that when both sides of a TLS connection negotiate the truncated
37943d3b0591SJens Wiklander     HMAC extension, Mbed TLS can now interoperate with other
37953d3b0591SJens Wiklander     compliant implementations, but this breaks interoperability with
37963d3b0591SJens Wiklander     prior versions of Mbed TLS. To restore the old behavior, enable
37973d3b0591SJens Wiklander     the (deprecated) option MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT in
37983d3b0591SJens Wiklander     config.h. Found by Andreas Walz (ivESK, Offenburg University of
37993d3b0591SJens Wiklander     Applied Sciences).
38003d3b0591SJens Wiklander
38013d3b0591SJens WiklanderSecurity
38023d3b0591SJens Wiklander   * Fix implementation of the truncated HMAC extension. The previous
38033d3b0591SJens Wiklander     implementation allowed an offline 2^80 brute force attack on the
38043d3b0591SJens Wiklander     HMAC key of a single, uninterrupted connection (with no
38053d3b0591SJens Wiklander     resumption of the session).
38063d3b0591SJens Wiklander   * Verify results of RSA private key operations to defend
38073d3b0591SJens Wiklander     against Bellcore glitch attack.
38083d3b0591SJens Wiklander   * Fix a buffer overread in ssl_parse_server_key_exchange() that could cause
38093d3b0591SJens Wiklander     a crash on invalid input.
38103d3b0591SJens Wiklander   * Fix a buffer overread in ssl_parse_server_psk_hint() that could cause a
38113d3b0591SJens Wiklander     crash on invalid input.
38123d3b0591SJens Wiklander   * Fix CRL parsing to reject CRLs containing unsupported critical
38133d3b0591SJens Wiklander     extensions. Found by Falko Strenzke and Evangelos Karatsiolis.
38143d3b0591SJens Wiklander
38153d3b0591SJens WiklanderFeatures
38163d3b0591SJens Wiklander   * Extend PKCS#8 interface by introducing support for the entire SHA
38173d3b0591SJens Wiklander     algorithms family when encrypting private keys using PKCS#5 v2.0.
38183d3b0591SJens Wiklander     This allows reading encrypted PEM files produced by software that
38193d3b0591SJens Wiklander     uses PBKDF2-SHA2, such as OpenSSL 1.1. Submitted by Antonio Quartulli,
38203d3b0591SJens Wiklander     OpenVPN Inc. Fixes #1339
38213d3b0591SJens Wiklander   * Add support for public keys encoded in PKCS#1 format. #1122
38223d3b0591SJens Wiklander
38233d3b0591SJens WiklanderNew deprecations
38243d3b0591SJens Wiklander   * Deprecate support for record compression (configuration option
38253d3b0591SJens Wiklander     MBEDTLS_ZLIB_SUPPORT).
38263d3b0591SJens Wiklander
38273d3b0591SJens WiklanderBugfix
38283d3b0591SJens Wiklander   * Fix the name of a DHE parameter that was accidentally changed in 2.7.0.
38293d3b0591SJens Wiklander     Fixes #1358.
38303d3b0591SJens Wiklander   * Fix test_suite_pk to work on 64-bit ILP32 systems. #849
38313d3b0591SJens Wiklander   * Fix mbedtls_x509_crt_profile_suiteb, which used to reject all certificates
38323d3b0591SJens Wiklander     with flag MBEDTLS_X509_BADCERT_BAD_PK even when the key type was correct.
38333d3b0591SJens Wiklander     In the context of SSL, this resulted in handshake failure. Reported by
38343d3b0591SJens Wiklander     daniel in the Mbed TLS forum. #1351
38353d3b0591SJens Wiklander   * Fix Windows x64 builds with the included mbedTLS.sln file. #1347
38363d3b0591SJens Wiklander   * Fix setting version TLSv1 as minimal version, even if TLS 1
38373d3b0591SJens Wiklander     is not enabled. Set MBEDTLS_SSL_MIN_MAJOR_VERSION
38383d3b0591SJens Wiklander     and MBEDTLS_SSL_MIN_MINOR_VERSION instead of
38393d3b0591SJens Wiklander     MBEDTLS_SSL_MAJOR_VERSION_3 and MBEDTLS_SSL_MINOR_VERSION_1. #664
38403d3b0591SJens Wiklander   * Fix compilation error on Mingw32 when _TRUNCATE is defined. Use _TRUNCATE
38413d3b0591SJens Wiklander     only if __MINGW32__ not defined. Fix suggested by Thomas Glanzmann and
38423d3b0591SJens Wiklander     Nick Wilson on issue #355
38433d3b0591SJens Wiklander   * In test_suite_pk, pass valid parameters when testing for hash length
38443d3b0591SJens Wiklander     overflow. #1179
38453d3b0591SJens Wiklander   * Fix memory allocation corner cases in memory_buffer_alloc.c module. Found
38463d3b0591SJens Wiklander     by Guido Vranken. #639
38473d3b0591SJens Wiklander   * Log correct number of ciphersuites used in Client Hello message. #918
38483d3b0591SJens Wiklander   * Fix X509 CRT parsing that would potentially accept an invalid tag when
38493d3b0591SJens Wiklander     parsing the subject alternative names.
38503d3b0591SJens Wiklander   * Fix a possible arithmetic overflow in ssl_parse_server_key_exchange()
38513d3b0591SJens Wiklander     that could cause a key exchange to fail on valid data.
38523d3b0591SJens Wiklander   * Fix a possible arithmetic overflow in ssl_parse_server_psk_hint() that
38533d3b0591SJens Wiklander     could cause a key exchange to fail on valid data.
38543d3b0591SJens Wiklander   * Don't define mbedtls_aes_decrypt and mbedtls_aes_encrypt under
38553d3b0591SJens Wiklander     MBEDTLS_DEPRECATED_REMOVED. #1388
38563d3b0591SJens Wiklander   * Fix a 1-byte heap buffer overflow (read-only) during private key parsing.
38573d3b0591SJens Wiklander     Found through fuzz testing.
38583d3b0591SJens Wiklander
38593d3b0591SJens WiklanderChanges
38603d3b0591SJens Wiklander   * Fix tag lengths and value ranges in the documentation of CCM encryption.
38613d3b0591SJens Wiklander     Contributed by Mathieu Briand.
38623d3b0591SJens Wiklander   * Fix typo in a comment ctr_drbg.c. Contributed by Paul Sokolovsky.
38633d3b0591SJens Wiklander   * Remove support for the library reference configuration for picocoin.
38643d3b0591SJens Wiklander   * MD functions deprecated in 2.7.0 are no longer inline, to provide
38653d3b0591SJens Wiklander     a migration path for those depending on the library's ABI.
38663d3b0591SJens Wiklander   * Clarify the documentation of mbedtls_ssl_setup.
38673d3b0591SJens Wiklander   * Use (void) when defining functions with no parameters. Contributed by
38683d3b0591SJens Wiklander     Joris Aerts. #678
38693d3b0591SJens Wiklander
38703d3b0591SJens Wiklander= mbed TLS 2.7.0 branch released 2018-02-03
38713d3b0591SJens Wiklander
38723d3b0591SJens WiklanderSecurity
38733d3b0591SJens Wiklander   * Fix a heap corruption issue in the implementation of the truncated HMAC
38743d3b0591SJens Wiklander     extension. When the truncated HMAC extension is enabled and CBC is used,
38753d3b0591SJens Wiklander     sending a malicious application packet could be used to selectively corrupt
38763d3b0591SJens Wiklander     6 bytes on the peer's heap, which could potentially lead to crash or remote
38773d3b0591SJens Wiklander     code execution. The issue could be triggered remotely from either side in
38783d3b0591SJens Wiklander     both TLS and DTLS. CVE-2018-0488
38793d3b0591SJens Wiklander   * Fix a buffer overflow in RSA-PSS verification when the hash was too large
38803d3b0591SJens Wiklander     for the key size, which could potentially lead to crash or remote code
38813d3b0591SJens Wiklander     execution. Found by Seth Terashima, Qualcomm Product Security Initiative,
38823d3b0591SJens Wiklander     Qualcomm Technologies Inc. CVE-2018-0487
38833d3b0591SJens Wiklander   * Fix buffer overflow in RSA-PSS verification when the unmasked data is all
38843d3b0591SJens Wiklander     zeros.
38853d3b0591SJens Wiklander   * Fix an unsafe bounds check in ssl_parse_client_psk_identity() when adding
38863d3b0591SJens Wiklander     64 KiB to the address of the SSL buffer and causing a wrap around.
38873d3b0591SJens Wiklander   * Fix a potential heap buffer overflow in mbedtls_ssl_write(). When the (by
38883d3b0591SJens Wiklander     default enabled) maximum fragment length extension is disabled in the
38893d3b0591SJens Wiklander     config and the application data buffer passed to mbedtls_ssl_write
38903d3b0591SJens Wiklander     is larger than the internal message buffer (16384 bytes by default), the
38913d3b0591SJens Wiklander     latter overflows. The exploitability of this issue depends on whether the
38923d3b0591SJens Wiklander     application layer can be forced into sending such large packets. The issue
38933d3b0591SJens Wiklander     was independently reported by Tim Nordell via e-mail and by Florin Petriuc
38943d3b0591SJens Wiklander     and sjorsdewit on GitHub. Fix proposed by Florin Petriuc in #1022.
38953d3b0591SJens Wiklander     Fixes #707.
38963d3b0591SJens Wiklander   * Add a provision to prevent compiler optimizations breaking the time
38973d3b0591SJens Wiklander     constancy of mbedtls_ssl_safer_memcmp().
38983d3b0591SJens Wiklander   * Ensure that buffers are cleared after use if they contain sensitive data.
38993d3b0591SJens Wiklander     Changes were introduced in multiple places in the library.
39003d3b0591SJens Wiklander   * Set PEM buffer to zero before freeing it, to avoid decoded private keys
39013d3b0591SJens Wiklander     being leaked to memory after release.
39023d3b0591SJens Wiklander   * Fix dhm_check_range() failing to detect trivial subgroups and potentially
39033d3b0591SJens Wiklander     leaking 1 bit of the private key. Reported by prashantkspatil.
39043d3b0591SJens Wiklander   * Make mbedtls_mpi_read_binary() constant-time with respect to the input
39053d3b0591SJens Wiklander     data. Previously, trailing zero bytes were detected and omitted for the
39063d3b0591SJens Wiklander     sake of saving memory, but potentially leading to slight timing
39073d3b0591SJens Wiklander     differences. Reported by Marco Macchetti, Kudelski Group.
39083d3b0591SJens Wiklander   * Wipe stack buffer temporarily holding EC private exponent
39093d3b0591SJens Wiklander     after keypair generation.
39103d3b0591SJens Wiklander   * Fix a potential heap buffer over-read in ALPN extension parsing
39113d3b0591SJens Wiklander     (server-side). Could result in application crash, but only if an ALPN
39123d3b0591SJens Wiklander     name larger than 16 bytes had been configured on the server.
39133d3b0591SJens Wiklander   * Change default choice of DHE parameters from untrustworthy RFC 5114
39143d3b0591SJens Wiklander     to RFC 3526 containing parameters generated in a nothing-up-my-sleeve
39153d3b0591SJens Wiklander     manner.
39163d3b0591SJens Wiklander
39173d3b0591SJens WiklanderFeatures
39183d3b0591SJens Wiklander   * Allow comments in test data files.
39193d3b0591SJens Wiklander   * The selftest program can execute a subset of the tests based on command
39203d3b0591SJens Wiklander     line arguments.
39213d3b0591SJens Wiklander   * New unit tests for timing. Improve the self-test to be more robust
39223d3b0591SJens Wiklander     when run on a heavily-loaded machine.
39233d3b0591SJens Wiklander   * Add alternative implementation support for CCM and CMAC (MBEDTLS_CCM_ALT,
39243d3b0591SJens Wiklander     MBEDTLS_CMAC_ALT). Submitted by Steven Cooreman, Silicon Labs.
39253d3b0591SJens Wiklander   * Add support for alternative implementations of GCM, selected by the
39263d3b0591SJens Wiklander     configuration flag MBEDTLS_GCM_ALT.
39273d3b0591SJens Wiklander   * Add support for alternative implementations for ECDSA, controlled by new
39283d3b0591SJens Wiklander     configuration flags MBEDTLS_ECDSA_SIGN_ALT, MBEDTLS_ECDSA_VERIFY_ALT and
39293d3b0591SJens Wiklander     MBEDTLS_ECDSDA_GENKEY_AT in config.h.
39303d3b0591SJens Wiklander     The following functions from the ECDSA module can be replaced
39313d3b0591SJens Wiklander     with alternative implementation:
39323d3b0591SJens Wiklander     mbedtls_ecdsa_sign(), mbedtls_ecdsa_verify() and mbedtls_ecdsa_genkey().
39333d3b0591SJens Wiklander   * Add support for alternative implementation of ECDH, controlled by the
39343d3b0591SJens Wiklander     new configuration flags MBEDTLS_ECDH_COMPUTE_SHARED_ALT and
39353d3b0591SJens Wiklander     MBEDTLS_ECDH_GEN_PUBLIC_ALT in config.h.
39363d3b0591SJens Wiklander     The following functions from the ECDH module can be replaced
39373d3b0591SJens Wiklander     with an alternative implementation:
39383d3b0591SJens Wiklander     mbedtls_ecdh_gen_public() and mbedtls_ecdh_compute_shared().
39393d3b0591SJens Wiklander   * Add support for alternative implementation of ECJPAKE, controlled by
39403d3b0591SJens Wiklander     the new configuration flag MBEDTLS_ECJPAKE_ALT.
39413d3b0591SJens Wiklander   * Add mechanism to provide alternative implementation of the DHM module.
39423d3b0591SJens Wiklander
39433d3b0591SJens WiklanderAPI Changes
39443d3b0591SJens Wiklander   * Extend RSA interface by multiple functions allowing structure-
39453d3b0591SJens Wiklander     independent setup and export of RSA contexts. Most notably,
39463d3b0591SJens Wiklander     mbedtls_rsa_import() and mbedtls_rsa_complete() are introduced for setting
39473d3b0591SJens Wiklander     up RSA contexts from partial key material and having them completed to the
39483d3b0591SJens Wiklander     needs of the implementation automatically. This allows to setup private RSA
39493d3b0591SJens Wiklander     contexts from keys consisting of N,D,E only, even if P,Q are needed for the
39503d3b0591SJens Wiklander     purpose or CRT and/or blinding.
39513d3b0591SJens Wiklander   * The configuration option MBEDTLS_RSA_ALT can be used to define alternative
39523d3b0591SJens Wiklander     implementations of the RSA interface declared in rsa.h.
39533d3b0591SJens Wiklander   * The following functions in the message digest modules (MD2, MD4, MD5,
39543d3b0591SJens Wiklander     SHA1, SHA256, SHA512) have been deprecated and replaced as shown below.
39553d3b0591SJens Wiklander     The new functions change the return type from void to int to allow
39563d3b0591SJens Wiklander     returning error codes when using MBEDTLS_<MODULE>_ALT.
39573d3b0591SJens Wiklander     mbedtls_<MODULE>_starts() -> mbedtls_<MODULE>_starts_ret()
39583d3b0591SJens Wiklander     mbedtls_<MODULE>_update() -> mbedtls_<MODULE>_update_ret()
39593d3b0591SJens Wiklander     mbedtls_<MODULE>_finish() -> mbedtls_<MODULE>_finish_ret()
39603d3b0591SJens Wiklander     mbedtls_<MODULE>_process() -> mbedtls_internal_<MODULE>_process()
39613d3b0591SJens Wiklander
39623d3b0591SJens WiklanderNew deprecations
39633d3b0591SJens Wiklander   * Deprecate usage of RSA primitives with non-matching key-type
39643d3b0591SJens Wiklander     (e.g. signing with a public key).
39653d3b0591SJens Wiklander   * Direct manipulation of structure fields of RSA contexts is deprecated.
39663d3b0591SJens Wiklander     Users are advised to use the extended RSA API instead.
39673d3b0591SJens Wiklander   * Deprecate usage of message digest functions that return void
39683d3b0591SJens Wiklander     (mbedtls_<MODULE>_starts, mbedtls_<MODULE>_update,
39693d3b0591SJens Wiklander     mbedtls_<MODULE>_finish and mbedtls_<MODULE>_process where <MODULE> is
39703d3b0591SJens Wiklander     any of MD2, MD4, MD5, SHA1, SHA256, SHA512) in favor of functions
39713d3b0591SJens Wiklander     that can return an error code.
39723d3b0591SJens Wiklander   * Deprecate untrustworthy DHE parameters from RFC 5114. Superseded by
39733d3b0591SJens Wiklander     parameters from RFC 3526 or the newly added parameters from RFC 7919.
39743d3b0591SJens Wiklander   * Deprecate hex string DHE constants MBEDTLS_DHM_RFC3526_MODP_2048_P etc.
39753d3b0591SJens Wiklander     Supserseded by binary encoded constants MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN
39763d3b0591SJens Wiklander     etc.
39773d3b0591SJens Wiklander   * Deprecate mbedtls_ssl_conf_dh_param() for setting default DHE parameters
39783d3b0591SJens Wiklander     from hex strings. Superseded by mbedtls_ssl_conf_dh_param_bin()
39793d3b0591SJens Wiklander     accepting DHM parameters in binary form, matching the new constants.
39803d3b0591SJens Wiklander
39813d3b0591SJens WiklanderBugfix
39823d3b0591SJens Wiklander   * Fix ssl_parse_record_header() to silently discard invalid DTLS records
39833d3b0591SJens Wiklander     as recommended in RFC 6347 Section 4.1.2.7.
39843d3b0591SJens Wiklander   * Fix memory leak in mbedtls_ssl_set_hostname() when called multiple times.
39853d3b0591SJens Wiklander     Found by projectgus and Jethro Beekman, #836.
39863d3b0591SJens Wiklander   * Fix usage help in ssl_server2 example. Found and fixed by Bei Lin.
3987817466cbSJens Wiklander   * Parse signature algorithm extension when renegotiating. Previously,
3988817466cbSJens Wiklander     renegotiated handshakes would only accept signatures using SHA-1
3989817466cbSJens Wiklander     regardless of the peer's preferences, or fail if SHA-1 was disabled.
39903d3b0591SJens Wiklander   * Fix leap year calculation in x509_date_is_valid() to ensure that invalid
39913d3b0591SJens Wiklander     dates on leap years with 100 and 400 intervals are handled correctly. Found
39923d3b0591SJens Wiklander     by Nicholas Wilson. #694
39933d3b0591SJens Wiklander   * Fix some invalid RSA-PSS signatures with keys of size 8N+1 that were
39943d3b0591SJens Wiklander     accepted. Generating these signatures required the private key.
39953d3b0591SJens Wiklander   * Fix out-of-memory problem when parsing 4096-bit PKCS8-encrypted RSA keys.
39963d3b0591SJens Wiklander     Found independently by Florian in the mbed TLS forum and by Mishamax.
39973d3b0591SJens Wiklander     #878, #1019.
39983d3b0591SJens Wiklander   * Fix variable used before assignment compilation warnings with IAR
39993d3b0591SJens Wiklander     toolchain. Found by gkerrien38.
40003d3b0591SJens Wiklander   * Fix unchecked return codes from AES, DES and 3DES functions in
40013d3b0591SJens Wiklander     pem_aes_decrypt(), pem_des_decrypt() and pem_des3_decrypt() respectively.
40023d3b0591SJens Wiklander     If a call to one of the functions of the cryptographic primitive modules
40033d3b0591SJens Wiklander     failed, the error may not be noticed by the function
40043d3b0591SJens Wiklander     mbedtls_pem_read_buffer() causing it to return invalid values. Found by
40053d3b0591SJens Wiklander     Guido Vranken. #756
40063d3b0591SJens Wiklander   * Include configuration file in md.h, to fix compilation warnings.
40073d3b0591SJens Wiklander     Reported by aaronmdjones in #1001
40083d3b0591SJens Wiklander   * Correct extraction of signature-type from PK instance in X.509 CRT and CSR
40093d3b0591SJens Wiklander     writing routines that prevented these functions to work with alternative
40103d3b0591SJens Wiklander     RSA implementations. Raised by J.B. in the Mbed TLS forum. Fixes #1011.
40113d3b0591SJens Wiklander   * Don't print X.509 version tag for v1 CRT's, and omit extensions for
40123d3b0591SJens Wiklander     non-v3 CRT's.
40133d3b0591SJens Wiklander   * Fix bugs in RSA test suite under MBEDTLS_NO_PLATFORM_ENTROPY. #1023 #1024
40143d3b0591SJens Wiklander   * Fix net_would_block() to avoid modification by errno through fcntl() call.
40153d3b0591SJens Wiklander     Found by nkolban. Fixes #845.
40163d3b0591SJens Wiklander   * Fix handling of handshake messages in mbedtls_ssl_read() in case
40173d3b0591SJens Wiklander     MBEDTLS_SSL_RENEGOTIATION is disabled. Found by erja-gp.
40183d3b0591SJens Wiklander   * Add a check for invalid private parameters in mbedtls_ecdsa_sign().
40193d3b0591SJens Wiklander     Reported by Yolan Romailler.
40203d3b0591SJens Wiklander   * Fix word size check in in pk.c to not depend on MBEDTLS_HAVE_INT64.
40213d3b0591SJens Wiklander   * Fix incorrect unit in benchmark output. #850
40223d3b0591SJens Wiklander   * Add size-checks for record and handshake message content, securing
40233d3b0591SJens Wiklander     fragile yet non-exploitable code-paths.
40243d3b0591SJens Wiklander   * Fix crash when calling mbedtls_ssl_cache_free() twice. Found by
40253d3b0591SJens Wiklander     MilenkoMitrovic, #1104
40263d3b0591SJens Wiklander   * Fix mbedtls_timing_alarm(0) on Unix and MinGW.
40273d3b0591SJens Wiklander   * Fix use of uninitialized memory in mbedtls_timing_get_timer() when reset=1.
40283d3b0591SJens Wiklander   * Fix possible memory leaks in mbedtls_gcm_self_test().
40293d3b0591SJens Wiklander   * Added missing return code checks in mbedtls_aes_self_test().
40303d3b0591SJens Wiklander   * Fix issues in RSA key generation program programs/x509/rsa_genkey and the
40313d3b0591SJens Wiklander     RSA test suite where the failure of CTR DRBG initialization lead to
40323d3b0591SJens Wiklander     freeing an RSA context and several MPI's without proper initialization
40333d3b0591SJens Wiklander     beforehand.
40343d3b0591SJens Wiklander   * Fix error message in programs/pkey/gen_key.c. Found and fixed by Chris Xue.
40353d3b0591SJens Wiklander   * Fix programs/pkey/dh_server.c so that it actually works with dh_client.c.
40363d3b0591SJens Wiklander     Found and fixed by Martijn de Milliano.
40373d3b0591SJens Wiklander   * Fix an issue in the cipher decryption with the mode
40383d3b0591SJens Wiklander     MBEDTLS_PADDING_ONE_AND_ZEROS that sometimes accepted invalid padding.
40393d3b0591SJens Wiklander     Note, this padding mode is not used by the TLS protocol. Found and fixed by
40403d3b0591SJens Wiklander     Micha Kraus.
40413d3b0591SJens Wiklander   * Fix the entropy.c module to not call mbedtls_sha256_starts() or
40423d3b0591SJens Wiklander     mbedtls_sha512_starts() in the mbedtls_entropy_init() function.
40433d3b0591SJens Wiklander   * Fix the entropy.c module to ensure that mbedtls_sha256_init() or
40443d3b0591SJens Wiklander     mbedtls_sha512_init() is called before operating on the relevant context
40453d3b0591SJens Wiklander     structure. Do not assume that zeroizing a context is a correct way to
40463d3b0591SJens Wiklander     reset it. Found independently by ccli8 on Github.
40473d3b0591SJens Wiklander   * In mbedtls_entropy_free(), properly free the message digest context.
40483d3b0591SJens Wiklander   * Fix status handshake status message in programs/ssl/dtls_client.c. Found
40493d3b0591SJens Wiklander     and fixed by muddog.
40503d3b0591SJens Wiklander
40513d3b0591SJens WiklanderChanges
40523d3b0591SJens Wiklander   * Extend cert_write example program by options to set the certificate version
40533d3b0591SJens Wiklander     and the message digest. Further, allow enabling/disabling of authority
40543d3b0591SJens Wiklander     identifier, subject identifier and basic constraints extensions.
40553d3b0591SJens Wiklander   * Only check for necessary RSA structure fields in `mbedtls_rsa_private`. In
40563d3b0591SJens Wiklander     particular, don't require P,Q if neither CRT nor blinding are
40573d3b0591SJens Wiklander     used. Reported and fix proposed independently by satur9nine and sliai
40583d3b0591SJens Wiklander     on GitHub.
40593d3b0591SJens Wiklander   * Only run AES-192 self-test if AES-192 is available. Fixes #963.
40603d3b0591SJens Wiklander   * Tighten the RSA PKCS#1 v1.5 signature verification code and remove the
40613d3b0591SJens Wiklander     undeclared dependency of the RSA module on the ASN.1 module.
40623d3b0591SJens Wiklander   * Update all internal usage of deprecated message digest functions to the
40633d3b0591SJens Wiklander     new ones with return codes. In particular, this modifies the
40643d3b0591SJens Wiklander     mbedtls_md_info_t structure. Propagate errors from these functions
40653d3b0591SJens Wiklander     everywhere except some locations in the ssl_tls.c module.
40663d3b0591SJens Wiklander   * Improve CTR_DRBG error handling by propagating underlying AES errors.
40673d3b0591SJens Wiklander   * Add MBEDTLS_ERR_XXX_HW_ACCEL_FAILED error codes for all cryptography
40683d3b0591SJens Wiklander     modules where the software implementation can be replaced by a hardware
40693d3b0591SJens Wiklander     implementation.
40703d3b0591SJens Wiklander   * Add explicit warnings for the use of MD2, MD4, MD5, SHA-1, DES and ARC4
40713d3b0591SJens Wiklander     throughout the library.
4072817466cbSJens Wiklander
4073817466cbSJens Wiklander= mbed TLS 2.6.0 branch released 2017-08-10
4074817466cbSJens Wiklander
4075817466cbSJens WiklanderSecurity
4076817466cbSJens Wiklander   * Fix authentication bypass in SSL/TLS: when authmode is set to optional,
4077817466cbSJens Wiklander     mbedtls_ssl_get_verify_result() would incorrectly return 0 when the peer's
4078817466cbSJens Wiklander     X.509 certificate chain had more than MBEDTLS_X509_MAX_INTERMEDIATE_CA
4079817466cbSJens Wiklander     (default: 8) intermediates, even when it was not trusted. This could be
4080817466cbSJens Wiklander     triggered remotely from either side. (With authmode set to 'required'
4081817466cbSJens Wiklander     (the default), the handshake was correctly aborted).
4082817466cbSJens Wiklander   * Reliably wipe sensitive data after use in the AES example applications
4083817466cbSJens Wiklander     programs/aes/aescrypt2 and programs/aes/crypt_and_hash.
4084817466cbSJens Wiklander     Found by Laurent Simon.
4085817466cbSJens Wiklander
4086817466cbSJens WiklanderFeatures
4087817466cbSJens Wiklander   * Add the functions mbedtls_platform_setup() and mbedtls_platform_teardown()
4088817466cbSJens Wiklander     and the context struct mbedtls_platform_context to perform
4089817466cbSJens Wiklander     platform-specific setup and teardown operations. The macro
4090817466cbSJens Wiklander     MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT allows the functions to be overridden
4091817466cbSJens Wiklander     by the user in a platform_alt.h file. These new functions are required in
4092817466cbSJens Wiklander     some embedded environments to provide a means of initialising underlying
4093817466cbSJens Wiklander     cryptographic acceleration hardware.
4094817466cbSJens Wiklander
4095817466cbSJens WiklanderAPI Changes
4096817466cbSJens Wiklander   * Reverted API/ABI breaking changes introduced in mbed TLS 2.5.1, to make the
4097817466cbSJens Wiklander     API consistent with mbed TLS 2.5.0. Specifically removed the inline
4098817466cbSJens Wiklander     qualifier from the functions mbedtls_aes_decrypt, mbedtls_aes_encrypt,
4099817466cbSJens Wiklander     mbedtls_ssl_ciphersuite_uses_ec and mbedtls_ssl_ciphersuite_uses_psk. Found
4100817466cbSJens Wiklander     by James Cowgill. #978
4101817466cbSJens Wiklander   * Certificate verification functions now set flags to -1 in case the full
4102817466cbSJens Wiklander     chain was not verified due to an internal error (including in the verify
4103817466cbSJens Wiklander     callback) or chain length limitations.
4104817466cbSJens Wiklander   * With authmode set to optional, the TLS handshake is now aborted if the
4105817466cbSJens Wiklander     verification of the peer's certificate failed due to an overlong chain or
4106817466cbSJens Wiklander     a fatal error in the verify callback.
4107817466cbSJens Wiklander
4108817466cbSJens WiklanderBugfix
4109817466cbSJens Wiklander   * Add a check if iv_len is zero in GCM, and return an error if it is zero.
4110817466cbSJens Wiklander     Reported by roberto. #716
4111817466cbSJens Wiklander   * Replace preprocessor condition from #if defined(MBEDTLS_THREADING_PTHREAD)
4112817466cbSJens Wiklander     to #if defined(MBEDTLS_THREADING_C) as the library cannot assume they will
4113817466cbSJens Wiklander     always be implemented by pthread support. #696
4114817466cbSJens Wiklander   * Fix a resource leak on Windows platforms in mbedtls_x509_crt_parse_path(),
4115817466cbSJens Wiklander     in the case of an error. Found by redplait. #590
4116817466cbSJens Wiklander   * Add MBEDTLS_MPI_CHK to check for error value of mbedtls_mpi_fill_random.
4117817466cbSJens Wiklander     Reported and fix suggested by guidovranken. #740
4118817466cbSJens Wiklander   * Fix conditional preprocessor directives in bignum.h to enable 64-bit
4119817466cbSJens Wiklander     compilation when using ARM Compiler 6.
4120817466cbSJens Wiklander   * Fix a potential integer overflow in the version verification for DER
4121817466cbSJens Wiklander     encoded X.509 CRLs. The overflow could enable maliciously constructed CRLs
4122817466cbSJens Wiklander     to bypass the version verification check. Found by Peng Li/Yueh-Hsun Lin,
4123817466cbSJens Wiklander     KNOX Security, Samsung Research America
4124817466cbSJens Wiklander   * Fix potential integer overflow in the version verification for DER
4125817466cbSJens Wiklander     encoded X.509 CSRs. The overflow could enable maliciously constructed CSRs
4126817466cbSJens Wiklander     to bypass the version verification check. Found by Peng Li/Yueh-Hsun Lin,
4127817466cbSJens Wiklander     KNOX Security, Samsung Research America
4128817466cbSJens Wiklander   * Fix a potential integer overflow in the version verification for DER
4129817466cbSJens Wiklander     encoded X.509 certificates. The overflow could enable maliciously
4130817466cbSJens Wiklander     constructed certificates to bypass the certificate verification check.
4131817466cbSJens Wiklander   * Fix a call to the libc function time() to call the platform abstraction
4132817466cbSJens Wiklander     function mbedtls_time() instead. Found by wairua. #666
4133817466cbSJens Wiklander   * Avoid shadowing of time and index functions through mbed TLS function
4134817466cbSJens Wiklander     arguments. Found by inestlerode. #557.
4135817466cbSJens Wiklander
4136817466cbSJens WiklanderChanges
4137817466cbSJens Wiklander   * Added config.h option MBEDTLS_NO_UDBL_DIVISION, to prevent the use of
4138817466cbSJens Wiklander     64-bit division. This is useful on embedded platforms where 64-bit division
4139817466cbSJens Wiklander     created a dependency on external libraries. #708
4140817466cbSJens Wiklander   * Removed mutexes from ECP hardware accelerator code. Now all hardware
4141817466cbSJens Wiklander     accelerator code in the library leaves concurrency handling to the
4142817466cbSJens Wiklander     platform. Reported by Steven Cooreman. #863
4143817466cbSJens Wiklander   * Define the macro MBEDTLS_AES_ROM_TABLES in the configuration file
4144817466cbSJens Wiklander     config-no-entropy.h to reduce the RAM footprint.
4145817466cbSJens Wiklander   * Added a test script that can be hooked into git that verifies commits
4146817466cbSJens Wiklander     before they are pushed.
4147817466cbSJens Wiklander   * Improve documentation of PKCS1 decryption functions.
4148817466cbSJens Wiklander
4149817466cbSJens Wiklander= mbed TLS 2.5.1 released 2017-06-21
4150817466cbSJens Wiklander
4151817466cbSJens WiklanderSecurity
4152817466cbSJens Wiklander   * Fixed unlimited overread of heap-based buffer in mbedtls_ssl_read().
4153817466cbSJens Wiklander     The issue could only happen client-side with renegotiation enabled.
4154817466cbSJens Wiklander     Could result in DoS (application crash) or information leak
4155817466cbSJens Wiklander     (if the application layer sent data read from mbedtls_ssl_read()
4156817466cbSJens Wiklander     back to the server or to a third party). Can be triggered remotely.
4157817466cbSJens Wiklander   * Removed SHA-1 and RIPEMD-160 from the default hash algorithms for
4158817466cbSJens Wiklander     certificate verification. SHA-1 can be turned back on with a compile-time
4159817466cbSJens Wiklander     option if needed.
4160817466cbSJens Wiklander   * Fixed offset in FALLBACK_SCSV parsing that caused TLS server to fail to
4161817466cbSJens Wiklander     detect it sometimes. Reported by Hugo Leisink. #810
4162817466cbSJens Wiklander   * Tighten parsing of RSA PKCS#1 v1.5 signatures, to avoid a
4163817466cbSJens Wiklander     potential Bleichenbacher/BERserk-style attack.
4164817466cbSJens Wiklander
4165817466cbSJens WiklanderBugfix
4166817466cbSJens Wiklander   * Remove size zero arrays from ECJPAKE test suite. Size zero arrays are not
4167817466cbSJens Wiklander     valid C and they prevented the test from compiling in Visual Studio 2015
4168817466cbSJens Wiklander     and with GCC using the -Wpedantic compilation option.
4169817466cbSJens Wiklander   * Fix insufficient support for signature-hash-algorithm extension,
4170817466cbSJens Wiklander     resulting in compatibility problems with Chrome. Found by hfloyrd. #823
4171817466cbSJens Wiklander   * Fix behaviour that hid the original cause of fatal alerts in some cases
4172817466cbSJens Wiklander     when sending the alert failed. The fix makes sure not to hide the error
4173817466cbSJens Wiklander     that triggered the alert.
4174817466cbSJens Wiklander   * Fix SSLv3 renegotiation behaviour and stop processing data received from
4175817466cbSJens Wiklander     peer after sending a fatal alert to refuse a renegotiation attempt.
4176817466cbSJens Wiklander     Previous behaviour was to keep processing data even after the alert has
4177817466cbSJens Wiklander     been sent.
4178817466cbSJens Wiklander   * Accept empty trusted CA chain in authentication mode
41793d3b0591SJens Wiklander     MBEDTLS_SSL_VERIFY_OPTIONAL. Found by Jethro Beekman. #864
4180817466cbSJens Wiklander   * Fix implementation of mbedtls_ssl_parse_certificate() to not annihilate
4181817466cbSJens Wiklander     fatal errors in authentication mode MBEDTLS_SSL_VERIFY_OPTIONAL and to
4182817466cbSJens Wiklander     reflect bad EC curves within verification result.
4183817466cbSJens Wiklander   * Fix bug that caused the modular inversion function to accept the invalid
4184817466cbSJens Wiklander     modulus 1 and therefore to hang. Found by blaufish. #641.
4185817466cbSJens Wiklander   * Fix incorrect sign computation in modular exponentiation when the base is
4186817466cbSJens Wiklander     a negative MPI. Previously the result was always negative. Found by Guido
4187817466cbSJens Wiklander     Vranken.
4188817466cbSJens Wiklander   * Fix a numerical underflow leading to stack overflow in mpi_read_file()
4189817466cbSJens Wiklander     that was triggered uppon reading an empty line. Found by Guido Vranken.
4190817466cbSJens Wiklander
4191817466cbSJens WiklanderChanges
4192817466cbSJens Wiklander   * Send fatal alerts in more cases. The previous behaviour was to skip
4193817466cbSJens Wiklander     sending the fatal alert and just drop the connection.
4194817466cbSJens Wiklander   * Clarify ECDSA documentation and improve the sample code to avoid
4195817466cbSJens Wiklander     misunderstanding and potentially dangerous use of the API. Pointed out
4196817466cbSJens Wiklander     by Jean-Philippe Aumasson.
4197817466cbSJens Wiklander
4198817466cbSJens Wiklander= mbed TLS 2.5.0 branch released 2017-05-17
4199817466cbSJens Wiklander
4200817466cbSJens WiklanderSecurity
4201817466cbSJens Wiklander   * Wipe stack buffers in RSA private key operations
4202817466cbSJens Wiklander     (rsa_rsaes_pkcs1_v15_decrypt(), rsa_rsaes_oaep_decrypt). Found by Laurent
4203817466cbSJens Wiklander     Simon.
4204817466cbSJens Wiklander   * Add exponent blinding to RSA private operations as a countermeasure
4205817466cbSJens Wiklander     against side-channel attacks like the cache attack described in
4206817466cbSJens Wiklander     https://arxiv.org/abs/1702.08719v2.
4207817466cbSJens Wiklander     Found and fix proposed by Michael Schwarz, Samuel Weiser, Daniel Gruss,
4208817466cbSJens Wiklander     Clémentine Maurice and Stefan Mangard.
4209817466cbSJens Wiklander
4210817466cbSJens WiklanderFeatures
4211817466cbSJens Wiklander   * Add hardware acceleration support for the Elliptic Curve Point module.
4212817466cbSJens Wiklander     This involved exposing parts of the internal interface to enable
4213817466cbSJens Wiklander     replacing the core functions and adding and alternative, module level
4214817466cbSJens Wiklander     replacement support for enabling the extension of the interface.
4215817466cbSJens Wiklander   * Add a new configuration option to 'mbedtls_ssl_config' to enable
4216817466cbSJens Wiklander     suppressing the CA list in Certificate Request messages. The default
4217817466cbSJens Wiklander     behaviour has not changed, namely every configured CAs name is included.
4218817466cbSJens Wiklander
4219817466cbSJens WiklanderAPI Changes
4220817466cbSJens Wiklander   * The following functions in the AES module have been deprecated and replaced
4221817466cbSJens Wiklander     by the functions shown below. The new functions change the return type from
4222817466cbSJens Wiklander     void to int to allow returning error codes when using MBEDTLS_AES_ALT,
4223817466cbSJens Wiklander     MBEDTLS_AES_DECRYPT_ALT or MBEDTLS_AES_ENCRYPT_ALT.
4224817466cbSJens Wiklander     mbedtls_aes_decrypt() -> mbedtls_internal_aes_decrypt()
4225817466cbSJens Wiklander     mbedtls_aes_encrypt() -> mbedtls_internal_aes_encrypt()
4226817466cbSJens Wiklander
4227817466cbSJens WiklanderBugfix
4228817466cbSJens Wiklander   * Remove macros from compat-1.3.h that correspond to deleted items from most
4229817466cbSJens Wiklander     recent versions of the library. Found by Kyle Keen.
4230817466cbSJens Wiklander   * Fixed issue in the Threading module that prevented mutexes from
4231817466cbSJens Wiklander     initialising. Found by sznaider. #667 #843
4232817466cbSJens Wiklander   * Add checks in the PK module for the RSA functions on 64-bit systems.
4233817466cbSJens Wiklander     The PK and RSA modules use different types for passing hash length and
4234817466cbSJens Wiklander     without these checks the type cast could lead to data loss. Found by Guido
4235817466cbSJens Wiklander     Vranken.
4236817466cbSJens Wiklander
4237817466cbSJens Wiklander= mbed TLS 2.4.2 branch released 2017-03-08
4238817466cbSJens Wiklander
4239817466cbSJens WiklanderSecurity
4240817466cbSJens Wiklander   * Add checks to prevent signature forgeries for very large messages while
4241817466cbSJens Wiklander     using RSA through the PK module in 64-bit systems. The issue was caused by
4242817466cbSJens Wiklander     some data loss when casting a size_t to an unsigned int value in the
4243817466cbSJens Wiklander     functions rsa_verify_wrap(), rsa_sign_wrap(), rsa_alt_sign_wrap() and
4244817466cbSJens Wiklander     mbedtls_pk_sign(). Found by Jean-Philippe Aumasson.
4245817466cbSJens Wiklander   * Fixed potential livelock during the parsing of a CRL in PEM format in
4246817466cbSJens Wiklander     mbedtls_x509_crl_parse(). A string containing a CRL followed by trailing
4247817466cbSJens Wiklander     characters after the footer could result in the execution of an infinite
4248817466cbSJens Wiklander     loop. The issue can be triggered remotely. Found by Greg Zaverucha,
4249817466cbSJens Wiklander     Microsoft.
4250817466cbSJens Wiklander   * Removed MD5 from the allowed hash algorithms for CertificateRequest and
4251817466cbSJens Wiklander     CertificateVerify messages, to prevent SLOTH attacks against TLS 1.2.
4252817466cbSJens Wiklander     Introduced by interoperability fix for #513.
4253817466cbSJens Wiklander   * Fixed a bug that caused freeing a buffer that was allocated on the stack,
4254817466cbSJens Wiklander     when verifying the validity of a key on secp224k1. This could be
4255817466cbSJens Wiklander     triggered remotely for example with a maliciously constructed certificate
4256817466cbSJens Wiklander     and potentially could lead to remote code execution on some platforms.
4257817466cbSJens Wiklander     Reported independently by rongsaws and Aleksandar Nikolic, Cisco Talos
4258817466cbSJens Wiklander     team. #569 CVE-2017-2784
4259817466cbSJens Wiklander
4260817466cbSJens WiklanderBugfix
4261817466cbSJens Wiklander   * Fix output certificate verification flags set by x509_crt_verify_top() when
4262817466cbSJens Wiklander     traversing a chain of trusted CA. The issue would cause both flags,
4263817466cbSJens Wiklander     MBEDTLS_X509_BADCERT_NOT_TRUSTED and MBEDTLS_X509_BADCERT_EXPIRED, to be
4264817466cbSJens Wiklander     set when the verification conditions are not met regardless of the cause.
4265817466cbSJens Wiklander     Found by Harm Verhagen and inestlerode. #665 #561
4266817466cbSJens Wiklander   * Fix the redefinition of macro ssl_set_bio to an undefined symbol
4267817466cbSJens Wiklander     mbedtls_ssl_set_bio_timeout in compat-1.3.h, by removing it.
4268817466cbSJens Wiklander     Found by omlib-lin. #673
4269817466cbSJens Wiklander   * Fix unused variable/function compilation warnings in pem.c, x509_crt.c and
4270817466cbSJens Wiklander     x509_csr.c that are reported when building mbed TLS with a config.h that
4271817466cbSJens Wiklander     does not define MBEDTLS_PEM_PARSE_C. Found by omnium21. #562
4272817466cbSJens Wiklander   * Fix incorrect renegotiation condition in ssl_check_ctr_renegotiate() that
4273817466cbSJens Wiklander     would compare 64 bits of the record counter instead of 48 bits as indicated
4274817466cbSJens Wiklander     in RFC 6347 Section 4.3.1. This could cause the execution of the
4275817466cbSJens Wiklander     renegotiation routines at unexpected times when the protocol is DTLS. Found
4276817466cbSJens Wiklander     by wariua. #687
4277817466cbSJens Wiklander   * Fixed multiple buffer overreads in mbedtls_pem_read_buffer() when parsing
4278817466cbSJens Wiklander     the input string in PEM format to extract the different components. Found
4279817466cbSJens Wiklander     by Eyal Itkin.
4280817466cbSJens Wiklander   * Fixed potential arithmetic overflow in mbedtls_ctr_drbg_reseed() that could
4281817466cbSJens Wiklander     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4282817466cbSJens Wiklander   * Fixed potential arithmetic overflows in mbedtls_cipher_update() that could
4283817466cbSJens Wiklander     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4284817466cbSJens Wiklander   * Fixed potential arithmetic overflow in mbedtls_md2_update() that could
4285817466cbSJens Wiklander     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4286817466cbSJens Wiklander   * Fixed potential arithmetic overflow in mbedtls_base64_decode() that could
4287817466cbSJens Wiklander     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4288817466cbSJens Wiklander   * Fixed heap overreads in mbedtls_x509_get_time(). Found by Peng
4289817466cbSJens Wiklander     Li/Yueh-Hsun Lin, KNOX Security, Samsung Research America.
4290817466cbSJens Wiklander   * Fix potential memory leak in mbedtls_x509_crl_parse(). The leak was caused
4291817466cbSJens Wiklander     by missing calls to mbedtls_pem_free() in cases when a
4292817466cbSJens Wiklander     MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT error was encountered. Found and
4293817466cbSJens Wiklander     fix proposed by Guido Vranken. #722
4294817466cbSJens Wiklander   * Fixed the templates used to generate project and solution files for Visual
4295817466cbSJens Wiklander     Studio 2015 as well as the files themselves, to remove a build warning
4296817466cbSJens Wiklander     generated in Visual Studio 2015. Reported by Steve Valliere. #742
4297817466cbSJens Wiklander   * Fix a resource leak in ssl_cookie, when using MBEDTLS_THREADING_C.
4298817466cbSJens Wiklander     Raised and fix suggested by Alan Gillingham in the mbed TLS forum. #771
4299817466cbSJens Wiklander   * Fix 1 byte buffer overflow in mbedtls_mpi_write_string() when the MPI
4300817466cbSJens Wiklander     number to write in hexadecimal is negative and requires an odd number of
4301817466cbSJens Wiklander     digits. Found and fixed by Guido Vranken.
4302817466cbSJens Wiklander   * Fix unlisted DES configuration dependency in some pkparse test cases. Found
4303817466cbSJens Wiklander     by inestlerode. #555
4304817466cbSJens Wiklander
4305817466cbSJens Wiklander= mbed TLS 2.4.1 branch released 2016-12-13
4306817466cbSJens Wiklander
4307817466cbSJens WiklanderChanges
4308817466cbSJens Wiklander   * Update to CMAC test data, taken from - NIST Special Publication 800-38B -
4309817466cbSJens Wiklander     Recommendation for Block Cipher Modes of Operation: The CMAC Mode for
4310817466cbSJens Wiklander     Authentication – October  2016
4311817466cbSJens Wiklander
4312817466cbSJens Wiklander= mbed TLS 2.4.0 branch released 2016-10-17
4313817466cbSJens Wiklander
4314817466cbSJens WiklanderSecurity
4315817466cbSJens Wiklander   * Removed the MBEDTLS_SSL_AEAD_RANDOM_IV option, because it was not compliant
4316817466cbSJens Wiklander     with RFC-5116 and could lead to session key recovery in very long TLS
4317817466cbSJens Wiklander     sessions. "Nonce-Disrespecting Adversaries Practical Forgery Attacks on GCM in
4318817466cbSJens Wiklander     TLS" - H. Bock, A. Zauner, S. Devlin, J. Somorovsky, P. Jovanovic.
4319817466cbSJens Wiklander     https://eprint.iacr.org/2016/475.pdf
4320817466cbSJens Wiklander   * Fixed potential stack corruption in mbedtls_x509write_crt_der() and
4321817466cbSJens Wiklander     mbedtls_x509write_csr_der() when the signature is copied to the buffer
4322817466cbSJens Wiklander     without checking whether there is enough space in the destination. The
4323817466cbSJens Wiklander     issue cannot be triggered remotely. Found by Jethro Beekman.
4324817466cbSJens Wiklander
4325817466cbSJens WiklanderFeatures
4326817466cbSJens Wiklander   * Added support for CMAC for AES and 3DES and AES-CMAC-PRF-128, as defined by
4327817466cbSJens Wiklander     NIST SP 800-38B, RFC-4493 and RFC-4615.
4328817466cbSJens Wiklander   * Added hardware entropy selftest to verify that the hardware entropy source
4329817466cbSJens Wiklander     is functioning correctly.
4330817466cbSJens Wiklander   * Added a script to print build environment info for diagnostic use in test
4331817466cbSJens Wiklander     scripts, which is also now called by all.sh.
4332817466cbSJens Wiklander   * Added the macro MBEDTLS_X509_MAX_FILE_PATH_LEN that enables the user to
4333817466cbSJens Wiklander     configure the maximum length of a file path that can be buffered when
4334817466cbSJens Wiklander     calling mbedtls_x509_crt_parse_path().
4335817466cbSJens Wiklander   * Added a configuration file config-no-entropy.h that configures the subset of
4336817466cbSJens Wiklander     library features that do not require an entropy source.
4337817466cbSJens Wiklander   * Added the macro MBEDTLS_ENTROPY_MIN_HARDWARE in config.h. This allows users
4338817466cbSJens Wiklander     to configure the minimum number of bytes for entropy sources using the
4339817466cbSJens Wiklander     mbedtls_hardware_poll() function.
4340817466cbSJens Wiklander
4341817466cbSJens WiklanderBugfix
4342817466cbSJens Wiklander   * Fix for platform time abstraction to avoid dependency issues where a build
4343817466cbSJens Wiklander     may need time but not the standard C library abstraction, and added
4344817466cbSJens Wiklander     configuration consistency checks to check_config.h
4345817466cbSJens Wiklander   * Fix dependency issue in Makefile to allow parallel builds.
4346817466cbSJens Wiklander   * Fix incorrect handling of block lengths in crypt_and_hash.c sample program,
4347817466cbSJens Wiklander     when GCM is used. Found by udf2457. #441
4348817466cbSJens Wiklander   * Fix for key exchanges based on ECDH-RSA or ECDH-ECDSA which weren't
4349817466cbSJens Wiklander     enabled unless others were also present. Found by David Fernandez. #428
4350817466cbSJens Wiklander   * Fix for out-of-tree builds using CMake. Found by jwurzer, and fix based on
4351817466cbSJens Wiklander     a contribution from Tobias Tangemann. #541
4352817466cbSJens Wiklander   * Fixed cert_app.c sample program for debug output and for use when no root
4353817466cbSJens Wiklander     certificates are provided.
4354817466cbSJens Wiklander   * Fix conditional statement that would cause a 1 byte overread in
4355817466cbSJens Wiklander     mbedtls_asn1_get_int(). Found and fixed by Guido Vranken. #599
4356817466cbSJens Wiklander   * Fixed pthread implementation to avoid unintended double initialisations
4357817466cbSJens Wiklander     and double frees. Found by Niklas Amnebratt.
4358817466cbSJens Wiklander   * Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for
4359817466cbSJens Wiklander     builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found
4360817466cbSJens Wiklander     by inestlerode. #559.
4361817466cbSJens Wiklander   * Fix mbedtls_x509_get_sig() to update the ASN1 type in the mbedtls_x509_buf
4362817466cbSJens Wiklander     data structure until after error checks are successful. Found by
4363817466cbSJens Wiklander     subramanyam-c. #622
4364817466cbSJens Wiklander   * Fix documentation and implementation missmatch for function arguments of
4365817466cbSJens Wiklander     mbedtls_gcm_finish(). Found by cmiatpaar. #602
4366817466cbSJens Wiklander   * Guarantee that P>Q at RSA key generation. Found by inestlerode. #558
4367817466cbSJens Wiklander   * Fix potential byte overread when verifying malformed SERVER_HELLO in
4368817466cbSJens Wiklander     ssl_parse_hello_verify_request() for DTLS. Found by Guido Vranken.
4369817466cbSJens Wiklander   * Fix check for validity of date when parsing in mbedtls_x509_get_time().
4370817466cbSJens Wiklander     Found by subramanyam-c. #626
4371817466cbSJens Wiklander   * Fix compatibility issue with Internet Explorer client authentication,
4372817466cbSJens Wiklander     where the limited hash choices prevented the client from sending its
4373817466cbSJens Wiklander     certificate. Found by teumas. #513
4374817466cbSJens Wiklander   * Fix compilation without MBEDTLS_SELF_TEST enabled.
4375817466cbSJens Wiklander
4376817466cbSJens WiklanderChanges
4377817466cbSJens Wiklander   * Extended test coverage of special cases, and added new timing test suite.
4378817466cbSJens Wiklander   * Removed self-tests from the basic-built-test.sh script, and added all
4379817466cbSJens Wiklander     missing self-tests to the test suites, to ensure self-tests are only
4380817466cbSJens Wiklander     executed once.
4381817466cbSJens Wiklander   * Added support for 3 and 4 byte lengths to mbedtls_asn1_write_len().
4382817466cbSJens Wiklander   * Added support for a Yotta specific configuration file -
4383817466cbSJens Wiklander     through the symbol YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE.
4384817466cbSJens Wiklander   * Added optimization for code space for X.509/OID based on configured
4385817466cbSJens Wiklander     features. Contributed by Aviv Palivoda.
4386817466cbSJens Wiklander   * Renamed source file library/net.c to library/net_sockets.c to avoid
4387817466cbSJens Wiklander     naming collision in projects which also have files with the common name
4388817466cbSJens Wiklander     net.c. For consistency, the corresponding header file, net.h, is marked as
4389817466cbSJens Wiklander     deprecated, and its contents moved to net_sockets.h.
4390817466cbSJens Wiklander   * Changed the strategy for X.509 certificate parsing and validation, to no
4391817466cbSJens Wiklander     longer disregard certificates with unrecognised fields.
4392817466cbSJens Wiklander
4393817466cbSJens Wiklander= mbed TLS 2.3.0 branch released 2016-06-28
4394817466cbSJens Wiklander
4395817466cbSJens WiklanderSecurity
4396817466cbSJens Wiklander   * Fix missing padding length check in mbedtls_rsa_rsaes_pkcs1_v15_decrypt
4397817466cbSJens Wiklander     required by PKCS1 v2.2
4398817466cbSJens Wiklander   * Fix potential integer overflow to buffer overflow in
4399817466cbSJens Wiklander     mbedtls_rsa_rsaes_pkcs1_v15_encrypt and mbedtls_rsa_rsaes_oaep_encrypt
4400817466cbSJens Wiklander     (not triggerable remotely in (D)TLS).
4401817466cbSJens Wiklander   * Fix a potential integer underflow to buffer overread in
4402817466cbSJens Wiklander     mbedtls_rsa_rsaes_oaep_decrypt. It is not triggerable remotely in
4403817466cbSJens Wiklander     SSL/TLS.
4404817466cbSJens Wiklander
4405817466cbSJens WiklanderFeatures
4406817466cbSJens Wiklander   * Support for platform abstraction of the standard C library time()
4407817466cbSJens Wiklander     function.
4408817466cbSJens Wiklander
4409817466cbSJens WiklanderBugfix
4410817466cbSJens Wiklander   * Fix bug in mbedtls_mpi_add_mpi() that caused wrong results when the three
4411817466cbSJens Wiklander     arguments where the same (in-place doubling). Found and fixed by Janos
4412817466cbSJens Wiklander     Follath. #309
4413817466cbSJens Wiklander   * Fix potential build failures related to the 'apidoc' target, introduced
4414817466cbSJens Wiklander     in the previous patch release. Found by Robert Scheck. #390 #391
4415817466cbSJens Wiklander   * Fix issue in Makefile that prevented building using armar. #386
44165b25c76aSJerome Forissier   * Fix memory leak that occurred only when ECJPAKE was enabled and ECDHE and
4417817466cbSJens Wiklander     ECDSA was disabled in config.h . The leak didn't occur by default.
4418817466cbSJens Wiklander   * Fix an issue that caused valid certificates to be rejected whenever an
4419817466cbSJens Wiklander     expired or not yet valid certificate was parsed before a valid certificate
4420817466cbSJens Wiklander     in the trusted certificate list.
4421817466cbSJens Wiklander   * Fix bug in mbedtls_x509_crt_parse that caused trailing extra data in the
4422817466cbSJens Wiklander     buffer after DER certificates to be included in the raw representation.
4423817466cbSJens Wiklander   * Fix issue that caused a hang when generating RSA keys of odd bitlength
4424817466cbSJens Wiklander   * Fix bug in mbedtls_rsa_rsaes_pkcs1_v15_encrypt that made null pointer
4425817466cbSJens Wiklander     dereference possible.
4426817466cbSJens Wiklander   * Fix issue that caused a crash if invalid curves were passed to
4427817466cbSJens Wiklander     mbedtls_ssl_conf_curves. #373
4428817466cbSJens Wiklander   * Fix issue in ssl_fork_server which was preventing it from functioning. #429
4429817466cbSJens Wiklander   * Fix memory leaks in test framework
4430817466cbSJens Wiklander   * Fix test in ssl-opt.sh that does not run properly with valgrind
4431817466cbSJens Wiklander   * Fix unchecked calls to mmbedtls_md_setup(). Fix by Brian Murray. #502
4432817466cbSJens Wiklander
4433817466cbSJens WiklanderChanges
4434817466cbSJens Wiklander   * On ARM platforms, when compiling with -O0 with GCC, Clang or armcc5,
4435817466cbSJens Wiklander     don't use the optimized assembly for bignum multiplication. This removes
4436817466cbSJens Wiklander     the need to pass -fomit-frame-pointer to avoid a build error with -O0.
4437817466cbSJens Wiklander   * Disabled SSLv3 in the default configuration.
4438817466cbSJens Wiklander   * Optimized mbedtls_mpi_zeroize() for MPI integer size. (Fix by Alexey
4439817466cbSJens Wiklander     Skalozub).
4440817466cbSJens Wiklander   * Fix non-compliance server extension handling. Extensions for SSLv3 are now
4441817466cbSJens Wiklander     ignored, as required by RFC6101.
4442817466cbSJens Wiklander
4443817466cbSJens Wiklander= mbed TLS 2.2.1 released 2016-01-05
4444817466cbSJens Wiklander
4445817466cbSJens WiklanderSecurity
4446817466cbSJens Wiklander   * Fix potential double free when mbedtls_asn1_store_named_data() fails to
4447817466cbSJens Wiklander     allocate memory. Only used for certificate generation, not triggerable
4448817466cbSJens Wiklander     remotely in SSL/TLS. Found by Rafał Przywara. #367
4449817466cbSJens Wiklander   * Disable MD5 handshake signatures in TLS 1.2 by default to prevent the
4450817466cbSJens Wiklander     SLOTH attack on TLS 1.2 server authentication (other attacks from the
4451817466cbSJens Wiklander     SLOTH paper do not apply to any version of mbed TLS or PolarSSL).
4452817466cbSJens Wiklander     https://www.mitls.org/pages/attacks/SLOTH
4453817466cbSJens Wiklander
4454817466cbSJens WiklanderBugfix
4455817466cbSJens Wiklander   * Fix over-restrictive length limit in GCM. Found by Andreas-N. #362
4456817466cbSJens Wiklander   * Fix bug in certificate validation that caused valid chains to be rejected
4457817466cbSJens Wiklander     when the first intermediate certificate has pathLenConstraint=0. Found by
4458817466cbSJens Wiklander     Nicholas Wilson. Introduced in mbed TLS 2.2.0. #280
4459817466cbSJens Wiklander   * Removed potential leak in mbedtls_rsa_rsassa_pkcs1_v15_sign(), found by
4460817466cbSJens Wiklander     JayaraghavendranK. #372
4461817466cbSJens Wiklander   * Fix suboptimal handling of unexpected records that caused interop issues
4462817466cbSJens Wiklander     with some peers over unreliable links. Avoid dropping an entire DTLS
4463817466cbSJens Wiklander     datagram if a single record in a datagram is unexpected, instead only
4464817466cbSJens Wiklander     drop the record and look at subsequent records (if any are present) in
4465817466cbSJens Wiklander     the same datagram. Found by jeannotlapin. #345
4466817466cbSJens Wiklander
4467817466cbSJens Wiklander= mbed TLS 2.2.0 released 2015-11-04
4468817466cbSJens Wiklander
4469817466cbSJens WiklanderSecurity
4470817466cbSJens Wiklander   * Fix potential double free if mbedtls_ssl_conf_psk() is called more than
4471817466cbSJens Wiklander     once and some allocation fails. Cannot be forced remotely. Found by Guido
4472817466cbSJens Wiklander     Vranken, Intelworks.
4473817466cbSJens Wiklander   * Fix potential heap corruption on Windows when
4474817466cbSJens Wiklander     mbedtls_x509_crt_parse_path() is passed a path longer than 2GB. Cannot be
4475817466cbSJens Wiklander     triggered remotely. Found by Guido Vranken, Intelworks.
4476817466cbSJens Wiklander   * Fix potential buffer overflow in some asn1_write_xxx() functions.
4477817466cbSJens Wiklander     Cannot be triggered remotely unless you create X.509 certificates based
4478817466cbSJens Wiklander     on untrusted input or write keys of untrusted origin. Found by Guido
4479817466cbSJens Wiklander     Vranken, Intelworks.
4480817466cbSJens Wiklander   * The X509 max_pathlen constraint was not enforced on intermediate
4481817466cbSJens Wiklander     certificates. Found by Nicholas Wilson, fix and tests provided by
4482817466cbSJens Wiklander     Janos Follath. #280 and #319
4483817466cbSJens Wiklander
4484817466cbSJens WiklanderFeatures
4485817466cbSJens Wiklander   * Experimental support for EC J-PAKE as defined in Thread 1.0.0.
4486817466cbSJens Wiklander     Disabled by default as the specification might still change.
4487817466cbSJens Wiklander   * Added a key extraction callback to accees the master secret and key
4488817466cbSJens Wiklander     block. (Potential uses include EAP-TLS and Thread.)
4489817466cbSJens Wiklander
4490817466cbSJens WiklanderBugfix
4491817466cbSJens Wiklander   * Self-signed certificates were not excluded from pathlen counting,
4492817466cbSJens Wiklander     resulting in some valid X.509 being incorrectly rejected. Found and fix
4493817466cbSJens Wiklander     provided by Janos Follath. #319
4494817466cbSJens Wiklander   * Fix build error with configurations where ECDHE-PSK is the only key
4495817466cbSJens Wiklander     exchange. Found and fix provided by Chris Hammond. #270
4496817466cbSJens Wiklander   * Fix build error with configurations where RSA, RSA-PSK, ECDH-RSA or
4497817466cbSJens Wiklander     ECHD-ECDSA if the only key exchange. Multiple reports. #310
4498817466cbSJens Wiklander   * Fixed a bug causing some handshakes to fail due to some non-fatal alerts
4499817466cbSJens Wiklander     not being properly ignored. Found by mancha and Kasom Koht-arsa, #308
4500817466cbSJens Wiklander   * mbedtls_x509_crt_verify(_with_profile)() now also checks the key type and
4501817466cbSJens Wiklander     size/curve against the profile. Before that, there was no way to set a
4502817466cbSJens Wiklander     minimum key size for end-entity certificates with RSA keys. Found by
4503817466cbSJens Wiklander     Matthew Page of Scannex Electronics Ltd.
4504817466cbSJens Wiklander   * Fix failures in MPI on Sparc(64) due to use of bad assembly code.
4505817466cbSJens Wiklander     Found by Kurt Danielson. #292
4506817466cbSJens Wiklander   * Fix typo in name of the extKeyUsage OID. Found by inestlerode, #314
4507817466cbSJens Wiklander   * Fix bug in ASN.1 encoding of booleans that caused generated CA
4508817466cbSJens Wiklander     certificates to be rejected by some applications, including OS X
4509817466cbSJens Wiklander     Keychain. Found and fixed by Jonathan Leroy, Inikup.
4510817466cbSJens Wiklander
4511817466cbSJens WiklanderChanges
4512817466cbSJens Wiklander   * Improved performance of mbedtls_ecp_muladd() when one of the scalars is 1
4513817466cbSJens Wiklander     or -1.
4514817466cbSJens Wiklander
4515817466cbSJens Wiklander= mbed TLS 2.1.2 released 2015-10-06
4516817466cbSJens Wiklander
4517817466cbSJens WiklanderSecurity
4518817466cbSJens Wiklander   * Added fix for CVE-2015-5291 to prevent heap corruption due to buffer
4519817466cbSJens Wiklander     overflow of the hostname or session ticket. Found by Guido Vranken,
4520817466cbSJens Wiklander     Intelworks.
4521817466cbSJens Wiklander   * Fix potential double-free if mbedtls_ssl_set_hs_psk() is called more than
4522817466cbSJens Wiklander     once in the same handhake and mbedtls_ssl_conf_psk() was used.
4523817466cbSJens Wiklander     Found and patch provided by Guido Vranken, Intelworks. Cannot be forced
4524817466cbSJens Wiklander     remotely.
4525817466cbSJens Wiklander   * Fix stack buffer overflow in pkcs12 decryption (used by
4526817466cbSJens Wiklander     mbedtls_pk_parse_key(file)() when the password is > 129 bytes.
4527817466cbSJens Wiklander     Found by Guido Vranken, Intelworks. Not triggerable remotely.
4528817466cbSJens Wiklander   * Fix potential buffer overflow in mbedtls_mpi_read_string().
4529817466cbSJens Wiklander     Found by Guido Vranken, Intelworks. Not exploitable remotely in the context
4530817466cbSJens Wiklander     of TLS, but might be in other uses. On 32 bit machines, requires reading a
4531817466cbSJens Wiklander     string of close to or larger than 1GB to exploit; on 64 bit machines, would
4532817466cbSJens Wiklander     require reading a string of close to or larger than 2^62 bytes.
4533817466cbSJens Wiklander   * Fix potential random memory allocation in mbedtls_pem_read_buffer()
4534817466cbSJens Wiklander     on crafted PEM input data. Found and fix provided by Guido Vranken,
4535817466cbSJens Wiklander     Intelworks. Not triggerable remotely in TLS. Triggerable remotely if you
4536817466cbSJens Wiklander     accept PEM data from an untrusted source.
4537817466cbSJens Wiklander   * Fix possible heap buffer overflow in base64_encoded() when the input
4538817466cbSJens Wiklander     buffer is 512MB or larger on 32-bit platforms. Found by Guido Vranken,
4539817466cbSJens Wiklander     Intelworks. Not trigerrable remotely in TLS.
4540817466cbSJens Wiklander   * Fix potential double-free if mbedtls_conf_psk() is called repeatedly on
4541817466cbSJens Wiklander     the same mbedtls_ssl_config object and memory allocation fails. Found by
4542817466cbSJens Wiklander     Guido Vranken, Intelworks. Cannot be forced remotely.
4543817466cbSJens Wiklander   * Fix potential heap buffer overflow in servers that perform client
4544817466cbSJens Wiklander     authentication against a crafted CA cert. Cannot be triggered remotely
4545817466cbSJens Wiklander     unless you allow third parties to pick trust CAs for client auth.
4546817466cbSJens Wiklander     Found by Guido Vranken, Intelworks.
4547817466cbSJens Wiklander
4548817466cbSJens WiklanderBugfix
4549817466cbSJens Wiklander   * Fix compile error in net.c with musl libc. Found and patch provided by
4550817466cbSJens Wiklander     zhasha (#278).
4551817466cbSJens Wiklander   * Fix macroization of 'inline' keyword when building as C++. (#279)
4552817466cbSJens Wiklander
4553817466cbSJens WiklanderChanges
4554817466cbSJens Wiklander   * Added checking of hostname length in mbedtls_ssl_set_hostname() to ensure
4555817466cbSJens Wiklander     domain names are compliant with RFC 1035.
4556817466cbSJens Wiklander   * Fixed paths for check_config.h in example config files. (Found by bachp)
4557817466cbSJens Wiklander     (#291)
4558817466cbSJens Wiklander
4559817466cbSJens Wiklander= mbed TLS 2.1.1 released 2015-09-17
4560817466cbSJens Wiklander
4561817466cbSJens WiklanderSecurity
4562817466cbSJens Wiklander   * Add countermeasure against Lenstra's RSA-CRT attack for PKCS#1 v1.5
4563817466cbSJens Wiklander     signatures. (Found by Florian Weimer, Red Hat.)
4564817466cbSJens Wiklander     https://securityblog.redhat.com/2015/09/02/factoring-rsa-keys-with-tls-perfect-forward-secrecy/
4565817466cbSJens Wiklander   * Fix possible client-side NULL pointer dereference (read) when the client
4566817466cbSJens Wiklander     tries to continue the handshake after it failed (a misuse of the API).
4567817466cbSJens Wiklander     (Found and patch provided by Fabian Foerg, Gotham Digital Science using
4568817466cbSJens Wiklander     afl-fuzz.)
4569817466cbSJens Wiklander
4570817466cbSJens WiklanderBugfix
4571817466cbSJens Wiklander   * Fix warning when using a 64bit platform. (found by embedthis) (#275)
4572817466cbSJens Wiklander   * Fix off-by-one error in parsing Supported Point Format extension that
4573817466cbSJens Wiklander     caused some handshakes to fail.
4574817466cbSJens Wiklander
4575817466cbSJens WiklanderChanges
4576817466cbSJens Wiklander   * Made X509 profile pointer const in mbedtls_ssl_conf_cert_profile() to allow
4577817466cbSJens Wiklander     use of mbedtls_x509_crt_profile_next. (found by NWilson)
4578817466cbSJens Wiklander   * When a client initiates a reconnect from the same port as a live
4579817466cbSJens Wiklander     connection, if cookie verification is available
4580817466cbSJens Wiklander     (MBEDTLS_SSL_DTLS_HELLO_VERIFY defined in config.h, and usable cookie
4581817466cbSJens Wiklander     callbacks set with mbedtls_ssl_conf_dtls_cookies()), this will be
4582817466cbSJens Wiklander     detected and mbedtls_ssl_read() will return
4583817466cbSJens Wiklander     MBEDTLS_ERR_SSL_CLIENT_RECONNECT - it is then possible to start a new
4584817466cbSJens Wiklander     handshake with the same context. (See RFC 6347 section 4.2.8.)
4585817466cbSJens Wiklander
4586817466cbSJens Wiklander= mbed TLS 2.1.0 released 2015-09-04
4587817466cbSJens Wiklander
4588817466cbSJens WiklanderFeatures
4589817466cbSJens Wiklander   * Added support for yotta as a build system.
4590817466cbSJens Wiklander   * Primary open source license changed to Apache 2.0 license.
4591817466cbSJens Wiklander
4592817466cbSJens WiklanderBugfix
4593817466cbSJens Wiklander   * Fix segfault in the benchmark program when benchmarking DHM.
4594817466cbSJens Wiklander   * Fix build error with CMake and pre-4.5 versions of GCC (found by Hugo
4595817466cbSJens Wiklander     Leisink).
4596817466cbSJens Wiklander   * Fix bug when parsing a ServerHello without extensions (found by David
4597817466cbSJens Wiklander     Sears).
4598817466cbSJens Wiklander   * Fix bug in CMake lists that caused libmbedcrypto.a not to be installed
4599817466cbSJens Wiklander     (found by Benoit Lecocq).
4600817466cbSJens Wiklander   * Fix bug in Makefile that caused libmbedcrypto and libmbedx509 not to be
4601817466cbSJens Wiklander     installed (found by Rawi666).
4602817466cbSJens Wiklander   * Fix compile error with armcc 5 with --gnu option.
4603817466cbSJens Wiklander   * Fix bug in Makefile that caused programs not to be installed correctly
4604817466cbSJens Wiklander     (found by robotanarchy) (#232).
4605817466cbSJens Wiklander   * Fix bug in Makefile that prevented from installing without building the
4606817466cbSJens Wiklander     tests (found by robotanarchy) (#232).
4607817466cbSJens Wiklander   * Fix missing -static-libgcc when building shared libraries for Windows
4608817466cbSJens Wiklander     with make.
4609817466cbSJens Wiklander   * Fix link error when building shared libraries for Windows with make.
4610817466cbSJens Wiklander   * Fix error when loading libmbedtls.so.
4611817466cbSJens Wiklander   * Fix bug in mbedtls_ssl_conf_default() that caused the default preset to
4612817466cbSJens Wiklander     be always used (found by dcb314) (#235)
4613817466cbSJens Wiklander   * Fix bug in mbedtls_rsa_public() and mbedtls_rsa_private() that could
4614817466cbSJens Wiklander     result trying to unlock an unlocked mutex on invalid input (found by
4615817466cbSJens Wiklander     Fredrik Axelsson) (#257)
4616817466cbSJens Wiklander   * Fix -Wshadow warnings (found by hnrkp) (#240)
4617817466cbSJens Wiklander   * Fix memory corruption on client with overlong PSK identity, around
4618817466cbSJens Wiklander     SSL_MAX_CONTENT_LEN or higher - not triggerrable remotely (found by
4619817466cbSJens Wiklander     Aleksandrs Saveljevs) (#238)
4620817466cbSJens Wiklander   * Fix unused function warning when using MBEDTLS_MDx_ALT or
4621817466cbSJens Wiklander     MBEDTLS_SHAxxx_ALT (found by Henrik) (#239)
4622817466cbSJens Wiklander   * Fix memory corruption in pkey programs (found by yankuncheng) (#210)
4623817466cbSJens Wiklander
4624817466cbSJens WiklanderChanges
4625817466cbSJens Wiklander   * The PEM parser now accepts a trailing space at end of lines (#226).
4626817466cbSJens Wiklander   * It is now possible to #include a user-provided configuration file at the
4627817466cbSJens Wiklander     end of the default config.h by defining MBEDTLS_USER_CONFIG_FILE on the
4628817466cbSJens Wiklander     compiler's command line.
4629817466cbSJens Wiklander   * When verifying a certificate chain, if an intermediate certificate is
4630817466cbSJens Wiklander     trusted, no later cert is checked. (suggested by hannes-landeholm)
4631817466cbSJens Wiklander     (#220).
4632817466cbSJens Wiklander   * Prepend a "thread identifier" to debug messages (issue pointed out by
4633817466cbSJens Wiklander     Hugo Leisink) (#210).
4634817466cbSJens Wiklander   * Add mbedtls_ssl_get_max_frag_len() to query the current maximum fragment
4635817466cbSJens Wiklander     length.
4636817466cbSJens Wiklander
4637817466cbSJens Wiklander= mbed TLS 2.0.0 released 2015-07-13
4638817466cbSJens Wiklander
4639817466cbSJens WiklanderFeatures
4640817466cbSJens Wiklander   * Support for DTLS 1.0 and 1.2 (RFC 6347).
4641817466cbSJens Wiklander   * Ability to override core functions from MDx, SHAx, AES and DES modules
4642817466cbSJens Wiklander     with custom implementation (eg hardware accelerated), complementing the
4643817466cbSJens Wiklander     ability to override the whole module.
4644817466cbSJens Wiklander   * New server-side implementation of session tickets that rotate keys to
4645817466cbSJens Wiklander     preserve forward secrecy, and allows sharing across multiple contexts.
4646817466cbSJens Wiklander   * Added a concept of X.509 cerificate verification profile that controls
4647817466cbSJens Wiklander     which algorithms and key sizes (curves for ECDSA) are acceptable.
4648817466cbSJens Wiklander   * Expanded configurability of security parameters in the SSL module with
4649817466cbSJens Wiklander     mbedtls_ssl_conf_dhm_min_bitlen() and mbedtls_ssl_conf_sig_hashes().
4650817466cbSJens Wiklander   * Introduced a concept of presets for SSL security-relevant configuration
4651817466cbSJens Wiklander     parameters.
4652817466cbSJens Wiklander
4653817466cbSJens WiklanderAPI Changes
4654817466cbSJens Wiklander   * The library has been split into libmbedcrypto, libmbedx509, libmbedtls.
4655817466cbSJens Wiklander     You now need to link to all of them if you use TLS for example.
4656817466cbSJens Wiklander   * All public identifiers moved to the mbedtls_* or MBEDTLS_* namespace.
4657817466cbSJens Wiklander     Some names have been further changed to make them more consistent.
46585b25c76aSJerome Forissier     Migration helpers scripts/rename.pl and include/mbedtls/compat-1.3.h are
4659817466cbSJens Wiklander     provided. Full list of renamings in scripts/data_files/rename-1.3-2.0.txt
4660817466cbSJens Wiklander   * Renamings of fields inside structures, not covered by the previous list:
4661817466cbSJens Wiklander     mbedtls_cipher_info_t.key_length -> key_bitlen
4662817466cbSJens Wiklander     mbedtls_cipher_context_t.key_length -> key_bitlen
4663817466cbSJens Wiklander     mbedtls_ecp_curve_info.size -> bit_size
4664817466cbSJens Wiklander   * Headers are now found in the 'mbedtls' directory (previously 'polarssl').
4665817466cbSJens Wiklander   * The following _init() functions that could return errors have
4666817466cbSJens Wiklander     been split into an _init() that returns void and another function that
4667817466cbSJens Wiklander     should generally be the first function called on this context after init:
4668817466cbSJens Wiklander     mbedtls_ssl_init() -> mbedtls_ssl_setup()
4669817466cbSJens Wiklander     mbedtls_ccm_init() -> mbedtls_ccm_setkey()
4670817466cbSJens Wiklander     mbedtls_gcm_init() -> mbedtls_gcm_setkey()
4671817466cbSJens Wiklander     mbedtls_hmac_drbg_init() -> mbedtls_hmac_drbg_seed(_buf)()
4672817466cbSJens Wiklander     mbedtls_ctr_drbg_init()  -> mbedtls_ctr_drbg_seed()
4673817466cbSJens Wiklander     Note that for mbedtls_ssl_setup(), you need to be done setting up the
4674817466cbSJens Wiklander     ssl_config structure before calling it.
4675817466cbSJens Wiklander   * Most ssl_set_xxx() functions (all except ssl_set_bio(), ssl_set_hostname(),
4676817466cbSJens Wiklander     ssl_set_session() and ssl_set_client_transport_id(), plus
4677817466cbSJens Wiklander     ssl_legacy_renegotiation()) have been renamed to mbedtls_ssl_conf_xxx()
4678817466cbSJens Wiklander     (see rename.pl and compat-1.3.h above) and their first argument's type
4679817466cbSJens Wiklander     changed from ssl_context to ssl_config.
4680817466cbSJens Wiklander   * ssl_set_bio() changed signature (contexts merged, order switched, one
4681817466cbSJens Wiklander     additional callback for read-with-timeout).
4682817466cbSJens Wiklander   * The following functions have been introduced and must be used in callback
4683817466cbSJens Wiklander     implementations (SNI, PSK) instead of their *conf counterparts:
4684817466cbSJens Wiklander     mbedtls_ssl_set_hs_own_cert()
4685817466cbSJens Wiklander     mbedtls_ssl_set_hs_ca_chain()
4686817466cbSJens Wiklander     mbedtls_ssl_set_hs_psk()
4687817466cbSJens Wiklander   * mbedtls_ssl_conf_ca_chain() lost its last argument (peer_cn), now set
4688817466cbSJens Wiklander     using mbedtls_ssl_set_hostname().
4689817466cbSJens Wiklander   * mbedtls_ssl_conf_session_cache() changed prototype (only one context
4690817466cbSJens Wiklander     pointer, parameters reordered).
4691817466cbSJens Wiklander   * On server, mbedtls_ssl_conf_session_tickets_cb() must now be used in
4692817466cbSJens Wiklander     place of mbedtls_ssl_conf_session_tickets() to enable session tickets.
4693817466cbSJens Wiklander   * The SSL debug callback gained two new arguments (file name, line number).
4694817466cbSJens Wiklander   * Debug modes were removed.
4695817466cbSJens Wiklander   * mbedtls_ssl_conf_truncated_hmac() now returns void.
4696817466cbSJens Wiklander   * mbedtls_memory_buffer_alloc_init() now returns void.
4697817466cbSJens Wiklander   * X.509 verification flags are now an uint32_t. Affect the signature of:
4698817466cbSJens Wiklander     mbedtls_ssl_get_verify_result()
4699817466cbSJens Wiklander     mbedtls_x509_ctr_verify_info()
4700817466cbSJens Wiklander     mbedtls_x509_crt_verify() (flags, f_vrfy -> needs to be updated)
4701817466cbSJens Wiklander     mbedtls_ssl_conf_verify() (f_vrfy -> needs to be updated)
4702817466cbSJens Wiklander   * The following functions changed prototype to avoid an in-out length
4703817466cbSJens Wiklander     parameter:
4704817466cbSJens Wiklander     mbedtls_base64_encode()
4705817466cbSJens Wiklander     mbedtls_base64_decode()
4706817466cbSJens Wiklander     mbedtls_mpi_write_string()
4707817466cbSJens Wiklander     mbedtls_dhm_calc_secret()
4708817466cbSJens Wiklander   * In the NET module, all "int" and "int *" arguments for file descriptors
4709817466cbSJens Wiklander     changed type to "mbedtls_net_context *".
4710817466cbSJens Wiklander   * net_accept() gained new arguments for the size of the client_ip buffer.
4711817466cbSJens Wiklander   * In the threading layer, mbedtls_mutex_init() and mbedtls_mutex_free() now
4712817466cbSJens Wiklander     return void.
47135b25c76aSJerome Forissier   * ecdsa_write_signature() gained an additional md_alg argument and
4714817466cbSJens Wiklander     ecdsa_write_signature_det() was deprecated.
4715817466cbSJens Wiklander   * pk_sign() no longer accepts md_alg == POLARSSL_MD_NONE with ECDSA.
4716817466cbSJens Wiklander   * Last argument of x509_crt_check_key_usage() and
4717817466cbSJens Wiklander     mbedtls_x509write_crt_set_key_usage() changed from int to unsigned.
4718817466cbSJens Wiklander   * test_ca_list (from certs.h) is renamed to test_cas_pem and is only
4719817466cbSJens Wiklander     available if POLARSSL_PEM_PARSE_C is defined (it never worked without).
4720817466cbSJens Wiklander   * Test certificates in certs.c are no longer guaranteed to be nul-terminated
4721817466cbSJens Wiklander     strings; use the new *_len variables instead of strlen().
4722817466cbSJens Wiklander   * Functions mbedtls_x509_xxx_parse(), mbedtls_pk_parse_key(),
4723817466cbSJens Wiklander     mbedtls_pk_parse_public_key() and mbedtls_dhm_parse_dhm() now expect the
4724817466cbSJens Wiklander     length parameter to include the terminating null byte for PEM input.
4725817466cbSJens Wiklander   * Signature of mpi_mul_mpi() changed to make the last argument unsigned
4726817466cbSJens Wiklander   * calloc() is now used instead of malloc() everywhere. API of platform
4727817466cbSJens Wiklander     layer and the memory_buffer_alloc module changed accordingly.
4728817466cbSJens Wiklander     (Thanks to Mansour Moufid for helping with the replacement.)
4729817466cbSJens Wiklander   * Change SSL_DISABLE_RENEGOTIATION config.h flag to SSL_RENEGOTIATION
4730817466cbSJens Wiklander     (support for renegotiation now needs explicit enabling in config.h).
4731817466cbSJens Wiklander   * Split MBEDTLS_HAVE_TIME into MBEDTLS_HAVE_TIME and MBEDTLS_HAVE_TIME_DATE
4732817466cbSJens Wiklander     in config.h
4733817466cbSJens Wiklander   * net_connect() and net_bind() have a new 'proto' argument to choose
4734817466cbSJens Wiklander     between TCP and UDP, using the macros NET_PROTO_TCP or NET_PROTO_UDP.
4735817466cbSJens Wiklander     Their 'port' argument type is changed to a string.
4736817466cbSJens Wiklander   * Some constness fixes
4737817466cbSJens Wiklander
4738817466cbSJens WiklanderRemovals
4739817466cbSJens Wiklander   * Removed mbedtls_ecp_group_read_string(). Only named groups are supported.
4740817466cbSJens Wiklander   * Removed mbedtls_ecp_sub() and mbedtls_ecp_add(), use
4741817466cbSJens Wiklander     mbedtls_ecp_muladd().
4742817466cbSJens Wiklander   * Removed individual mdX_hmac, shaX_hmac, mdX_file and shaX_file functions
4743817466cbSJens Wiklander     (use generic functions from md.h)
4744817466cbSJens Wiklander   * Removed mbedtls_timing_msleep(). Use mbedtls_net_usleep() or a custom
4745817466cbSJens Wiklander     waiting function.
4746817466cbSJens Wiklander   * Removed test DHM parameters from the test certs module.
4747817466cbSJens Wiklander   * Removed the PBKDF2 module (use PKCS5).
4748817466cbSJens Wiklander   * Removed POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()).
4749817466cbSJens Wiklander   * Removed compat-1.2.h (helper for migrating from 1.2 to 1.3).
4750817466cbSJens Wiklander   * Removed openssl.h (very partial OpenSSL compatibility layer).
4751817466cbSJens Wiklander   * Configuration options POLARSSL_HAVE_LONGLONG was removed (now always on).
4752817466cbSJens Wiklander   * Configuration options POLARSSL_HAVE_INT8 and POLARSSL_HAVE_INT16 have
4753817466cbSJens Wiklander     been removed (compiler is required to support 32-bit operations).
4754817466cbSJens Wiklander   * Configuration option POLARSSL_HAVE_IPV6 was removed (always enabled).
4755817466cbSJens Wiklander   * Removed test program o_p_test, the script compat.sh does more.
4756817466cbSJens Wiklander   * Removed test program ssl_test, superseded by ssl-opt.sh.
4757817466cbSJens Wiklander   * Removed helper script active-config.pl
4758817466cbSJens Wiklander
4759817466cbSJens WiklanderNew deprecations
4760817466cbSJens Wiklander   * md_init_ctx() is deprecated in favour of md_setup(), that adds a third
4761817466cbSJens Wiklander     argument (allowing memory savings if HMAC is not used)
4762817466cbSJens Wiklander
4763817466cbSJens WiklanderSemi-API changes (technically public, morally private)
4764817466cbSJens Wiklander   * Renamed a few headers to include _internal in the name. Those headers are
4765817466cbSJens Wiklander     not supposed to be included by users.
4766817466cbSJens Wiklander   * Changed md_info_t into an opaque structure (use md_get_xxx() accessors).
4767817466cbSJens Wiklander   * Changed pk_info_t into an opaque structure.
4768817466cbSJens Wiklander   * Changed cipher_base_t into an opaque structure.
4769817466cbSJens Wiklander   * Removed sig_oid2 and rename sig_oid1 to sig_oid in x509_crt and x509_crl.
4770817466cbSJens Wiklander   * x509_crt.key_usage changed from unsigned char to unsigned int.
4771817466cbSJens Wiklander   * Removed r and s from ecdsa_context
4772817466cbSJens Wiklander   * Removed mode from des_context and des3_context
4773817466cbSJens Wiklander
4774817466cbSJens WiklanderDefault behavior changes
4775817466cbSJens Wiklander   * The default minimum TLS version is now TLS 1.0.
4776817466cbSJens Wiklander   * RC4 is now blacklisted by default in the SSL/TLS layer, and excluded from the
4777817466cbSJens Wiklander     default ciphersuite list returned by ssl_list_ciphersuites()
4778817466cbSJens Wiklander   * Support for receiving SSLv2 ClientHello is now disabled by default at
4779817466cbSJens Wiklander     compile time.
4780817466cbSJens Wiklander   * The default authmode for SSL/TLS clients is now REQUIRED.
4781817466cbSJens Wiklander   * Support for RSA_ALT contexts in the PK layer is now optional. Since is is
4782817466cbSJens Wiklander     enabled in the default configuration, this is only noticeable if using a
4783817466cbSJens Wiklander     custom config.h
4784817466cbSJens Wiklander   * Default DHM parameters server-side upgraded from 1024 to 2048 bits.
4785817466cbSJens Wiklander   * A minimum RSA key size of 2048 bits is now enforced during ceritificate
4786817466cbSJens Wiklander     chain verification.
4787817466cbSJens Wiklander   * Negotiation of truncated HMAC is now disabled by default on server too.
4788817466cbSJens Wiklander   * The following functions are now case-sensitive:
4789817466cbSJens Wiklander     mbedtls_cipher_info_from_string()
4790817466cbSJens Wiklander     mbedtls_ecp_curve_info_from_name()
4791817466cbSJens Wiklander     mbedtls_md_info_from_string()
4792817466cbSJens Wiklander     mbedtls_ssl_ciphersuite_from_string()
4793817466cbSJens Wiklander     mbedtls_version_check_feature()
4794817466cbSJens Wiklander
4795817466cbSJens WiklanderRequirement changes
4796817466cbSJens Wiklander   * The minimum MSVC version required is now 2010 (better C99 support).
4797817466cbSJens Wiklander   * The NET layer now unconditionnaly relies on getaddrinfo() and select().
4798817466cbSJens Wiklander   * Compiler is required to support C99 types such as long long and uint32_t.
4799817466cbSJens Wiklander
4800817466cbSJens WiklanderAPI changes from the 1.4 preview branch
4801817466cbSJens Wiklander   * ssl_set_bio_timeout() was removed, split into mbedtls_ssl_set_bio() with
4802817466cbSJens Wiklander     new prototype, and mbedtls_ssl_set_read_timeout().
4803817466cbSJens Wiklander   * The following functions now return void:
4804817466cbSJens Wiklander     mbedtls_ssl_conf_transport()
4805817466cbSJens Wiklander     mbedtls_ssl_conf_max_version()
4806817466cbSJens Wiklander     mbedtls_ssl_conf_min_version()
4807817466cbSJens Wiklander   * DTLS no longer hard-depends on TIMING_C, but uses a callback interface
4808817466cbSJens Wiklander     instead, see mbedtls_ssl_set_timer_cb(), with the Timing module providing
4809817466cbSJens Wiklander     an example implementation, see mbedtls_timing_delay_context and
4810817466cbSJens Wiklander     mbedtls_timing_set/get_delay().
4811817466cbSJens Wiklander   * With UDP sockets, it is no longer necessary to call net_bind() again
4812817466cbSJens Wiklander     after a successful net_accept().
4813817466cbSJens Wiklander
4814817466cbSJens WiklanderChanges
4815817466cbSJens Wiklander   * mbedtls_ctr_drbg_random() and mbedtls_hmac_drbg_random() are now
4816817466cbSJens Wiklander     thread-safe if MBEDTLS_THREADING_C is enabled.
4817817466cbSJens Wiklander   * Reduced ROM fooprint of SHA-256 and added an option to reduce it even
4818817466cbSJens Wiklander     more (at the expense of performance) MBEDTLS_SHA256_SMALLER.
4819817466cbSJens Wiklander
4820817466cbSJens Wiklander= mbed TLS 1.3 branch
4821817466cbSJens Wiklander
4822817466cbSJens WiklanderSecurity
4823817466cbSJens Wiklander   * With authmode set to SSL_VERIFY_OPTIONAL, verification of keyUsage and
4824817466cbSJens Wiklander     extendedKeyUsage on the leaf certificate was lost (results not accessible
4825817466cbSJens Wiklander     via ssl_get_verify_results()).
4826817466cbSJens Wiklander   * Add countermeasure against "Lucky 13 strikes back" cache-based attack,
4827817466cbSJens Wiklander     https://dl.acm.org/citation.cfm?id=2714625
4828817466cbSJens Wiklander
4829817466cbSJens WiklanderFeatures
4830817466cbSJens Wiklander   * Improve ECC performance by using more efficient doubling formulas
4831817466cbSJens Wiklander     (contributed by Peter Dettman).
4832817466cbSJens Wiklander   * Add x509_crt_verify_info() to display certificate verification results.
4833817466cbSJens Wiklander   * Add support for reading DH parameters with privateValueLength included
4834817466cbSJens Wiklander     (contributed by Daniel Kahn Gillmor).
4835817466cbSJens Wiklander   * Add support for bit strings in X.509 names (request by Fredrik Axelsson).
4836817466cbSJens Wiklander   * Add support for id-at-uniqueIdentifier in X.509 names.
4837817466cbSJens Wiklander   * Add support for overriding snprintf() (except on Windows) and exit() in
4838817466cbSJens Wiklander     the platform layer.
4839817466cbSJens Wiklander   * Add an option to use macros instead of function pointers in the platform
4840817466cbSJens Wiklander     layer (helps get rid of unwanted references).
4841817466cbSJens Wiklander   * Improved Makefiles for Windows targets by fixing library targets and making
4842817466cbSJens Wiklander     cross-compilation easier (thanks to Alon Bar-Lev).
4843817466cbSJens Wiklander   * The benchmark program also prints heap usage for public-key primitives
4844817466cbSJens Wiklander     if POLARSSL_MEMORY_BUFFER_ALLOC_C and POLARSSL_MEMORY_DEBUG are defined.
4845817466cbSJens Wiklander   * New script ecc-heap.sh helps measuring the impact of ECC parameters on
4846817466cbSJens Wiklander     speed and RAM (heap only for now) usage.
4847817466cbSJens Wiklander   * New script memory.sh helps measuring the ROM and RAM requirements of two
4848817466cbSJens Wiklander     reduced configurations (PSK-CCM and NSA suite B).
4849817466cbSJens Wiklander   * Add config flag POLARSSL_DEPRECATED_WARNING (off by default) to produce
4850817466cbSJens Wiklander     warnings on use of deprecated functions (with GCC and Clang only).
4851817466cbSJens Wiklander   * Add config flag POLARSSL_DEPRECATED_REMOVED (off by default) to produce
4852817466cbSJens Wiklander     errors on use of deprecated functions.
4853817466cbSJens Wiklander
4854817466cbSJens WiklanderBugfix
4855817466cbSJens Wiklander   * Fix compile errors with PLATFORM_NO_STD_FUNCTIONS.
4856817466cbSJens Wiklander   * Fix compile error with PLATFORM_EXIT_ALT (thanks to Rafał Przywara).
4857817466cbSJens Wiklander   * Fix bug in entropy.c when THREADING_C is also enabled that caused
4858817466cbSJens Wiklander     entropy_free() to crash (thanks to Rafał Przywara).
4859817466cbSJens Wiklander   * Fix memory leak when gcm_setkey() and ccm_setkey() are used more than
4860817466cbSJens Wiklander     once on the same context.
4861817466cbSJens Wiklander   * Fix bug in ssl_mail_client when password is longer that username (found
4862817466cbSJens Wiklander     by Bruno Pape).
4863817466cbSJens Wiklander   * Fix undefined behaviour (memcmp( NULL, NULL, 0 );) in X.509 modules
4864817466cbSJens Wiklander     (detected by Clang's 3.6 UBSan).
4865817466cbSJens Wiklander   * mpi_size() and mpi_msb() would segfault when called on an mpi that is
4866817466cbSJens Wiklander     initialized but not set (found by pravic).
4867817466cbSJens Wiklander   * Fix detection of support for getrandom() on Linux (reported by syzzer) by
4868817466cbSJens Wiklander     doing it at runtime (using uname) rather that compile time.
4869817466cbSJens Wiklander   * Fix handling of symlinks by "make install" (found by Gaël PORTAY).
4870817466cbSJens Wiklander   * Fix potential NULL pointer dereference (not trigerrable remotely) when
4871817466cbSJens Wiklander     ssl_write() is called before the handshake is finished (introduced in
4872817466cbSJens Wiklander     1.3.10) (first reported by Martin Blumenstingl).
4873817466cbSJens Wiklander   * Fix bug in pk_parse_key() that caused some valid private EC keys to be
4874817466cbSJens Wiklander     rejected.
4875817466cbSJens Wiklander   * Fix bug in Via Padlock support (found by Nikos Mavrogiannopoulos).
4876817466cbSJens Wiklander   * Fix thread safety bug in RSA operations (found by Fredrik Axelsson).
4877817466cbSJens Wiklander   * Fix hardclock() (only used in the benchmarking program) with some
4878817466cbSJens Wiklander     versions of mingw64 (found by kxjhlele).
4879817466cbSJens Wiklander   * Fix warnings from mingw64 in timing.c (found by kxjklele).
4880817466cbSJens Wiklander   * Fix potential unintended sign extension in asn1_get_len() on 64-bit
4881817466cbSJens Wiklander     platforms.
4882817466cbSJens Wiklander   * Fix potential memory leak in ssl_set_psk() (found by Mansour Moufid).
4883817466cbSJens Wiklander   * Fix compile error when POLARSSL_SSL_DISABLE_RENEGOTATION and
4884817466cbSJens Wiklander     POLARSSL_SSL_SSESSION_TICKETS where both enabled in config.h (introduced
4885817466cbSJens Wiklander     in 1.3.10).
4886817466cbSJens Wiklander   * Add missing extern "C" guard in aesni.h (reported by amir zamani).
4887817466cbSJens Wiklander   * Add missing dependency on SHA-256 in some x509 programs (reported by
4888817466cbSJens Wiklander     Gergely Budai).
4889817466cbSJens Wiklander   * Fix bug related to ssl_set_curves(): the client didn't check that the
4890817466cbSJens Wiklander     curve picked by the server was actually allowed.
4891817466cbSJens Wiklander
4892817466cbSJens WiklanderChanges
4893817466cbSJens Wiklander   * Remove bias in mpi_gen_prime (contributed by Pascal Junod).
4894817466cbSJens Wiklander   * Remove potential sources of timing variations (some contributed by Pascal
4895817466cbSJens Wiklander     Junod).
4896817466cbSJens Wiklander   * Options POLARSSL_HAVE_INT8 and POLARSSL_HAVE_INT16 are deprecated.
4897817466cbSJens Wiklander   * Enabling POLARSSL_NET_C without POLARSSL_HAVE_IPV6 is deprecated.
4898817466cbSJens Wiklander   * compat-1.2.h and openssl.h are deprecated.
4899817466cbSJens Wiklander   * Adjusting/overriding CFLAGS and LDFLAGS with the make build system is now
4900817466cbSJens Wiklander     more flexible (warning: OFLAGS is not used any more) (see the README)
4901817466cbSJens Wiklander     (contributed by Alon Bar-Lev).
4902817466cbSJens Wiklander   * ssl_set_own_cert() no longer calls pk_check_pair() since the
4903817466cbSJens Wiklander     performance impact was bad for some users (this was introduced in 1.3.10).
4904817466cbSJens Wiklander   * Move from SHA-1 to SHA-256 in example programs using signatures
4905817466cbSJens Wiklander     (suggested by Thorsten Mühlfelder).
4906817466cbSJens Wiklander   * Remove some unneeded inclusions of header files from the standard library
4907817466cbSJens Wiklander     "minimize" others (eg use stddef.h if only size_t is needed).
4908817466cbSJens Wiklander   * Change #include lines in test files to use double quotes instead of angle
4909817466cbSJens Wiklander     brackets for uniformity with the rest of the code.
4910817466cbSJens Wiklander   * Remove dependency on sscanf() in X.509 parsing modules.
4911817466cbSJens Wiklander
4912817466cbSJens Wiklander= mbed TLS 1.3.10 released 2015-02-09
4913817466cbSJens WiklanderSecurity
4914817466cbSJens Wiklander   * NULL pointer dereference in the buffer-based allocator when the buffer is
4915817466cbSJens Wiklander     full and polarssl_free() is called (found by Mark Hasemeyer)
4916817466cbSJens Wiklander     (only possible if POLARSSL_MEMORY_BUFFER_ALLOC_C is enabled, which it is
4917817466cbSJens Wiklander     not by default).
4918817466cbSJens Wiklander   * Fix remotely-triggerable uninitialised pointer dereference caused by
4919817466cbSJens Wiklander     crafted X.509 certificate (TLS server is not affected if it doesn't ask for a
4920817466cbSJens Wiklander     client certificate) (found using Codenomicon Defensics).
4921817466cbSJens Wiklander   * Fix remotely-triggerable memory leak caused by crafted X.509 certificates
4922817466cbSJens Wiklander     (TLS server is not affected if it doesn't ask for a client certificate)
4923817466cbSJens Wiklander     (found using Codenomicon Defensics).
4924817466cbSJens Wiklander   * Fix potential stack overflow while parsing crafted X.509 certificates
4925817466cbSJens Wiklander     (TLS server is not affected if it doesn't ask for a client certificate)
4926817466cbSJens Wiklander     (found using Codenomicon Defensics).
4927817466cbSJens Wiklander   * Fix timing difference that could theoretically lead to a
4928817466cbSJens Wiklander     Bleichenbacher-style attack in the RSA and RSA-PSK key exchanges
4929817466cbSJens Wiklander     (reported by Sebastian Schinzel).
4930817466cbSJens Wiklander
4931817466cbSJens WiklanderFeatures
4932817466cbSJens Wiklander   * Add support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv).
4933817466cbSJens Wiklander   * Add support for Extended Master Secret (draft-ietf-tls-session-hash).
4934817466cbSJens Wiklander   * Add support for Encrypt-then-MAC (RFC 7366).
4935817466cbSJens Wiklander   * Add function pk_check_pair() to test if public and private keys match.
4936817466cbSJens Wiklander   * Add x509_crl_parse_der().
4937817466cbSJens Wiklander   * Add compile-time option POLARSSL_X509_MAX_INTERMEDIATE_CA to limit the
4938817466cbSJens Wiklander     length of an X.509 verification chain.
4939817466cbSJens Wiklander   * Support for renegotiation can now be disabled at compile-time
4940817466cbSJens Wiklander   * Support for 1/n-1 record splitting, a countermeasure against BEAST.
4941817466cbSJens Wiklander   * Certificate selection based on signature hash, preferring SHA-1 over SHA-2
4942817466cbSJens Wiklander     for pre-1.2 clients when multiple certificates are available.
4943817466cbSJens Wiklander   * Add support for getrandom() syscall on recent Linux kernels with Glibc or
4944817466cbSJens Wiklander     a compatible enough libc (eg uClibc).
4945817466cbSJens Wiklander   * Add ssl_set_arc4_support() to make it easier to disable RC4 at runtime
4946817466cbSJens Wiklander     while using the default ciphersuite list.
4947817466cbSJens Wiklander   * Added new error codes and debug messages about selection of
4948817466cbSJens Wiklander     ciphersuite/certificate.
4949817466cbSJens Wiklander
4950817466cbSJens WiklanderBugfix
4951817466cbSJens Wiklander   * Stack buffer overflow if ctr_drbg_update() is called with too large
4952817466cbSJens Wiklander     add_len (found by Jean-Philippe Aumasson) (not triggerable remotely).
4953817466cbSJens Wiklander   * Possible buffer overflow of length at most POLARSSL_MEMORY_ALIGN_MULTIPLE
4954817466cbSJens Wiklander     if memory_buffer_alloc_init() was called with buf not aligned and len not
4955817466cbSJens Wiklander     a multiple of POLARSSL_MEMORY_ALIGN_MULTIPLE (not triggerable remotely).
4956817466cbSJens Wiklander   * User set CFLAGS were ignored by Cmake with gcc (introduced in 1.3.9, found
4957817466cbSJens Wiklander     by Julian Ospald).
4958817466cbSJens Wiklander   * Fix potential undefined behaviour in Camellia.
4959817466cbSJens Wiklander   * Fix potential failure in ECDSA signatures when POLARSSL_ECP_MAX_BITS is a
4960817466cbSJens Wiklander     multiple of 8 (found by Gergely Budai).
4961817466cbSJens Wiklander   * Fix unchecked return code in x509_crt_parse_path() on Windows (found by
4962817466cbSJens Wiklander     Peter Vaskovic).
4963817466cbSJens Wiklander   * Fix assembly selection for MIPS64 (thanks to James Cowgill).
4964817466cbSJens Wiklander   * ssl_get_verify_result() now works even if the handshake was aborted due
4965817466cbSJens Wiklander     to a failed verification (found by Fredrik Axelsson).
4966817466cbSJens Wiklander   * Skip writing and parsing signature_algorithm extension if none of the
4967817466cbSJens Wiklander     key exchanges enabled needs certificates. This fixes a possible interop
4968817466cbSJens Wiklander     issue with some servers when a zero-length extension was sent. (Reported
4969817466cbSJens Wiklander     by Peter Dettman.)
4970817466cbSJens Wiklander   * On a 0-length input, base64_encode() did not correctly set output length
4971817466cbSJens Wiklander     (found by Hendrik van den Boogaard).
4972817466cbSJens Wiklander
4973817466cbSJens WiklanderChanges
4974817466cbSJens Wiklander   * Use deterministic nonces for AEAD ciphers in TLS by default (possible to
4975817466cbSJens Wiklander     switch back to random with POLARSSL_SSL_AEAD_RANDOM_IV in config.h).
4976817466cbSJens Wiklander   * Blind RSA private operations even when POLARSSL_RSA_NO_CRT is defined.
4977817466cbSJens Wiklander   * ssl_set_own_cert() now returns an error on key-certificate mismatch.
4978817466cbSJens Wiklander   * Forbid repeated extensions in X.509 certificates.
4979817466cbSJens Wiklander   * debug_print_buf() now prints a text view in addition to hexadecimal.
4980817466cbSJens Wiklander   * A specific error is now returned when there are ciphersuites in common
4981817466cbSJens Wiklander     but none of them is usable due to external factors such as no certificate
4982817466cbSJens Wiklander     with a suitable (extended)KeyUsage or curve or no PSK set.
4983817466cbSJens Wiklander   * It is now possible to disable negotiation of truncated HMAC server-side
4984817466cbSJens Wiklander     at runtime with ssl_set_truncated_hmac().
4985817466cbSJens Wiklander   * Example programs for SSL client and server now disable SSLv3 by default.
4986817466cbSJens Wiklander   * Example programs for SSL client and server now disable RC4 by default.
4987817466cbSJens Wiklander   * Use platform.h in all test suites and programs.
4988817466cbSJens Wiklander
4989817466cbSJens Wiklander= PolarSSL 1.3.9 released 2014-10-20
4990817466cbSJens WiklanderSecurity
4991817466cbSJens Wiklander   * Lowest common hash was selected from signature_algorithms extension in
4992817466cbSJens Wiklander     TLS 1.2 (found by Darren Bane) (introduced in 1.3.8).
4993817466cbSJens Wiklander   * Remotely-triggerable memory leak when parsing some X.509 certificates
4994817466cbSJens Wiklander     (server is not affected if it doesn't ask for a client certificate)
4995817466cbSJens Wiklander     (found using Codenomicon Defensics).
4996817466cbSJens Wiklander   * Remotely-triggerable memory leak when parsing crafted ClientHello
4997817466cbSJens Wiklander     (not affected if ECC support was compiled out) (found using Codenomicon
4998817466cbSJens Wiklander     Defensics).
4999817466cbSJens Wiklander
5000817466cbSJens WiklanderBugfix
5001817466cbSJens Wiklander   * Support escaping of commas in x509_string_to_names()
5002817466cbSJens Wiklander   * Fix compile error in ssl_pthread_server (found by Julian Ospald).
5003817466cbSJens Wiklander   * Fix net_accept() regarding non-blocking sockets (found by Luca Pesce).
5004817466cbSJens Wiklander   * Don't print uninitialised buffer in ssl_mail_client (found by Marc Abel).
5005817466cbSJens Wiklander   * Fix warnings from Clang's scan-build (contributed by Alfred Klomp).
5006817466cbSJens Wiklander   * Fix compile error in timing.c when POLARSSL_NET_C and POLARSSL_SELFTEST
5007817466cbSJens Wiklander     are defined but not POLARSSL_HAVE_TIME (found by Stephane Di Vito).
5008817466cbSJens Wiklander   * Remove non-existent file from VS projects (found by Peter Vaskovic).
5009817466cbSJens Wiklander   * ssl_read() could return non-application data records on server while
5010817466cbSJens Wiklander     renegotation was pending, and on client when a HelloRequest was received.
5011817466cbSJens Wiklander   * Server-initiated renegotiation would fail with non-blocking I/O if the
5012817466cbSJens Wiklander     write callback returned WANT_WRITE when requesting renegotiation.
5013817466cbSJens Wiklander   * ssl_close_notify() could send more than one message in some circumstances
5014817466cbSJens Wiklander     with non-blocking I/O.
5015817466cbSJens Wiklander   * Fix compiler warnings on iOS (found by Sander Niemeijer).
5016817466cbSJens Wiklander   * x509_crt_parse() did not increase total_failed on PEM error
5017817466cbSJens Wiklander   * Fix compile error with armcc in mpi_is_prime()
5018817466cbSJens Wiklander   * Fix potential bad read in parsing ServerHello (found by Adrien
5019817466cbSJens Wiklander     Vialletelle).
5020817466cbSJens Wiklander
5021817466cbSJens WiklanderChanges
5022817466cbSJens Wiklander   * Ciphersuites using SHA-256 or SHA-384 now require TLS 1.x (there is no
5023817466cbSJens Wiklander     standard defining how to use SHA-2 with SSL 3.0).
5024817466cbSJens Wiklander   * Ciphersuites using RSA-PSK key exchange new require TLS 1.x (the spec is
5025817466cbSJens Wiklander     ambiguous on how to encode some packets with SSL 3.0).
5026817466cbSJens Wiklander   * Made buffer size in pk_write_(pub)key_pem() more dynamic, eg smaller if
5027817466cbSJens Wiklander     RSA is disabled, larger if POLARSSL_MPI_MAX_SIZE is larger.
5028817466cbSJens Wiklander   * ssl_read() now returns POLARSSL_ERR_NET_WANT_READ rather than
5029817466cbSJens Wiklander     POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE on harmless alerts.
5030817466cbSJens Wiklander   * POLARSSL_MPI_MAX_SIZE now defaults to 1024 in order to allow 8192 bits
5031817466cbSJens Wiklander     RSA keys.
5032817466cbSJens Wiklander   * Accept spaces at end of line or end of buffer in base64_decode().
5033817466cbSJens Wiklander   * X.509 certificates with more than one AttributeTypeAndValue per
5034817466cbSJens Wiklander     RelativeDistinguishedName are not accepted any more.
5035817466cbSJens Wiklander
5036817466cbSJens Wiklander= PolarSSL 1.3.8 released 2014-07-11
5037817466cbSJens WiklanderSecurity
5038817466cbSJens Wiklander   * Fix length checking for AEAD ciphersuites (found by Codenomicon).
5039817466cbSJens Wiklander     It was possible to crash the server (and client) using crafted messages
5040817466cbSJens Wiklander     when a GCM suite was chosen.
5041817466cbSJens Wiklander
5042817466cbSJens WiklanderFeatures
5043817466cbSJens Wiklander   * Add CCM module and cipher mode to Cipher Layer
5044817466cbSJens Wiklander   * Support for CCM and CCM_8 ciphersuites
5045817466cbSJens Wiklander   * Support for parsing and verifying RSASSA-PSS signatures in the X.509
5046817466cbSJens Wiklander     modules (certificates, CRLs and CSRs).
5047817466cbSJens Wiklander   * Blowfish in the cipher layer now supports variable length keys.
5048817466cbSJens Wiklander   * Add example config.h for PSK with CCM, optimized for low RAM usage.
5049817466cbSJens Wiklander   * Optimize for RAM usage in example config.h for NSA Suite B profile.
5050817466cbSJens Wiklander   * Add POLARSSL_REMOVE_ARC4_CIPHERSUITES to allow removing RC4 ciphersuites
5051817466cbSJens Wiklander     from the default list (inactive by default).
5052817466cbSJens Wiklander   * Add server-side enforcement of sent renegotiation requests
5053817466cbSJens Wiklander     (ssl_set_renegotiation_enforced())
5054817466cbSJens Wiklander   * Add SSL_CIPHERSUITES config.h flag to allow specifying a list of
5055817466cbSJens Wiklander     ciphersuites to use and save some memory if the list is small.
5056817466cbSJens Wiklander
5057817466cbSJens WiklanderChanges
5058817466cbSJens Wiklander   * Add LINK_WITH_PTHREAD option in CMake for explicit linking that is
5059817466cbSJens Wiklander     required on some platforms (e.g. OpenBSD)
5060817466cbSJens Wiklander   * Migrate zeroizing of data to polarssl_zeroize() instead of memset()
5061817466cbSJens Wiklander     against unwanted compiler optimizations
5062817466cbSJens Wiklander   * md_list() now returns hashes strongest first
5063817466cbSJens Wiklander   * Selection of hash for signing ServerKeyExchange in TLS 1.2 now picks
5064817466cbSJens Wiklander     strongest offered by client.
5065817466cbSJens Wiklander   * All public contexts have _init() and _free() functions now for simpler
5066817466cbSJens Wiklander     usage pattern
5067817466cbSJens Wiklander
5068817466cbSJens WiklanderBugfix
5069817466cbSJens Wiklander   * Fix in debug_print_msg()
5070817466cbSJens Wiklander   * Enforce alignment in the buffer allocator even if buffer is not aligned
5071817466cbSJens Wiklander   * Remove less-than-zero checks on unsigned numbers
5072817466cbSJens Wiklander   * Stricter check on SSL ClientHello internal sizes compared to actual packet
5073817466cbSJens Wiklander     size (found by TrustInSoft)
5074817466cbSJens Wiklander   * Fix WSAStartup() return value check (found by Peter Vaskovic)
5075817466cbSJens Wiklander   * Other minor issues (found by Peter Vaskovic)
5076817466cbSJens Wiklander   * Fix symlink command for cross compiling with CMake (found by Andre
5077817466cbSJens Wiklander     Heinecke)
5078817466cbSJens Wiklander   * Fix DER output of gen_key app (found by Gergely Budai)
5079817466cbSJens Wiklander   * Very small records were incorrectly rejected when truncated HMAC was in
5080817466cbSJens Wiklander     use with some ciphersuites and versions (RC4 in all versions, CBC with
5081817466cbSJens Wiklander     versions < TLS 1.1).
5082817466cbSJens Wiklander   * Very large records using more than 224 bytes of padding were incorrectly
5083817466cbSJens Wiklander     rejected with CBC-based ciphersuites and TLS >= 1.1
5084817466cbSJens Wiklander   * Very large records using less padding could cause a buffer overread of up
5085817466cbSJens Wiklander     to 32 bytes with CBC-based ciphersuites and TLS >= 1.1
5086817466cbSJens Wiklander   * Restore ability to use a v1 cert as a CA if trusted locally. (This had
5087817466cbSJens Wiklander     been removed in 1.3.6.)
5088817466cbSJens Wiklander   * Restore ability to locally trust a self-signed cert that is not a proper
5089817466cbSJens Wiklander     CA for use as an end entity certificate. (This had been removed in
5090817466cbSJens Wiklander     1.3.6.)
5091817466cbSJens Wiklander   * Fix preprocessor checks for bn_mul PPC asm (found by Barry K. Nathan).
5092817466cbSJens Wiklander   * Use \n\t rather than semicolons for bn_mul asm, since some assemblers
5093817466cbSJens Wiklander     interpret semicolons as comment delimiters (found by Barry K. Nathan).
5094817466cbSJens Wiklander   * Fix off-by-one error in parsing Supported Point Format extension that
5095817466cbSJens Wiklander     caused some handshakes to fail.
5096817466cbSJens Wiklander   * Fix possible miscomputation of the premaster secret with DHE-PSK key
5097817466cbSJens Wiklander     exchange that caused some handshakes to fail with other implementations.
5098817466cbSJens Wiklander     (Failure rate <= 1/255 with common DHM moduli.)
5099817466cbSJens Wiklander   * Disable broken Sparc64 bn_mul assembly (found by Florian Obser).
5100817466cbSJens Wiklander   * Fix base64_decode() to return and check length correctly (in case of
5101817466cbSJens Wiklander     tight buffers)
5102817466cbSJens Wiklander   * Fix mpi_write_string() to write "00" as hex output for empty MPI (found
5103817466cbSJens Wiklander     by Hui Dong)
5104817466cbSJens Wiklander
5105817466cbSJens Wiklander= PolarSSL 1.3.7 released on 2014-05-02
5106817466cbSJens WiklanderFeatures
5107817466cbSJens Wiklander   * debug_set_log_mode() added to determine raw or full logging
5108817466cbSJens Wiklander   * debug_set_threshold() added to ignore messages over threshold level
5109817466cbSJens Wiklander   * version_check_feature() added to check for compile-time options at
5110817466cbSJens Wiklander     run-time
5111817466cbSJens Wiklander
5112817466cbSJens WiklanderChanges
5113817466cbSJens Wiklander   * POLARSSL_CONFIG_OPTIONS has been removed. All values are individually
5114817466cbSJens Wiklander     checked and filled in the relevant module headers
5115817466cbSJens Wiklander   * Debug module only outputs full lines instead of parts
5116817466cbSJens Wiklander   * Better support for the different Attribute Types from IETF PKIX (RFC 5280)
5117817466cbSJens Wiklander   * AES-NI now compiles with "old" assemblers too
5118817466cbSJens Wiklander   * Ciphersuites based on RC4 now have the lowest priority by default
5119817466cbSJens Wiklander
5120817466cbSJens WiklanderBugfix
5121817466cbSJens Wiklander   * Only iterate over actual certificates in ssl_write_certificate_request()
5122817466cbSJens Wiklander     (found by Matthew Page)
5123817466cbSJens Wiklander   * Typos in platform.c and pkcs11.c (found by Daniel Phillips and Steffan
5124817466cbSJens Wiklander     Karger)
5125817466cbSJens Wiklander   * cert_write app should use subject of issuer certificate as issuer of cert
5126817466cbSJens Wiklander   * Fix false reject in padding check in ssl_decrypt_buf() for CBC
5127817466cbSJens Wiklander     ciphersuites, for full SSL frames of data.
5128817466cbSJens Wiklander   * Improve interoperability by not writing extension length in ClientHello /
5129817466cbSJens Wiklander     ServerHello when no extensions are present (found by Matthew Page)
5130817466cbSJens Wiklander   * rsa_check_pubkey() now allows an E up to N
5131817466cbSJens Wiklander   * On OpenBSD, use arc4random_buf() instead of rand() to prevent warnings
5132817466cbSJens Wiklander   * mpi_fill_random() was creating numbers larger than requested on
5133817466cbSJens Wiklander     big-endian platform when size was not an integer number of limbs
5134817466cbSJens Wiklander   * Fix dependencies issues in X.509 test suite.
5135817466cbSJens Wiklander   * Some parts of ssl_tls.c were compiled even when the module was disabled.
5136817466cbSJens Wiklander   * Fix detection of DragonflyBSD in net.c (found by Markus Pfeiffer)
5137817466cbSJens Wiklander   * Fix detection of Clang on some Apple platforms with CMake
5138817466cbSJens Wiklander     (found by Barry K. Nathan)
5139817466cbSJens Wiklander
5140817466cbSJens Wiklander= PolarSSL 1.3.6 released on 2014-04-11
5141817466cbSJens Wiklander
5142817466cbSJens WiklanderFeatures
5143817466cbSJens Wiklander   * Support for the ALPN SSL extension
5144817466cbSJens Wiklander   * Add option 'use_dev_random' to gen_key application
5145817466cbSJens Wiklander   * Enable verification of the keyUsage extension for CA and leaf
5146817466cbSJens Wiklander     certificates (POLARSSL_X509_CHECK_KEY_USAGE)
5147817466cbSJens Wiklander   * Enable verification of the extendedKeyUsage extension
5148817466cbSJens Wiklander     (POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE)
5149817466cbSJens Wiklander
5150817466cbSJens WiklanderChanges
5151817466cbSJens Wiklander   * x509_crt_info() now prints information about parsed extensions as well
5152817466cbSJens Wiklander   * pk_verify() now returns a specific error code when the signature is valid
5153817466cbSJens Wiklander     but shorter than the supplied length.
5154817466cbSJens Wiklander   * Use UTC time to check certificate validity.
5155817466cbSJens Wiklander   * Reject certificates with times not in UTC, per RFC 5280.
5156817466cbSJens Wiklander
5157817466cbSJens WiklanderSecurity
5158817466cbSJens Wiklander   * Avoid potential timing leak in ecdsa_sign() by blinding modular division.
5159817466cbSJens Wiklander     (Found by Watson Ladd.)
5160817466cbSJens Wiklander   * The notAfter date of some certificates was no longer checked since 1.3.5.
5161817466cbSJens Wiklander     This affects certificates in the user-supplied chain except the top
5162817466cbSJens Wiklander     certificate. If the user-supplied chain contains only one certificates,
5163817466cbSJens Wiklander     it is not affected (ie, its notAfter date is properly checked).
5164817466cbSJens Wiklander   * Prevent potential NULL pointer dereference in ssl_read_record() (found by
5165817466cbSJens Wiklander     TrustInSoft)
5166817466cbSJens Wiklander
5167817466cbSJens WiklanderBugfix
5168817466cbSJens Wiklander   * The length of various ClientKeyExchange messages was not properly checked.
5169817466cbSJens Wiklander   * Some example server programs were not sending the close_notify alert.
5170817466cbSJens Wiklander   * Potential memory leak in mpi_exp_mod() when error occurs during
5171817466cbSJens Wiklander     calculation of RR.
5172817466cbSJens Wiklander   * Fixed malloc/free default #define in platform.c (found by Gergely Budai).
5173817466cbSJens Wiklander   * Fixed type which made POLARSSL_ENTROPY_FORCE_SHA256 uneffective (found by
5174817466cbSJens Wiklander     Gergely Budai).
5175817466cbSJens Wiklander   * Fix #include path in ecdsa.h which wasn't accepted by some compilers.
5176817466cbSJens Wiklander     (found by Gergely Budai)
5177817466cbSJens Wiklander   * Fix compile errors when POLARSSL_ERROR_STRERROR_BC is undefined (found by
5178817466cbSJens Wiklander     Shuo Chen).
5179817466cbSJens Wiklander   * oid_get_numeric_string() used to truncate the output without returning an
5180817466cbSJens Wiklander     error if the output buffer was just 1 byte too small.
5181817466cbSJens Wiklander   * dhm_parse_dhm() (hence dhm_parse_dhmfile()) did not set dhm->len.
5182817466cbSJens Wiklander   * Calling pk_debug() on an RSA-alt key would segfault.
5183817466cbSJens Wiklander   * pk_get_size() and pk_get_len() were off by a factor 8 for RSA-alt keys.
5184817466cbSJens Wiklander   * Potential buffer overwrite in pem_write_buffer() because of low length
5185817466cbSJens Wiklander     indication (found by Thijs Alkemade)
5186817466cbSJens Wiklander   * EC curves constants, which should be only in ROM since 1.3.3, were also
5187817466cbSJens Wiklander     stored in RAM due to missing 'const's (found by Gergely Budai).
5188817466cbSJens Wiklander
5189817466cbSJens Wiklander= PolarSSL 1.3.5 released on 2014-03-26
5190817466cbSJens WiklanderFeatures
5191817466cbSJens Wiklander   * HMAC-DRBG as a separate module
5192817466cbSJens Wiklander   * Option to set the Curve preference order (disabled by default)
5193817466cbSJens Wiklander   * Single Platform compatilibity layer (for memory / printf / fprintf)
5194817466cbSJens Wiklander   * Ability to provide alternate timing implementation
5195817466cbSJens Wiklander   * Ability to force the entropy module to use SHA-256 as its basis
5196817466cbSJens Wiklander     (POLARSSL_ENTROPY_FORCE_SHA256)
5197817466cbSJens Wiklander   * Testing script ssl-opt.sh added for testing 'live' ssl option
5198817466cbSJens Wiklander     interoperability against OpenSSL and PolarSSL
5199817466cbSJens Wiklander   * Support for reading EC keys that use SpecifiedECDomain in some cases.
5200817466cbSJens Wiklander   * Entropy module now supports seed writing and reading
5201817466cbSJens Wiklander
5202817466cbSJens WiklanderChanges
5203817466cbSJens Wiklander   * Deprecated the Memory layer
5204817466cbSJens Wiklander   * entropy_add_source(), entropy_update_manual() and entropy_gather()
5205817466cbSJens Wiklander     now thread-safe if POLARSSL_THREADING_C defined
5206817466cbSJens Wiklander   * Improvements to the CMake build system, contributed by Julian Ospald.
5207817466cbSJens Wiklander   * Work around a bug of the version of Clang shipped by Apple with Mavericks
5208817466cbSJens Wiklander     that prevented bignum.c from compiling. (Reported by Rafael Baptista.)
5209817466cbSJens Wiklander   * Revamped the compat.sh interoperatibility script to include support for
5210817466cbSJens Wiklander     testing against GnuTLS
5211817466cbSJens Wiklander   * Deprecated ssl_set_own_cert_rsa() and ssl_set_own_cert_rsa_alt()
5212817466cbSJens Wiklander   * Improvements to tests/Makefile, contributed by Oden Eriksson.
5213817466cbSJens Wiklander
5214817466cbSJens WiklanderSecurity
5215817466cbSJens Wiklander   * Forbid change of server certificate during renegotiation to prevent
5216817466cbSJens Wiklander     "triple handshake" attack when authentication mode is 'optional' (the
5217817466cbSJens Wiklander     attack was already impossible when authentication is required).
5218817466cbSJens Wiklander   * Check notBefore timestamp of certificates and CRLs from the future.
5219817466cbSJens Wiklander   * Forbid sequence number wrapping
5220817466cbSJens Wiklander   * Fixed possible buffer overflow with overlong PSK
5221817466cbSJens Wiklander   * Possible remotely-triggered out-of-bounds memory access fixed (found by
5222817466cbSJens Wiklander     TrustInSoft)
5223817466cbSJens Wiklander
5224817466cbSJens WiklanderBugfix
5225817466cbSJens Wiklander   * ecp_gen_keypair() does more tries to prevent failure because of
5226817466cbSJens Wiklander     statistics
5227817466cbSJens Wiklander   * Fixed bug in RSA PKCS#1 v1.5 "reversed" operations
5228817466cbSJens Wiklander   * Fixed testing with out-of-source builds using cmake
5229817466cbSJens Wiklander   * Fixed version-major intolerance in server
5230817466cbSJens Wiklander   * Fixed CMake symlinking on out-of-source builds
5231817466cbSJens Wiklander   * Fixed dependency issues in test suite
5232817466cbSJens Wiklander   * Programs rsa_sign_pss and rsa_verify_pss were not using PSS since 1.3.0
5233817466cbSJens Wiklander   * Bignum's MIPS-32 assembly was used on MIPS-64, causing chaos. (Found by
5234817466cbSJens Wiklander     Alex Wilson.)
5235817466cbSJens Wiklander   * ssl_cache was creating entries when max_entries=0 if TIMING_C was enabled.
5236817466cbSJens Wiklander   * m_sleep() was sleeping twice too long on most Unix platforms.
5237817466cbSJens Wiklander   * Fixed bug with session tickets and non-blocking I/O in the unlikely case
5238817466cbSJens Wiklander     send() would return an EAGAIN error when sending the ticket.
5239817466cbSJens Wiklander   * ssl_cache was leaking memory when reusing a timed out entry containing a
5240817466cbSJens Wiklander     client certificate.
5241817466cbSJens Wiklander   * ssl_srv was leaking memory when client presented a timed out ticket
5242817466cbSJens Wiklander     containing a client certificate
5243817466cbSJens Wiklander   * ssl_init() was leaving a dirty pointer in ssl_context if malloc of
5244817466cbSJens Wiklander     out_ctr failed
5245817466cbSJens Wiklander   * ssl_handshake_init() was leaving dirty pointers in subcontexts if malloc
5246817466cbSJens Wiklander     of one of them failed
5247817466cbSJens Wiklander   * Fix typo in rsa_copy() that impacted PKCS#1 v2 contexts
5248817466cbSJens Wiklander   * x509_get_current_time() uses localtime_r() to prevent thread issues
5249817466cbSJens Wiklander
5250817466cbSJens Wiklander= PolarSSL 1.3.4 released on 2014-01-27
5251817466cbSJens WiklanderFeatures
5252817466cbSJens Wiklander   * Support for the Koblitz curves: secp192k1, secp224k1, secp256k1
5253817466cbSJens Wiklander   * Support for RIPEMD-160
5254817466cbSJens Wiklander   * Support for AES CFB8 mode
5255817466cbSJens Wiklander   * Support for deterministic ECDSA (RFC 6979)
5256817466cbSJens Wiklander
5257817466cbSJens WiklanderBugfix
5258817466cbSJens Wiklander   * Potential memory leak in bignum_selftest()
5259817466cbSJens Wiklander   * Replaced expired test certificate
5260817466cbSJens Wiklander   * ssl_mail_client now terminates lines with CRLF, instead of LF
5261817466cbSJens Wiklander   * net module handles timeouts on blocking sockets better (found by Tilman
5262817466cbSJens Wiklander     Sauerbeck)
5263817466cbSJens Wiklander   * Assembly format fixes in bn_mul.h
5264817466cbSJens Wiklander
5265817466cbSJens WiklanderSecurity
5266817466cbSJens Wiklander   * Missing MPI_CHK calls added around unguarded mpi calls (found by
5267817466cbSJens Wiklander     TrustInSoft)
5268817466cbSJens Wiklander
5269817466cbSJens Wiklander= PolarSSL 1.3.3 released on 2013-12-31
5270817466cbSJens WiklanderFeatures
5271817466cbSJens Wiklander   * EC key generation support in gen_key app
5272817466cbSJens Wiklander   * Support for adhering to client ciphersuite order preference
5273817466cbSJens Wiklander     (POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE)
5274817466cbSJens Wiklander   * Support for Curve25519
5275817466cbSJens Wiklander   * Support for ECDH-RSA and ECDH-ECDSA key exchanges and ciphersuites
5276817466cbSJens Wiklander   * Support for IPv6 in the NET module
5277817466cbSJens Wiklander   * AES-NI support for AES, AES-GCM and AES key scheduling
5278817466cbSJens Wiklander   * SSL Pthread-based server example added (ssl_pthread_server)
5279817466cbSJens Wiklander
5280817466cbSJens WiklanderChanges
5281817466cbSJens Wiklander   * gen_prime() speedup
5282817466cbSJens Wiklander   * Speedup of ECP multiplication operation
5283817466cbSJens Wiklander   * Relaxed some SHA2 ciphersuite's version requirements
5284817466cbSJens Wiklander   * Dropped use of readdir_r() instead of readdir() with threading support
5285817466cbSJens Wiklander   * More constant-time checks in the RSA module
5286817466cbSJens Wiklander   * Split off curves from ecp.c into ecp_curves.c
5287817466cbSJens Wiklander   * Curves are now stored fully in ROM
5288817466cbSJens Wiklander   * Memory usage optimizations in ECP module
5289817466cbSJens Wiklander   * Removed POLARSSL_THREADING_DUMMY
5290817466cbSJens Wiklander
5291817466cbSJens WiklanderBugfix
5292817466cbSJens Wiklander   * Fixed bug in mpi_set_bit() on platforms where t_uint is wider than int
5293817466cbSJens Wiklander   * Fixed X.509 hostname comparison (with non-regular characters)
5294817466cbSJens Wiklander   * SSL now gracefully handles missing RNG
5295817466cbSJens Wiklander   * Missing defines / cases for RSA_PSK key exchange
5296817466cbSJens Wiklander   * crypt_and_hash app checks MAC before final decryption
5297817466cbSJens Wiklander   * Potential memory leak in ssl_ticket_keys_init()
5298817466cbSJens Wiklander   * Memory leak in benchmark application
5299817466cbSJens Wiklander   * Fixed x509_crt_parse_path() bug on Windows platforms
5300817466cbSJens Wiklander   * Added missing MPI_CHK() around some statements in mpi_div_mpi() (found by
5301817466cbSJens Wiklander     TrustInSoft)
5302817466cbSJens Wiklander   * Fixed potential overflow in certificate size verification in
5303817466cbSJens Wiklander     ssl_write_certificate() (found by TrustInSoft)
5304817466cbSJens Wiklander
5305817466cbSJens WiklanderSecurity
5306817466cbSJens Wiklander   * Possible remotely-triggered out-of-bounds memory access fixed (found by
5307817466cbSJens Wiklander     TrustInSoft)
5308817466cbSJens Wiklander
5309817466cbSJens Wiklander= PolarSSL 1.3.2 released on 2013-11-04
5310817466cbSJens WiklanderFeatures
5311817466cbSJens Wiklander   * PK tests added to test framework
5312817466cbSJens Wiklander   * Added optional optimization for NIST MODP curves (POLARSSL_ECP_NIST_OPTIM)
5313817466cbSJens Wiklander   * Support for Camellia-GCM mode and ciphersuites
5314817466cbSJens Wiklander
5315817466cbSJens WiklanderChanges
5316817466cbSJens Wiklander   * Padding checks in cipher layer are now constant-time
5317817466cbSJens Wiklander   * Value comparisons in SSL layer are now constant-time
5318817466cbSJens Wiklander   * Support for serialNumber, postalAddress and postalCode in X509 names
5319817466cbSJens Wiklander   * SSL Renegotiation was refactored
5320817466cbSJens Wiklander
5321817466cbSJens WiklanderBugfix
5322817466cbSJens Wiklander   * More stringent checks in cipher layer
5323817466cbSJens Wiklander   * Server does not send out extensions not advertised by client
5324817466cbSJens Wiklander   * Prevent possible alignment warnings on casting from char * to 'aligned *'
5325817466cbSJens Wiklander   * Misc fixes and additions to dependency checks
5326817466cbSJens Wiklander   * Const correctness
5327817466cbSJens Wiklander   * cert_write with selfsign should use issuer_name as subject_name
5328817466cbSJens Wiklander   * Fix ECDSA corner case: missing reduction mod N (found by DualTachyon)
5329817466cbSJens Wiklander   * Defines to handle UEFI environment under MSVC
5330817466cbSJens Wiklander   * Server-side initiated renegotiations send HelloRequest
5331817466cbSJens Wiklander
5332817466cbSJens Wiklander= PolarSSL 1.3.1 released on 2013-10-15
5333817466cbSJens WiklanderFeatures
5334817466cbSJens Wiklander   * Support for Brainpool curves and TLS ciphersuites (RFC 7027)
5335817466cbSJens Wiklander   * Support for ECDHE-PSK key-exchange and ciphersuites
5336817466cbSJens Wiklander   * Support for RSA-PSK key-exchange and ciphersuites
5337817466cbSJens Wiklander
5338817466cbSJens WiklanderChanges
5339817466cbSJens Wiklander   * RSA blinding locks for a smaller amount of time
5340817466cbSJens Wiklander   * TLS compression only allocates working buffer once
5341817466cbSJens Wiklander   * Introduced POLARSSL_HAVE_READDIR_R for systems without it
5342817466cbSJens Wiklander   * config.h is more script-friendly
5343817466cbSJens Wiklander
5344817466cbSJens WiklanderBugfix
5345817466cbSJens Wiklander   * Missing MSVC defines added
5346817466cbSJens Wiklander   * Compile errors with POLARSSL_RSA_NO_CRT
5347817466cbSJens Wiklander   * Header files with 'polarssl/'
5348817466cbSJens Wiklander   * Const correctness
5349817466cbSJens Wiklander   * Possible naming collision in dhm_context
5350817466cbSJens Wiklander   * Better support for MSVC
5351817466cbSJens Wiklander   * threading_set_alt() name
5352817466cbSJens Wiklander   * Added missing x509write_crt_set_version()
5353817466cbSJens Wiklander
5354817466cbSJens Wiklander= PolarSSL 1.3.0 released on 2013-10-01
5355817466cbSJens WiklanderFeatures
5356817466cbSJens Wiklander   * Elliptic Curve Cryptography module added
5357817466cbSJens Wiklander   * Elliptic Curve Diffie Hellman module added
5358817466cbSJens Wiklander   * Ephemeral Elliptic Curve Diffie Hellman support for SSL/TLS
5359817466cbSJens Wiklander    (ECDHE-based ciphersuites)
5360817466cbSJens Wiklander   * Ephemeral Elliptic Curve Digital Signature Algorithm support for SSL/TLS
5361817466cbSJens Wiklander    (ECDSA-based ciphersuites)
5362817466cbSJens Wiklander   * Ability to specify allowed ciphersuites based on the protocol version.
5363817466cbSJens Wiklander   * PSK and DHE-PSK based ciphersuites added
5364817466cbSJens Wiklander   * Memory allocation abstraction layer added
5365817466cbSJens Wiklander   * Buffer-based memory allocator added (no malloc() / free() / HEAP usage)
5366817466cbSJens Wiklander   * Threading abstraction layer added (dummy / pthread / alternate)
5367817466cbSJens Wiklander   * Public Key abstraction layer added
5368817466cbSJens Wiklander   * Parsing Elliptic Curve keys
5369817466cbSJens Wiklander   * Parsing Elliptic Curve certificates
5370817466cbSJens Wiklander   * Support for max_fragment_length extension (RFC 6066)
5371817466cbSJens Wiklander   * Support for truncated_hmac extension (RFC 6066)
5372817466cbSJens Wiklander   * Support for zeros-and-length (ANSI X.923) padding, one-and-zeros
5373817466cbSJens Wiklander     (ISO/IEC 7816-4) padding and zero padding in the cipher layer
5374817466cbSJens Wiklander   * Support for session tickets (RFC 5077)
5375817466cbSJens Wiklander   * Certificate Request (CSR) generation with extensions (key_usage,
5376817466cbSJens Wiklander     ns_cert_type)
5377817466cbSJens Wiklander   * X509 Certificate writing with extensions (basic_constraints,
5378817466cbSJens Wiklander     issuer_key_identifier, etc)
5379817466cbSJens Wiklander   * Optional blinding for RSA, DHM and EC
5380817466cbSJens Wiklander   * Support for multiple active certificate / key pairs in SSL servers for
5381817466cbSJens Wiklander     the same host (Not to be confused with SNI!)
5382817466cbSJens Wiklander
5383817466cbSJens WiklanderChanges
5384817466cbSJens Wiklander   * Ability to enable / disable SSL v3 / TLS 1.0 / TLS 1.1 / TLS 1.2
5385817466cbSJens Wiklander     individually
5386817466cbSJens Wiklander   * Introduced separate SSL Ciphersuites module that is based on
5387817466cbSJens Wiklander     Cipher and MD information
5388817466cbSJens Wiklander   * Internals for SSL module adapted to have separate IV pointer that is
5389817466cbSJens Wiklander     dynamically set (Better support for hardware acceleration)
5390817466cbSJens Wiklander   * Moved all OID functionality to a separate module. RSA function
5391817466cbSJens Wiklander     prototypes for the RSA sign and verify functions changed as a result
5392817466cbSJens Wiklander   * Split up the GCM module into a starts/update/finish cycle
5393817466cbSJens Wiklander   * Client and server now filter sent and accepted ciphersuites on minimum
5394817466cbSJens Wiklander     and maximum protocol version
5395817466cbSJens Wiklander   * Ability to disable server_name extension (RFC 6066)
5396817466cbSJens Wiklander   * Renamed error_strerror() to the less conflicting polarssl_strerror()
5397817466cbSJens Wiklander     (Ability to keep old as well with POLARSSL_ERROR_STRERROR_BC)
5398817466cbSJens Wiklander   * SHA2 renamed to SHA256, SHA4 renamed to SHA512 and functions accordingly
5399817466cbSJens Wiklander   * All RSA operations require a random generator for blinding purposes
5400817466cbSJens Wiklander   * X509 core refactored
5401817466cbSJens Wiklander   * x509_crt_verify() now case insensitive for cn (RFC 6125 6.4)
5402817466cbSJens Wiklander   * Also compiles / runs without time-based functions (!POLARSSL_HAVE_TIME)
5403817466cbSJens Wiklander   * Support faulty X509 v1 certificates with extensions
5404817466cbSJens Wiklander     (POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
5405817466cbSJens Wiklander
5406817466cbSJens WiklanderBugfix
5407817466cbSJens Wiklander   * Fixed parse error in ssl_parse_certificate_request()
5408817466cbSJens Wiklander   * zlib compression/decompression skipped on empty blocks
5409817466cbSJens Wiklander   * Support for AIX header locations in net.c module
5410817466cbSJens Wiklander   * Fixed file descriptor leaks
5411817466cbSJens Wiklander
5412817466cbSJens WiklanderSecurity
5413817466cbSJens Wiklander   * RSA blinding on CRT operations to counter timing attacks
5414817466cbSJens Wiklander     (found by Cyril Arnaud and Pierre-Alain Fouque)
5415817466cbSJens Wiklander
5416817466cbSJens Wiklander
5417817466cbSJens Wiklander= Version 1.2.14 released 2015-05-??
5418817466cbSJens Wiklander
5419817466cbSJens WiklanderSecurity
5420817466cbSJens Wiklander   * Fix potential invalid memory read in the server, that allows a client to
5421817466cbSJens Wiklander     crash it remotely (found by Caj Larsson).
5422817466cbSJens Wiklander   * Fix potential invalid memory read in certificate parsing, that allows a
5423817466cbSJens Wiklander     client to crash the server remotely if client authentication is enabled
5424817466cbSJens Wiklander     (found using Codenomicon Defensics).
5425817466cbSJens Wiklander   * Add countermeasure against "Lucky 13 strikes back" cache-based attack,
5426817466cbSJens Wiklander     https://dl.acm.org/citation.cfm?id=2714625
5427817466cbSJens Wiklander
5428817466cbSJens WiklanderBugfix
5429817466cbSJens Wiklander   * Fix bug in Via Padlock support (found by Nikos Mavrogiannopoulos).
5430817466cbSJens Wiklander   * Fix hardclock() (only used in the benchmarking program) with some
5431817466cbSJens Wiklander     versions of mingw64 (found by kxjhlele).
5432817466cbSJens Wiklander   * Fix warnings from mingw64 in timing.c (found by kxjklele).
5433817466cbSJens Wiklander   * Fix potential unintended sign extension in asn1_get_len() on 64-bit
5434817466cbSJens Wiklander     platforms (found with Coverity Scan).
5435817466cbSJens Wiklander
5436817466cbSJens Wiklander= Version 1.2.13 released 2015-02-16
5437817466cbSJens WiklanderNote: Although PolarSSL has been renamed to mbed TLS, no changes reflecting
5438817466cbSJens Wiklander      this will be made in the 1.2 branch at this point.
5439817466cbSJens Wiklander
5440817466cbSJens WiklanderSecurity
5441817466cbSJens Wiklander   * Fix remotely-triggerable uninitialised pointer dereference caused by
5442817466cbSJens Wiklander     crafted X.509 certificate (TLS server is not affected if it doesn't ask
5443817466cbSJens Wiklander     for a client certificate) (found using Codenomicon Defensics).
5444817466cbSJens Wiklander   * Fix remotely-triggerable memory leak caused by crafted X.509 certificates
5445817466cbSJens Wiklander     (TLS server is not affected if it doesn't ask for a client certificate)
5446817466cbSJens Wiklander     (found using Codenomicon Defensics).
5447817466cbSJens Wiklander   * Fix potential stack overflow while parsing crafted X.509 certificates
5448817466cbSJens Wiklander     (TLS server is not affected if it doesn't ask for a client certificate)
5449817466cbSJens Wiklander     found using Codenomicon Defensics).
5450817466cbSJens Wiklander   * Fix buffer overread of size 1 when parsing crafted X.509 certificates
5451817466cbSJens Wiklander     (TLS server is not affected if it doesn't ask for a client certificate).
5452817466cbSJens Wiklander
5453817466cbSJens WiklanderBugfix
5454817466cbSJens Wiklander   * Fix potential undefined behaviour in Camellia.
5455817466cbSJens Wiklander   * Fix memory leaks in PKCS#5 and PKCS#12.
5456817466cbSJens Wiklander   * Stack buffer overflow if ctr_drbg_update() is called with too large
5457817466cbSJens Wiklander     add_len (found by Jean-Philippe Aumasson) (not triggerable remotely).
5458817466cbSJens Wiklander   * Fix bug in MPI/bignum on s390/s390x (reported by Dan Horák) (introduced
5459817466cbSJens Wiklander     in 1.2.12).
5460817466cbSJens Wiklander   * Fix unchecked return code in x509_crt_parse_path() on Windows (found by
5461817466cbSJens Wiklander     Peter Vaskovic).
5462817466cbSJens Wiklander   * Fix assembly selection for MIPS64 (thanks to James Cowgill).
5463817466cbSJens Wiklander   * ssl_get_verify_result() now works even if the handshake was aborted due
5464817466cbSJens Wiklander     to a failed verification (found by Fredrik Axelsson).
5465817466cbSJens Wiklander   * Skip writing and parsing signature_algorithm extension if none of the
5466817466cbSJens Wiklander     key exchanges enabled needs certificates. This fixes a possible interop
5467817466cbSJens Wiklander     issue with some servers when a zero-length extension was sent. (Reported
5468817466cbSJens Wiklander     by Peter Dettman.)
5469817466cbSJens Wiklander   * On a 0-length input, base64_encode() did not correctly set output length
5470817466cbSJens Wiklander     (found by Hendrik van den Boogaard).
5471817466cbSJens Wiklander
5472817466cbSJens WiklanderChanges
5473817466cbSJens Wiklander   * Blind RSA private operations even when POLARSSL_RSA_NO_CRT is defined.
5474817466cbSJens Wiklander   * Forbid repeated extensions in X.509 certificates.
5475817466cbSJens Wiklander   * Add compile-time option POLARSSL_X509_MAX_INTERMEDIATE_CA to limit the
5476817466cbSJens Wiklander     length of an X.509 verification chain (default = 8).
5477817466cbSJens Wiklander= Version 1.2.12 released 2014-10-24
5478817466cbSJens Wiklander
5479817466cbSJens WiklanderSecurity
5480817466cbSJens Wiklander   * Remotely-triggerable memory leak when parsing some X.509 certificates
5481817466cbSJens Wiklander     (server is not affected if it doesn't ask for a client certificate).
5482817466cbSJens Wiklander     (Found using Codenomicon Defensics.)
5483817466cbSJens Wiklander
5484817466cbSJens WiklanderBugfix
5485817466cbSJens Wiklander   * Fix potential bad read in parsing ServerHello (found by Adrien
5486817466cbSJens Wiklander     Vialletelle).
5487817466cbSJens Wiklander   * ssl_close_notify() could send more than one message in some circumstances
5488817466cbSJens Wiklander     with non-blocking I/O.
5489817466cbSJens Wiklander   * x509_crt_parse() did not increase total_failed on PEM error
5490817466cbSJens Wiklander   * Fix compiler warnings on iOS (found by Sander Niemeijer).
5491817466cbSJens Wiklander   * Don't print uninitialised buffer in ssl_mail_client (found by Marc Abel).
5492817466cbSJens Wiklander   * Fix net_accept() regarding non-blocking sockets (found by Luca Pesce).
5493817466cbSJens Wiklander   * ssl_read() could return non-application data records on server while
5494817466cbSJens Wiklander     renegotation was pending, and on client when a HelloRequest was received.
5495817466cbSJens Wiklander   * Fix warnings from Clang's scan-build (contributed by Alfred Klomp).
5496817466cbSJens Wiklander
5497817466cbSJens WiklanderChanges
5498817466cbSJens Wiklander   * X.509 certificates with more than one AttributeTypeAndValue per
5499817466cbSJens Wiklander     RelativeDistinguishedName are not accepted any more.
5500817466cbSJens Wiklander   * ssl_read() now returns POLARSSL_ERR_NET_WANT_READ rather than
5501817466cbSJens Wiklander     POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE on harmless alerts.
5502817466cbSJens Wiklander   * Accept spaces at end of line or end of buffer in base64_decode().
5503817466cbSJens Wiklander
5504817466cbSJens Wiklander= Version 1.2.11 released 2014-07-11
5505817466cbSJens WiklanderFeatures
5506817466cbSJens Wiklander   * Entropy module now supports seed writing and reading
5507817466cbSJens Wiklander
5508817466cbSJens WiklanderChanges
5509817466cbSJens Wiklander   * Introduced POLARSSL_HAVE_READDIR_R for systems without it
5510817466cbSJens Wiklander   * Improvements to the CMake build system, contributed by Julian Ospald.
5511817466cbSJens Wiklander   * Work around a bug of the version of Clang shipped by Apple with Mavericks
5512817466cbSJens Wiklander     that prevented bignum.c from compiling. (Reported by Rafael Baptista.)
5513817466cbSJens Wiklander   * Improvements to tests/Makefile, contributed by Oden Eriksson.
5514817466cbSJens Wiklander   * Use UTC time to check certificate validity.
5515817466cbSJens Wiklander   * Reject certificates with times not in UTC, per RFC 5280.
5516817466cbSJens Wiklander   * Migrate zeroizing of data to polarssl_zeroize() instead of memset()
5517817466cbSJens Wiklander     against unwanted compiler optimizations
5518817466cbSJens Wiklander
5519817466cbSJens WiklanderSecurity
5520817466cbSJens Wiklander   * Forbid change of server certificate during renegotiation to prevent
5521817466cbSJens Wiklander     "triple handshake" attack when authentication mode is optional (the
5522817466cbSJens Wiklander     attack was already impossible when authentication is required).
5523817466cbSJens Wiklander   * Check notBefore timestamp of certificates and CRLs from the future.
5524817466cbSJens Wiklander   * Forbid sequence number wrapping
5525817466cbSJens Wiklander   * Prevent potential NULL pointer dereference in ssl_read_record() (found by
5526817466cbSJens Wiklander     TrustInSoft)
5527817466cbSJens Wiklander   * Fix length checking for AEAD ciphersuites (found by Codenomicon).
5528817466cbSJens Wiklander     It was possible to crash the server (and client) using crafted messages
5529817466cbSJens Wiklander     when a GCM suite was chosen.
5530817466cbSJens Wiklander
5531817466cbSJens WiklanderBugfix
5532817466cbSJens Wiklander   * Fixed X.509 hostname comparison (with non-regular characters)
5533817466cbSJens Wiklander   * SSL now gracefully handles missing RNG
5534817466cbSJens Wiklander   * crypt_and_hash app checks MAC before final decryption
5535817466cbSJens Wiklander   * Fixed x509_crt_parse_path() bug on Windows platforms
5536817466cbSJens Wiklander   * Added missing MPI_CHK() around some statements in mpi_div_mpi() (found by
5537817466cbSJens Wiklander     TrustInSoft)
5538817466cbSJens Wiklander   * Fixed potential overflow in certificate size verification in
5539817466cbSJens Wiklander     ssl_write_certificate() (found by TrustInSoft)
5540817466cbSJens Wiklander   * Fix ASM format in bn_mul.h
5541817466cbSJens Wiklander   * Potential memory leak in bignum_selftest()
5542817466cbSJens Wiklander   * Replaced expired test certificate
5543817466cbSJens Wiklander   * ssl_mail_client now terminates lines with CRLF, instead of LF
5544817466cbSJens Wiklander   * Fix bug in RSA PKCS#1 v1.5 "reversed" operations
5545817466cbSJens Wiklander   * Fixed testing with out-of-source builds using cmake
5546817466cbSJens Wiklander   * Fixed version-major intolerance in server
5547817466cbSJens Wiklander   * Fixed CMake symlinking on out-of-source builds
5548817466cbSJens Wiklander   * Bignum's MIPS-32 assembly was used on MIPS-64, causing chaos. (Found by
5549817466cbSJens Wiklander     Alex Wilson.)
5550817466cbSJens Wiklander   * ssl_init() was leaving a dirty pointer in ssl_context if malloc of
5551817466cbSJens Wiklander     out_ctr failed
5552817466cbSJens Wiklander   * ssl_handshake_init() was leaving dirty pointers in subcontexts if malloc
5553817466cbSJens Wiklander     of one of them failed
5554817466cbSJens Wiklander   * x509_get_current_time() uses localtime_r() to prevent thread issues
5555817466cbSJens Wiklander   * Some example server programs were not sending the close_notify alert.
5556817466cbSJens Wiklander   * Potential memory leak in mpi_exp_mod() when error occurs during
5557817466cbSJens Wiklander     calculation of RR.
5558817466cbSJens Wiklander   * Improve interoperability by not writing extension length in ClientHello
5559817466cbSJens Wiklander     when no extensions are present (found by Matthew Page)
5560817466cbSJens Wiklander   * rsa_check_pubkey() now allows an E up to N
5561817466cbSJens Wiklander   * On OpenBSD, use arc4random_buf() instead of rand() to prevent warnings
5562817466cbSJens Wiklander   * mpi_fill_random() was creating numbers larger than requested on
5563817466cbSJens Wiklander     big-endian platform when size was not an integer number of limbs
5564817466cbSJens Wiklander   * Fix detection of DragonflyBSD in net.c (found by Markus Pfeiffer)
5565817466cbSJens Wiklander   * Stricter check on SSL ClientHello internal sizes compared to actual packet
5566817466cbSJens Wiklander     size (found by TrustInSoft)
5567817466cbSJens Wiklander   * Fix preprocessor checks for bn_mul PPC asm (found by Barry K. Nathan).
5568817466cbSJens Wiklander   * Use \n\t rather than semicolons for bn_mul asm, since some assemblers
5569817466cbSJens Wiklander     interpret semicolons as comment delimiters (found by Barry K. Nathan).
5570817466cbSJens Wiklander   * Disable broken Sparc64 bn_mul assembly (found by Florian Obser).
5571817466cbSJens Wiklander   * Fix base64_decode() to return and check length correctly (in case of
5572817466cbSJens Wiklander     tight buffers)
5573817466cbSJens Wiklander
5574817466cbSJens Wiklander= Version 1.2.10 released 2013-10-07
5575817466cbSJens WiklanderChanges
5576817466cbSJens Wiklander   * Changed RSA blinding to a slower but thread-safe version
5577817466cbSJens Wiklander
5578817466cbSJens WiklanderBugfix
5579817466cbSJens Wiklander   * Fixed memory leak in RSA as a result of introduction of blinding
5580817466cbSJens Wiklander   * Fixed ssl_pkcs11_decrypt() prototype
5581817466cbSJens Wiklander   * Fixed MSVC project files
5582817466cbSJens Wiklander
5583817466cbSJens Wiklander= Version 1.2.9 released 2013-10-01
5584817466cbSJens WiklanderChanges
5585817466cbSJens Wiklander   * x509_verify() now case insensitive for cn (RFC 6125 6.4)
5586817466cbSJens Wiklander
5587817466cbSJens WiklanderBugfix
5588817466cbSJens Wiklander   * Fixed potential memory leak when failing to resume a session
5589817466cbSJens Wiklander   * Fixed potential file descriptor leaks (found by Remi Gacogne)
5590817466cbSJens Wiklander   * Minor fixes
5591817466cbSJens Wiklander
5592817466cbSJens WiklanderSecurity
5593817466cbSJens Wiklander   * Fixed potential heap buffer overflow on large hostname setting
5594817466cbSJens Wiklander   * Fixed potential negative value misinterpretation in load_file()
5595817466cbSJens Wiklander   * RSA blinding on CRT operations to counter timing attacks
5596817466cbSJens Wiklander     (found by Cyril Arnaud and Pierre-Alain Fouque)
5597817466cbSJens Wiklander
5598817466cbSJens Wiklander= Version 1.2.8 released 2013-06-19
5599817466cbSJens WiklanderFeatures
5600817466cbSJens Wiklander   * Parsing of PKCS#8 encrypted private key files
5601817466cbSJens Wiklander   * PKCS#12 PBE and derivation functions
5602817466cbSJens Wiklander   * Centralized module option values in config.h to allow user-defined
5603817466cbSJens Wiklander     settings without editing header files by using POLARSSL_CONFIG_OPTIONS
5604817466cbSJens Wiklander
5605817466cbSJens WiklanderChanges
5606817466cbSJens Wiklander   * HAVEGE random generator disabled by default
5607817466cbSJens Wiklander   * Internally split up x509parse_key() into a (PEM) handler function
5608817466cbSJens Wiklander     and specific DER parser functions for the PKCS#1 and unencrypted
5609817466cbSJens Wiklander     PKCS#8 private key formats
5610817466cbSJens Wiklander   * Added mechanism to provide alternative implementations for all
5611817466cbSJens Wiklander     symmetric cipher and hash algorithms (e.g. POLARSSL_AES_ALT in
5612817466cbSJens Wiklander     config.h)
5613817466cbSJens Wiklander   * PKCS#5 module added. Moved PBKDF2 functionality inside and deprecated
5614817466cbSJens Wiklander     old PBKDF2 module
5615817466cbSJens Wiklander
5616817466cbSJens WiklanderBugfix
5617817466cbSJens Wiklander   * Secure renegotiation extension should only be sent in case client
5618817466cbSJens Wiklander     supports secure renegotiation
5619817466cbSJens Wiklander   * Fixed offset for cert_type list in ssl_parse_certificate_request()
5620817466cbSJens Wiklander   * Fixed const correctness issues that have no impact on the ABI
5621817466cbSJens Wiklander   * x509parse_crt() now better handles PEM error situations
5622817466cbSJens Wiklander   * ssl_parse_certificate() now calls x509parse_crt_der() directly
5623817466cbSJens Wiklander     instead of the x509parse_crt() wrapper that can also parse PEM
5624817466cbSJens Wiklander     certificates
5625817466cbSJens Wiklander   * x509parse_crtpath() is now reentrant and uses more portable stat()
5626817466cbSJens Wiklander   * Fixed bignum.c and bn_mul.h to support Thumb2 and LLVM compiler
5627817466cbSJens Wiklander   * Fixed values for 2-key Triple DES in cipher layer
5628817466cbSJens Wiklander   * ssl_write_certificate_request() can handle empty ca_chain
5629817466cbSJens Wiklander
5630817466cbSJens WiklanderSecurity
5631817466cbSJens Wiklander   * A possible DoS during the SSL Handshake, due to faulty parsing of
5632817466cbSJens Wiklander     PEM-encoded certificates has been fixed (found by Jack Lloyd)
5633817466cbSJens Wiklander
5634817466cbSJens Wiklander= Version 1.2.7 released 2013-04-13
5635817466cbSJens WiklanderFeatures
5636817466cbSJens Wiklander   * Ability to specify allowed ciphersuites based on the protocol version.
5637817466cbSJens Wiklander
5638817466cbSJens WiklanderChanges
5639817466cbSJens Wiklander   * Default Blowfish keysize is now 128-bits
5640817466cbSJens Wiklander   * Test suites made smaller to accommodate Raspberry Pi
5641817466cbSJens Wiklander
5642817466cbSJens WiklanderBugfix
5643817466cbSJens Wiklander   * Fix for MPI assembly for ARM
5644817466cbSJens Wiklander   * GCM adapted to support sizes > 2^29
5645817466cbSJens Wiklander
5646817466cbSJens Wiklander= Version 1.2.6 released 2013-03-11
5647817466cbSJens WiklanderBugfix
5648817466cbSJens Wiklander   * Fixed memory leak in ssl_free() and ssl_reset() for active session
5649817466cbSJens Wiklander   * Corrected GCM counter incrementation to use only 32-bits instead of
5650817466cbSJens Wiklander     128-bits (found by Yawning Angel)
5651817466cbSJens Wiklander   * Fixes for 64-bit compilation with MS Visual Studio
5652817466cbSJens Wiklander   * Fixed net_bind() for specified IP addresses on little endian systems
5653817466cbSJens Wiklander   * Fixed assembly code for ARM (Thumb and regular) for some compilers
5654817466cbSJens Wiklander
5655817466cbSJens WiklanderChanges
5656817466cbSJens Wiklander   * Internally split up rsa_pkcs1_encrypt(), rsa_pkcs1_decrypt(),
5657817466cbSJens Wiklander     rsa_pkcs1_sign() and rsa_pkcs1_verify() to separate PKCS#1 v1.5 and
5658817466cbSJens Wiklander     PKCS#1 v2.1 functions
5659817466cbSJens Wiklander   * Added support for custom labels when using rsa_rsaes_oaep_encrypt()
5660817466cbSJens Wiklander     or rsa_rsaes_oaep_decrypt()
5661817466cbSJens Wiklander   * Re-added handling for SSLv2 Client Hello when the define
5662817466cbSJens Wiklander     POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is set
5663817466cbSJens Wiklander   * The SSL session cache module (ssl_cache) now also retains peer_cert
5664817466cbSJens Wiklander     information (not the entire chain)
5665817466cbSJens Wiklander
5666817466cbSJens WiklanderSecurity
5667817466cbSJens Wiklander   * Removed further timing differences during SSL message decryption in
5668817466cbSJens Wiklander     ssl_decrypt_buf()
5669817466cbSJens Wiklander   * Removed timing differences due to bad padding from
5670817466cbSJens Wiklander     rsa_rsaes_pkcs1_v15_decrypt() and rsa_pkcs1_decrypt() for PKCS#1 v1.5
5671817466cbSJens Wiklander     operations
5672817466cbSJens Wiklander
5673817466cbSJens Wiklander= Version 1.2.5 released 2013-02-02
5674817466cbSJens WiklanderChanges
5675817466cbSJens Wiklander   * Allow enabling of dummy error_strerror() to support some use-cases
5676817466cbSJens Wiklander   * Debug messages about padding errors during SSL message decryption are
5677817466cbSJens Wiklander     disabled by default and can be enabled with POLARSSL_SSL_DEBUG_ALL
5678817466cbSJens Wiklander   * Sending of security-relevant alert messages that do not break
5679817466cbSJens Wiklander     interoperability can be switched on/off with the flag
5680817466cbSJens Wiklander     POLARSSL_SSL_ALL_ALERT_MESSAGES
5681817466cbSJens Wiklander
5682817466cbSJens WiklanderSecurity
5683817466cbSJens Wiklander   * Removed timing differences during SSL message decryption in
5684817466cbSJens Wiklander     ssl_decrypt_buf() due to badly formatted padding
5685817466cbSJens Wiklander
5686817466cbSJens Wiklander= Version 1.2.4 released 2013-01-25
5687817466cbSJens WiklanderChanges
5688817466cbSJens Wiklander   * More advanced SSL ciphersuite representation and moved to more dynamic
5689817466cbSJens Wiklander     SSL core
5690817466cbSJens Wiklander   * Added ssl_handshake_step() to allow single stepping the handshake process
5691817466cbSJens Wiklander
5692817466cbSJens WiklanderBugfix
5693817466cbSJens Wiklander   * Memory leak when using RSA_PKCS_V21 operations fixed
5694817466cbSJens Wiklander   * Handle future version properly in ssl_write_certificate_request()
5695817466cbSJens Wiklander   * Correctly handle CertificateRequest message in client for <= TLS 1.1
5696817466cbSJens Wiklander     without DN list
5697817466cbSJens Wiklander
5698817466cbSJens Wiklander= Version 1.2.3 released 2012-11-26
5699817466cbSJens WiklanderBugfix
5700817466cbSJens Wiklander   * Server not always sending correct CertificateRequest message
5701817466cbSJens Wiklander
5702817466cbSJens Wiklander= Version 1.2.2 released 2012-11-24
5703817466cbSJens WiklanderChanges
5704817466cbSJens Wiklander   * Added p_hw_data to ssl_context for context specific hardware acceleration
5705817466cbSJens Wiklander     data
5706817466cbSJens Wiklander   * During verify trust-CA is only checked for expiration and CRL presence
5707817466cbSJens Wiklander
5708817466cbSJens WiklanderBugfixes
5709817466cbSJens Wiklander   * Fixed client authentication compatibility
5710817466cbSJens Wiklander   * Fixed dependency on POLARSSL_SHA4_C in SSL modules
5711817466cbSJens Wiklander
5712817466cbSJens Wiklander= Version 1.2.1 released 2012-11-20
5713817466cbSJens WiklanderChanges
5714817466cbSJens Wiklander   * Depth that the certificate verify callback receives is now numbered
5715817466cbSJens Wiklander     bottom-up (Peer cert depth is 0)
5716817466cbSJens Wiklander
5717817466cbSJens WiklanderBugfixes
5718817466cbSJens Wiklander   * Fixes for MSVC6
5719817466cbSJens Wiklander   * Moved mpi_inv_mod() outside POLARSSL_GENPRIME
5720817466cbSJens Wiklander   * Allow R and A to point to same mpi in mpi_div_mpi (found by Manuel
5721817466cbSJens Wiklander     Pégourié-Gonnard)
5722817466cbSJens Wiklander   * Fixed possible segfault in mpi_shift_r() (found by Manuel
5723817466cbSJens Wiklander     Pégourié-Gonnard)
5724817466cbSJens Wiklander   * Added max length check for rsa_pkcs1_sign with PKCS#1 v2.1
5725817466cbSJens Wiklander
5726817466cbSJens Wiklander= Version 1.2.0 released 2012-10-31
5727817466cbSJens WiklanderFeatures
5728817466cbSJens Wiklander   * Added support for NULL cipher (POLARSSL_CIPHER_NULL_CIPHER) and weak
5729817466cbSJens Wiklander     ciphersuites (POLARSSL_ENABLE_WEAK_CIPHERSUITES). They are disabled by
5730817466cbSJens Wiklander     default!
5731817466cbSJens Wiklander   * Added support for wildcard certificates
5732817466cbSJens Wiklander   * Added support for multi-domain certificates through the X509 Subject
5733817466cbSJens Wiklander     Alternative Name extension
5734817466cbSJens Wiklander   * Added preliminary ASN.1 buffer writing support
5735817466cbSJens Wiklander   * Added preliminary X509 Certificate Request writing support
5736817466cbSJens Wiklander   * Added key_app_writer example application
5737817466cbSJens Wiklander   * Added cert_req example application
5738817466cbSJens Wiklander   * Added base Galois Counter Mode (GCM) for AES
5739817466cbSJens Wiklander   * Added TLS 1.2 support (RFC 5246)
5740817466cbSJens Wiklander   * Added GCM suites to TLS 1.2 (RFC 5288)
5741817466cbSJens Wiklander   * Added commandline error code convertor (util/strerror)
5742817466cbSJens Wiklander   * Added support for Hardware Acceleration hooking in SSL/TLS
5743817466cbSJens Wiklander   * Added OpenSSL / PolarSSL compatibility script (tests/compat.sh) and
5744817466cbSJens Wiklander     example application (programs/ssl/o_p_test) (requires OpenSSL)
5745817466cbSJens Wiklander   * Added X509 CA Path support
5746817466cbSJens Wiklander   * Added Thumb assembly optimizations
5747817466cbSJens Wiklander   * Added DEFLATE compression support as per RFC3749 (requires zlib)
5748817466cbSJens Wiklander   * Added blowfish algorithm (Generic and cipher layer)
5749817466cbSJens Wiklander   * Added PKCS#5 PBKDF2 key derivation function
5750817466cbSJens Wiklander   * Added Secure Renegotiation (RFC 5746)
5751817466cbSJens Wiklander   * Added predefined DHM groups from RFC 5114
5752817466cbSJens Wiklander   * Added simple SSL session cache implementation
5753817466cbSJens Wiklander   * Added ServerName extension parsing (SNI) at server side
5754817466cbSJens Wiklander   * Added option to add minimum accepted SSL/TLS protocol version
5755817466cbSJens Wiklander
5756817466cbSJens WiklanderChanges
5757817466cbSJens Wiklander   * Removed redundant POLARSSL_DEBUG_MSG define
5758817466cbSJens Wiklander   * AES code only check for Padlock once
5759817466cbSJens Wiklander   * Fixed const-correctness mpi_get_bit()
5760817466cbSJens Wiklander   * Documentation for mpi_lsb() and mpi_msb()
5761817466cbSJens Wiklander   * Moved out_msg to out_hdr + 32 to support hardware acceleration
5762817466cbSJens Wiklander   * Changed certificate verify behaviour to comply with RFC 6125 section 6.3
5763817466cbSJens Wiklander     to not match CN if subjectAltName extension is present (Closes ticket #56)
5764817466cbSJens Wiklander   * Cipher layer cipher_mode_t POLARSSL_MODE_CFB128 is renamed to
5765817466cbSJens Wiklander     POLARSSL_MODE_CFB, to also handle different block size CFB modes.
5766817466cbSJens Wiklander   * Removed handling for SSLv2 Client Hello (as per RFC 5246 recommendation)
5767817466cbSJens Wiklander   * Revamped session resumption handling
5768817466cbSJens Wiklander   * Generalized external private key implementation handling (like PKCS#11)
5769817466cbSJens Wiklander     in SSL/TLS
5770817466cbSJens Wiklander   * Revamped x509_verify() and the SSL f_vrfy callback implementations
5771817466cbSJens Wiklander   * Moved from unsigned long to fixed width uint32_t types throughout code
5772817466cbSJens Wiklander   * Renamed ciphersuites naming scheme to IANA reserved names
5773817466cbSJens Wiklander
5774817466cbSJens WiklanderBugfix
5775817466cbSJens Wiklander   * Fixed handling error in mpi_cmp_mpi() on longer B values (found by
5776817466cbSJens Wiklander     Hui Dong)
5777817466cbSJens Wiklander   * Fixed potential heap corruption in x509_name allocation
5778817466cbSJens Wiklander   * Fixed single RSA test that failed on Big Endian systems (Closes ticket #54)
5779817466cbSJens Wiklander   * mpi_exp_mod() now correctly handles negative base numbers (Closes ticket
5780817466cbSJens Wiklander     #52)
5781817466cbSJens Wiklander   * Handle encryption with private key and decryption with public key as per
5782817466cbSJens Wiklander     RFC 2313
5783817466cbSJens Wiklander   * Handle empty certificate subject names
5784817466cbSJens Wiklander   * Prevent reading over buffer boundaries on X509 certificate parsing
5785817466cbSJens Wiklander   * mpi_add_abs() now correctly handles adding short numbers to long numbers
5786817466cbSJens Wiklander     with carry rollover (found by Ruslan Yushchenko)
5787817466cbSJens Wiklander   * Handle existence of OpenSSL Trust Extensions at end of X.509 DER blob
5788817466cbSJens Wiklander   * Fixed MPI assembly for SPARC64 platform
5789817466cbSJens Wiklander
5790817466cbSJens WiklanderSecurity
5791817466cbSJens Wiklander   * Fixed potential memory zeroization on miscrafted RSA key (found by Eloi
5792817466cbSJens Wiklander     Vanderbeken)
5793817466cbSJens Wiklander
5794817466cbSJens Wiklander= Version 1.1.8 released on 2013-10-01
5795817466cbSJens WiklanderBugfix
5796817466cbSJens Wiklander   * Fixed potential memory leak when failing to resume a session
5797817466cbSJens Wiklander   * Fixed potential file descriptor leaks
5798817466cbSJens Wiklander
5799817466cbSJens WiklanderSecurity
5800817466cbSJens Wiklander   * Potential buffer-overflow for ssl_read_record() (independently found by
5801817466cbSJens Wiklander     both TrustInSoft and Paul Brodeur of Leviathan Security Group)
5802817466cbSJens Wiklander   * Potential negative value misinterpretation in load_file()
5803817466cbSJens Wiklander   * Potential heap buffer overflow on large hostname setting
5804817466cbSJens Wiklander
5805817466cbSJens Wiklander= Version 1.1.7 released on 2013-06-19
5806817466cbSJens WiklanderChanges
5807817466cbSJens Wiklander   * HAVEGE random generator disabled by default
5808817466cbSJens Wiklander
5809817466cbSJens WiklanderBugfix
5810817466cbSJens Wiklander   * x509parse_crt() now better handles PEM error situations
5811817466cbSJens Wiklander   * ssl_parse_certificate() now calls x509parse_crt_der() directly
5812817466cbSJens Wiklander     instead of the x509parse_crt() wrapper that can also parse PEM
5813817466cbSJens Wiklander     certificates
5814817466cbSJens Wiklander   * Fixed values for 2-key Triple DES in cipher layer
5815817466cbSJens Wiklander   * ssl_write_certificate_request() can handle empty ca_chain
5816817466cbSJens Wiklander
5817817466cbSJens WiklanderSecurity
5818817466cbSJens Wiklander   * A possible DoS during the SSL Handshake, due to faulty parsing of
5819817466cbSJens Wiklander     PEM-encoded certificates has been fixed (found by Jack Lloyd)
5820817466cbSJens Wiklander
5821817466cbSJens Wiklander= Version 1.1.6 released on 2013-03-11
5822817466cbSJens WiklanderBugfix
5823817466cbSJens Wiklander   * Fixed net_bind() for specified IP addresses on little endian systems
5824817466cbSJens Wiklander
5825817466cbSJens WiklanderChanges
5826817466cbSJens Wiklander   * Allow enabling of dummy error_strerror() to support some use-cases
5827817466cbSJens Wiklander   * Debug messages about padding errors during SSL message decryption are
5828817466cbSJens Wiklander     disabled by default and can be enabled with POLARSSL_SSL_DEBUG_ALL
5829817466cbSJens Wiklander
5830817466cbSJens WiklanderSecurity
5831817466cbSJens Wiklander   * Removed timing differences during SSL message decryption in
5832817466cbSJens Wiklander     ssl_decrypt_buf()
5833817466cbSJens Wiklander   * Removed timing differences due to bad padding from
5834817466cbSJens Wiklander     rsa_rsaes_pkcs1_v15_decrypt() and rsa_pkcs1_decrypt() for PKCS#1 v1.5
5835817466cbSJens Wiklander     operations
5836817466cbSJens Wiklander
5837817466cbSJens Wiklander= Version 1.1.5 released on 2013-01-16
5838817466cbSJens WiklanderBugfix
5839817466cbSJens Wiklander   * Fixed MPI assembly for SPARC64 platform
5840817466cbSJens Wiklander   * Handle existence of OpenSSL Trust Extensions at end of X.509 DER blob
5841817466cbSJens Wiklander   * mpi_add_abs() now correctly handles adding short numbers to long numbers
5842817466cbSJens Wiklander     with carry rollover
5843817466cbSJens Wiklander   * Moved mpi_inv_mod() outside POLARSSL_GENPRIME
5844817466cbSJens Wiklander   * Prevent reading over buffer boundaries on X509 certificate parsing
5845817466cbSJens Wiklander   * mpi_exp_mod() now correctly handles negative base numbers (Closes ticket
5846817466cbSJens Wiklander     #52)
5847817466cbSJens Wiklander   * Fixed possible segfault in mpi_shift_r() (found by Manuel
5848817466cbSJens Wiklander     Pégourié-Gonnard)
5849817466cbSJens Wiklander   * Allow R and A to point to same mpi in mpi_div_mpi (found by Manuel
5850817466cbSJens Wiklander     Pégourié-Gonnard)
5851817466cbSJens Wiklander   * Added max length check for rsa_pkcs1_sign with PKCS#1 v2.1
5852817466cbSJens Wiklander   * Memory leak when using RSA_PKCS_V21 operations fixed
5853817466cbSJens Wiklander   * Handle encryption with private key and decryption with public key as per
5854817466cbSJens Wiklander     RFC 2313
5855817466cbSJens Wiklander   * Fixes for MSVC6
5856817466cbSJens Wiklander
5857817466cbSJens WiklanderSecurity
5858817466cbSJens Wiklander   * Fixed potential memory zeroization on miscrafted RSA key (found by Eloi
5859817466cbSJens Wiklander     Vanderbeken)
5860817466cbSJens Wiklander
5861817466cbSJens Wiklander= Version 1.1.4 released on 2012-05-31
5862817466cbSJens WiklanderBugfix
5863817466cbSJens Wiklander   * Correctly handle empty SSL/TLS packets (Found by James Yonan)
5864817466cbSJens Wiklander   * Fixed potential heap corruption in x509_name allocation
5865817466cbSJens Wiklander   * Fixed single RSA test that failed on Big Endian systems (Closes ticket #54)
5866817466cbSJens Wiklander
5867817466cbSJens Wiklander= Version 1.1.3 released on 2012-04-29
5868817466cbSJens WiklanderBugfix
5869817466cbSJens Wiklander   * Fixed random MPI generation to not generate more size than requested.
5870817466cbSJens Wiklander
5871817466cbSJens Wiklander= Version 1.1.2 released on 2012-04-26
5872817466cbSJens WiklanderBugfix
5873817466cbSJens Wiklander   * Fixed handling error in mpi_cmp_mpi() on longer B values (found by
5874817466cbSJens Wiklander     Hui Dong)
5875817466cbSJens Wiklander
5876817466cbSJens WiklanderSecurity
5877817466cbSJens Wiklander   * Fixed potential memory corruption on miscrafted client messages (found by
5878817466cbSJens Wiklander     Frama-C team at CEA LIST)
5879817466cbSJens Wiklander   * Fixed generation of DHM parameters to correct length (found by Ruslan
5880817466cbSJens Wiklander     Yushchenko)
5881817466cbSJens Wiklander
5882817466cbSJens Wiklander= Version 1.1.1 released on 2012-01-23
5883817466cbSJens WiklanderBugfix
5884817466cbSJens Wiklander   * Check for failed malloc() in ssl_set_hostname() and x509_get_entries()
5885817466cbSJens Wiklander     (Closes ticket #47, found by Hugo Leisink)
5886817466cbSJens Wiklander   * Fixed issues with Intel compiler on 64-bit systems (Closes ticket #50)
5887817466cbSJens Wiklander   * Fixed multiple compiler warnings for VS6 and armcc
5888817466cbSJens Wiklander   * Fixed bug in CTR_CRBG selftest
5889817466cbSJens Wiklander
5890817466cbSJens Wiklander= Version 1.1.0 released on 2011-12-22
5891817466cbSJens WiklanderFeatures
5892817466cbSJens Wiklander   * Added ssl_session_reset() to allow better multi-connection pools of
5893817466cbSJens Wiklander     SSL contexts without needing to set all non-connection-specific
5894817466cbSJens Wiklander     data and pointers again. Adapted ssl_server to use this functionality.
5895817466cbSJens Wiklander   * Added ssl_set_max_version() to allow clients to offer a lower maximum
5896817466cbSJens Wiklander     supported version to a server to help buggy server implementations.
5897817466cbSJens Wiklander     (Closes ticket #36)
5898817466cbSJens Wiklander   * Added cipher_get_cipher_mode() and cipher_get_cipher_operation()
5899817466cbSJens Wiklander     introspection functions (Closes ticket #40)
5900817466cbSJens Wiklander   * Added CTR_DRBG based on AES-256-CTR (NIST SP 800-90) random generator
5901817466cbSJens Wiklander   * Added a generic entropy accumulator that provides support for adding
5902817466cbSJens Wiklander     custom entropy sources and added some generic and platform dependent
5903817466cbSJens Wiklander     entropy sources
5904817466cbSJens Wiklander
5905817466cbSJens WiklanderChanges
5906817466cbSJens Wiklander   * Documentation for AES and Camellia in modes CTR and CFB128 clarified.
5907817466cbSJens Wiklander   * Fixed rsa_encrypt and rsa_decrypt examples to use public key for
5908817466cbSJens Wiklander     encryption and private key for decryption. (Closes ticket #34)
5909817466cbSJens Wiklander   * Inceased maximum size of ASN1 length reads to 32-bits.
5910817466cbSJens Wiklander   * Added an EXPLICIT tag number parameter to x509_get_ext()
5911817466cbSJens Wiklander   * Added a separate CRL entry extension parsing function
5912817466cbSJens Wiklander   * Separated the ASN.1 parsing code from the X.509 specific parsing code.
5913817466cbSJens Wiklander     So now there is a module that is controlled with POLARSSL_ASN1_PARSE_C.
5914817466cbSJens Wiklander   * Changed the defined key-length of DES ciphers in cipher.h to include the
5915817466cbSJens Wiklander     parity bits, to prevent mistakes in copying data. (Closes ticket #33)
5916817466cbSJens Wiklander   * Loads of minimal changes to better support WINCE as a build target
5917817466cbSJens Wiklander     (Credits go to Marco Lizza)
5918817466cbSJens Wiklander   * Added POLARSSL_MPI_WINDOW_SIZE definition to allow easier time to memory
5919817466cbSJens Wiklander     trade-off
5920817466cbSJens Wiklander   * Introduced POLARSSL_MPI_MAX_SIZE and POLARSSL_MPI_MAX_BITS for MPI size
5921817466cbSJens Wiklander     management (Closes ticket #44)
5922817466cbSJens Wiklander   * Changed the used random function pointer to more flexible format. Renamed
5923817466cbSJens Wiklander     havege_rand() to havege_random() to prevent mistakes. Lots of changes as
5924817466cbSJens Wiklander     a consequence in library code and programs
5925817466cbSJens Wiklander   * Moved all examples programs to use the new entropy and CTR_DRBG
5926817466cbSJens Wiklander   * Added permissive certificate parsing to x509parse_crt() and
5927817466cbSJens Wiklander     x509parse_crtfile(). With permissive parsing the parsing does not stop on
5928817466cbSJens Wiklander     encountering a parse-error. Beware that the meaning of return values has
5929817466cbSJens Wiklander     changed!
5930817466cbSJens Wiklander   * All error codes are now negative. Even on mermory failures and IO errors.
5931817466cbSJens Wiklander
5932817466cbSJens WiklanderBugfix
5933817466cbSJens Wiklander   * Fixed faulty HMAC-MD2 implementation. Found by dibac. (Closes
5934817466cbSJens Wiklander     ticket #37)
5935817466cbSJens Wiklander   * Fixed a bug where the CRL parser expected an EXPLICIT ASN.1 tag
5936817466cbSJens Wiklander     before version numbers
5937817466cbSJens Wiklander   * Allowed X509 key usage parsing to accept 4 byte values instead of the
5938817466cbSJens Wiklander     standard 1 byte version sometimes used by Microsoft. (Closes ticket #38)
5939817466cbSJens Wiklander   * Fixed incorrect behaviour in case of RSASSA-PSS with a salt length
5940817466cbSJens Wiklander     smaller than the hash length. (Closes ticket #41)
5941817466cbSJens Wiklander   * If certificate serial is longer than 32 octets, serial number is now
5942817466cbSJens Wiklander     appended with '....' after first 28 octets
5943817466cbSJens Wiklander   * Improved build support for s390x and sparc64 in bignum.h
5944817466cbSJens Wiklander   * Fixed MS Visual C++ name clash with int64 in sha4.h
5945817466cbSJens Wiklander   * Corrected removal of leading "00:" in printing serial numbers in
5946817466cbSJens Wiklander     certificates and CRLs
5947817466cbSJens Wiklander
5948817466cbSJens Wiklander= Version 1.0.0 released on 2011-07-27
5949817466cbSJens WiklanderFeatures
5950817466cbSJens Wiklander   * Expanded cipher layer with support for CFB128 and CTR mode
5951817466cbSJens Wiklander   * Added rsa_encrypt and rsa_decrypt simple example programs.
5952817466cbSJens Wiklander
5953817466cbSJens WiklanderChanges
5954817466cbSJens Wiklander   * The generic cipher and message digest layer now have normal error
5955817466cbSJens Wiklander     codes instead of integers
5956817466cbSJens Wiklander
5957817466cbSJens WiklanderBugfix
5958817466cbSJens Wiklander   * Undid faulty bug fix in ssl_write() when flushing old data (Ticket
5959817466cbSJens Wiklander     #18)
5960817466cbSJens Wiklander
5961817466cbSJens Wiklander= Version 0.99-pre5 released on 2011-05-26
5962817466cbSJens WiklanderFeatures
5963817466cbSJens Wiklander   * Added additional Cipher Block Modes to symmetric ciphers
5964817466cbSJens Wiklander     (AES CTR, Camellia CTR, XTEA CBC) including the option to
5965817466cbSJens Wiklander     enable and disable individual modes when needed
5966817466cbSJens Wiklander   * Functions requiring File System functions can now be disabled
5967817466cbSJens Wiklander     by undefining POLARSSL_FS_IO
5968817466cbSJens Wiklander   * A error_strerror function() has been added to translate between
5969817466cbSJens Wiklander     error codes and their description.
5970817466cbSJens Wiklander   * Added mpi_get_bit() and mpi_set_bit() individual bit setter/getter
5971817466cbSJens Wiklander     functions.
5972817466cbSJens Wiklander   * Added ssl_mail_client and ssl_fork_server as example programs.
5973817466cbSJens Wiklander
5974817466cbSJens WiklanderChanges
5975817466cbSJens Wiklander   * Major argument / variable rewrite. Introduced use of size_t
5976817466cbSJens Wiklander     instead of int for buffer lengths and loop variables for
5977817466cbSJens Wiklander     better unsigned / signed use. Renamed internal bigint types
5978817466cbSJens Wiklander     t_int and t_dbl to t_uint and t_udbl in the process
5979817466cbSJens Wiklander   * mpi_init() and mpi_free() now only accept a single MPI
5980817466cbSJens Wiklander     argument and do not accept variable argument lists anymore.
5981817466cbSJens Wiklander   * The error codes have been remapped and combining error codes
5982817466cbSJens Wiklander     is now done with a PLUS instead of an OR as error codes
5983817466cbSJens Wiklander     used are negative.
5984817466cbSJens Wiklander   * Changed behaviour of net_read(), ssl_fetch_input() and ssl_recv().
5985817466cbSJens Wiklander     net_recv() now returns 0 on EOF instead of
5986817466cbSJens Wiklander     POLARSSL_ERR_NET_CONN_RESET. ssl_fetch_input() returns
5987817466cbSJens Wiklander     POLARSSL_ERR_SSL_CONN_EOF on an EOF from its f_recv() function.
5988817466cbSJens Wiklander     ssl_read() returns 0 if a POLARSSL_ERR_SSL_CONN_EOF is received
5989817466cbSJens Wiklander     after the handshake.
5990817466cbSJens Wiklander   * Network functions now return POLARSSL_ERR_NET_WANT_READ or
5991817466cbSJens Wiklander     POLARSSL_ERR_NET_WANT_WRITE instead of the ambiguous
5992817466cbSJens Wiklander     POLARSSL_ERR_NET_TRY_AGAIN
5993817466cbSJens Wiklander
5994817466cbSJens Wiklander= Version 0.99-pre4 released on 2011-04-01
5995817466cbSJens WiklanderFeatures
5996817466cbSJens Wiklander   * Added support for PKCS#1 v2.1 encoding and thus support
5997817466cbSJens Wiklander     for the RSAES-OAEP and RSASSA-PSS operations.
5998817466cbSJens Wiklander   * Reading of Public Key files incorporated into default x509
5999817466cbSJens Wiklander     functionality as well.
6000817466cbSJens Wiklander   * Added mpi_fill_random() for centralized filling of big numbers
6001817466cbSJens Wiklander     with random data (Fixed ticket #10)
6002817466cbSJens Wiklander
6003817466cbSJens WiklanderChanges
6004817466cbSJens Wiklander   * Debug print of MPI now removes leading zero octets and
6005817466cbSJens Wiklander     displays actual bit size of the value.
6006817466cbSJens Wiklander   * x509parse_key() (and as a consequence x509parse_keyfile())
6007817466cbSJens Wiklander     does not zeroize memory in advance anymore. Use rsa_init()
6008817466cbSJens Wiklander     before parsing a key or keyfile!
6009817466cbSJens Wiklander
6010817466cbSJens WiklanderBugfix
6011817466cbSJens Wiklander   * Debug output of MPI's now the same independent of underlying
6012817466cbSJens Wiklander     platform (32-bit / 64-bit) (Fixes ticket #19, found by Mads
6013817466cbSJens Wiklander     Kiilerich and Mihai Militaru)
6014817466cbSJens Wiklander   * Fixed bug in ssl_write() when flushing old data (Fixed ticket
6015817466cbSJens Wiklander     #18, found by Nikolay Epifanov)
6016817466cbSJens Wiklander   * Fixed proper handling of RSASSA-PSS verification with variable
6017817466cbSJens Wiklander     length salt lengths
6018817466cbSJens Wiklander
6019817466cbSJens Wiklander= Version 0.99-pre3 released on 2011-02-28
6020817466cbSJens WiklanderThis release replaces version 0.99-pre2 which had possible copyright issues.
6021817466cbSJens WiklanderFeatures
6022817466cbSJens Wiklander   * Parsing PEM private keys encrypted with DES and AES
6023817466cbSJens Wiklander     are now supported as well (Fixes ticket #5)
6024817466cbSJens Wiklander   * Added crl_app program to allow easy reading and
6025817466cbSJens Wiklander     printing of X509 CRLs from file
6026817466cbSJens Wiklander
6027817466cbSJens WiklanderChanges
6028817466cbSJens Wiklander   * Parsing of PEM files moved to separate module (Fixes
6029817466cbSJens Wiklander     ticket #13). Also possible to remove PEM support for
6030817466cbSJens Wiklander     systems only using DER encoding
6031817466cbSJens Wiklander
6032817466cbSJens WiklanderBugfixes
6033817466cbSJens Wiklander   * Corrected parsing of UTCTime dates before 1990 and
6034817466cbSJens Wiklander     after 1950
6035817466cbSJens Wiklander   * Support more exotic OID's when parsing certificates
6036817466cbSJens Wiklander     (found by Mads Kiilerich)
6037817466cbSJens Wiklander   * Support more exotic name representations when parsing
6038817466cbSJens Wiklander     certificates (found by Mads Kiilerich)
6039817466cbSJens Wiklander   * Replaced the expired test certificates
6040817466cbSJens Wiklander   * Do not bail out if no client certificate specified. Try
6041817466cbSJens Wiklander     to negotiate anonymous connection (Fixes ticket #12,
6042817466cbSJens Wiklander     found by Boris Krasnovskiy)
6043817466cbSJens Wiklander
6044817466cbSJens WiklanderSecurity fixes
6045817466cbSJens Wiklander   * Fixed a possible Man-in-the-Middle attack on the
6046817466cbSJens Wiklander     Diffie Hellman key exchange (thanks to Larry Highsmith,
6047817466cbSJens Wiklander     Subreption LLC)
6048817466cbSJens Wiklander
6049817466cbSJens Wiklander= Version 0.99-pre1 released on 2011-01-30
6050817466cbSJens WiklanderFeatures
6051817466cbSJens WiklanderNote: Most of these features have been donated by Fox-IT
6052817466cbSJens Wiklander   * Added Doxygen source code documentation parts
6053817466cbSJens Wiklander   * Added reading of DHM context from memory and file
6054817466cbSJens Wiklander   * Improved X509 certificate parsing to include extended
6055817466cbSJens Wiklander     certificate fields, including Key Usage
6056817466cbSJens Wiklander   * Improved certificate verification and verification
6057817466cbSJens Wiklander     against the available CRLs
6058817466cbSJens Wiklander   * Detection for DES weak keys and parity bits added
6059817466cbSJens Wiklander   * Improvements to support integration in other
6060817466cbSJens Wiklander     applications:
6061817466cbSJens Wiklander       + Added generic message digest and cipher wrapper
6062817466cbSJens Wiklander       + Improved information about current capabilities,
6063817466cbSJens Wiklander         status, objects and configuration
6064817466cbSJens Wiklander       + Added verification callback on certificate chain
6065817466cbSJens Wiklander         verification to allow external blacklisting
6066817466cbSJens Wiklander       + Additional example programs to show usage
6067817466cbSJens Wiklander   * Added support for PKCS#11 through the use of the
6068817466cbSJens Wiklander     libpkcs11-helper library
6069817466cbSJens Wiklander
6070817466cbSJens WiklanderChanges
6071817466cbSJens Wiklander   * x509parse_time_expired() checks time in addition to
6072817466cbSJens Wiklander     the existing date check
6073817466cbSJens Wiklander   * The ciphers member of ssl_context and the cipher member
6074817466cbSJens Wiklander     of ssl_session have been renamed to ciphersuites and
6075817466cbSJens Wiklander     ciphersuite respectively. This clarifies the difference
6076817466cbSJens Wiklander     with the generic cipher layer and is better naming
6077817466cbSJens Wiklander     altogether
6078817466cbSJens Wiklander
6079817466cbSJens Wiklander= Version 0.14.0 released on 2010-08-16
6080817466cbSJens WiklanderFeatures
6081817466cbSJens Wiklander   * Added support for SSL_EDH_RSA_AES_128_SHA and
6082817466cbSJens Wiklander     SSL_EDH_RSA_CAMELLIA_128_SHA ciphersuites
6083817466cbSJens Wiklander   * Added compile-time and run-time version information
6084817466cbSJens Wiklander   * Expanded ssl_client2 arguments for more flexibility
6085817466cbSJens Wiklander   * Added support for TLS v1.1
6086817466cbSJens Wiklander
6087817466cbSJens WiklanderChanges
6088817466cbSJens Wiklander   * Made Makefile cleaner
6089817466cbSJens Wiklander   * Removed dependency on rand() in rsa_pkcs1_encrypt().
6090817466cbSJens Wiklander     Now using random fuction provided to function and
6091817466cbSJens Wiklander     changed the prototype of rsa_pkcs1_encrypt(),
6092817466cbSJens Wiklander     rsa_init() and rsa_gen_key().
6093817466cbSJens Wiklander   * Some SSL defines were renamed in order to avoid
6094817466cbSJens Wiklander     future confusion
6095817466cbSJens Wiklander
6096817466cbSJens WiklanderBug fixes
6097817466cbSJens Wiklander   * Fixed CMake out of source build for tests (found by
6098817466cbSJens Wiklander     kkert)
6099817466cbSJens Wiklander   * rsa_check_private() now supports PKCS1v2 keys as well
6100817466cbSJens Wiklander   * Fixed deadlock in rsa_pkcs1_encrypt() on failing random
6101817466cbSJens Wiklander     generator
6102817466cbSJens Wiklander
6103817466cbSJens Wiklander= Version 0.13.1 released on 2010-03-24
6104817466cbSJens WiklanderBug fixes
6105817466cbSJens Wiklander   * Fixed Makefile in library that was mistakenly merged
6106817466cbSJens Wiklander   * Added missing const string fixes
6107817466cbSJens Wiklander
6108817466cbSJens Wiklander= Version 0.13.0 released on 2010-03-21
6109817466cbSJens WiklanderFeatures
6110817466cbSJens Wiklander   * Added option parsing for host and port selection to
6111817466cbSJens Wiklander     ssl_client2
6112817466cbSJens Wiklander   * Added support for GeneralizedTime in X509 parsing
6113817466cbSJens Wiklander   * Added cert_app program to allow easy reading and
6114817466cbSJens Wiklander     printing of X509 certificates from file or SSL
6115817466cbSJens Wiklander     connection.
6116817466cbSJens Wiklander
6117817466cbSJens WiklanderChanges
6118817466cbSJens Wiklander   * Added const correctness for main code base
6119817466cbSJens Wiklander   * X509 signature algorithm determination is now
6120817466cbSJens Wiklander     in a function to allow easy future expansion
6121817466cbSJens Wiklander   * Changed symmetric cipher functions to
6122817466cbSJens Wiklander     identical interface (returning int result values)
6123817466cbSJens Wiklander   * Changed ARC4 to use separate input/output buffer
6124817466cbSJens Wiklander   * Added reset function for HMAC context as speed-up
6125817466cbSJens Wiklander     for specific use-cases
6126817466cbSJens Wiklander
6127817466cbSJens WiklanderBug fixes
6128817466cbSJens Wiklander   * Fixed bug resulting in failure to send the last
6129817466cbSJens Wiklander     certificate in the chain in ssl_write_certificate() and
6130817466cbSJens Wiklander     ssl_write_certificate_request() (found by fatbob)
6131817466cbSJens Wiklander   * Added small fixes for compiler warnings on a Mac
6132817466cbSJens Wiklander     (found by Frank de Brabander)
6133817466cbSJens Wiklander   * Fixed algorithmic bug in mpi_is_prime() (found by
6134817466cbSJens Wiklander     Smbat Tonoyan)
6135817466cbSJens Wiklander
6136817466cbSJens Wiklander= Version 0.12.1 released on 2009-10-04
6137817466cbSJens WiklanderChanges
6138817466cbSJens Wiklander   * Coverage test definitions now support 'depends_on'
6139817466cbSJens Wiklander     tagging system.
6140817466cbSJens Wiklander   * Tests requiring specific hashing algorithms now honor
6141817466cbSJens Wiklander     the defines.
6142817466cbSJens Wiklander
6143817466cbSJens WiklanderBug fixes
6144817466cbSJens Wiklander   * Changed typo in #ifdef in x509parse.c (found
6145817466cbSJens Wiklander     by Eduardo)
6146817466cbSJens Wiklander
6147817466cbSJens Wiklander= Version 0.12.0 released on 2009-07-28
6148817466cbSJens WiklanderFeatures
6149817466cbSJens Wiklander   * Added CMake makefiles as alternative to regular Makefiles.
6150817466cbSJens Wiklander   * Added preliminary Code Coverage tests for AES, ARC4,
6151817466cbSJens Wiklander     Base64, MPI, SHA-family, MD-family, HMAC-SHA-family,
6152817466cbSJens Wiklander     Camellia, DES, 3-DES, RSA PKCS#1, XTEA, Diffie-Hellman
6153817466cbSJens Wiklander     and X509parse.
6154817466cbSJens Wiklander
6155817466cbSJens WiklanderChanges
6156817466cbSJens Wiklander   * Error codes are not (necessarily) negative. Keep
6157817466cbSJens Wiklander     this is mind when checking for errors.
6158817466cbSJens Wiklander   * RSA_RAW renamed to SIG_RSA_RAW for consistency.
6159817466cbSJens Wiklander   * Fixed typo in name of POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE.
6160817466cbSJens Wiklander   * Changed interface for AES and Camellia setkey functions
6161817466cbSJens Wiklander     to indicate invalid key lengths.
6162817466cbSJens Wiklander
6163817466cbSJens WiklanderBug fixes
6164817466cbSJens Wiklander   * Fixed include location of endian.h on FreeBSD (found by
6165817466cbSJens Wiklander     Gabriel)
6166817466cbSJens Wiklander   * Fixed include location of endian.h and name clash on
6167817466cbSJens Wiklander     Apples (found by Martin van Hensbergen)
6168817466cbSJens Wiklander   * Fixed HMAC-MD2 by modifying md2_starts(), so that the
6169817466cbSJens Wiklander     required HMAC ipad and opad variables are not cleared.
6170817466cbSJens Wiklander     (found by code coverage tests)
6171817466cbSJens Wiklander   * Prevented use of long long in bignum if
6172817466cbSJens Wiklander     POLARSSL_HAVE_LONGLONG not defined (found by Giles
6173817466cbSJens Wiklander     Bathgate).
6174817466cbSJens Wiklander   * Fixed incorrect handling of negative strings in
6175817466cbSJens Wiklander     mpi_read_string() (found by code coverage tests).
6176817466cbSJens Wiklander   * Fixed segfault on handling empty rsa_context in
6177817466cbSJens Wiklander     rsa_check_pubkey() and rsa_check_privkey() (found by
6178817466cbSJens Wiklander     code coverage tests).
6179817466cbSJens Wiklander   * Fixed incorrect handling of one single negative input
6180817466cbSJens Wiklander     value in mpi_add_abs() (found by code coverage tests).
6181817466cbSJens Wiklander   * Fixed incorrect handling of negative first input
6182817466cbSJens Wiklander     value in mpi_sub_abs() (found by code coverage tests).
6183817466cbSJens Wiklander   * Fixed incorrect handling of negative first input
6184817466cbSJens Wiklander     value in mpi_mod_mpi() and mpi_mod_int(). Resulting
6185817466cbSJens Wiklander     change also affects mpi_write_string() (found by code
6186817466cbSJens Wiklander     coverage tests).
6187817466cbSJens Wiklander   * Corrected is_prime() results for 0, 1 and 2 (found by
6188817466cbSJens Wiklander     code coverage tests).
6189817466cbSJens Wiklander   * Fixed Camellia and XTEA for 64-bit Windows systems.
6190817466cbSJens Wiklander
6191817466cbSJens Wiklander= Version 0.11.1 released on 2009-05-17
6192817466cbSJens Wiklander   * Fixed missing functionality for SHA-224, SHA-256, SHA384,
6193817466cbSJens Wiklander     SHA-512 in rsa_pkcs1_sign()
6194817466cbSJens Wiklander
6195817466cbSJens Wiklander= Version 0.11.0 released on 2009-05-03
6196817466cbSJens Wiklander   * Fixed a bug in mpi_gcd() so that it also works when both
6197817466cbSJens Wiklander     input numbers are even and added testcases to check
6198817466cbSJens Wiklander     (found by Pierre Habouzit).
6199817466cbSJens Wiklander   * Added support for SHA-224, SHA-256, SHA-384 and SHA-512
6200817466cbSJens Wiklander     one way hash functions with the PKCS#1 v1.5 signing and
6201817466cbSJens Wiklander     verification.
6202817466cbSJens Wiklander   * Fixed minor bug regarding mpi_gcd located within the
6203817466cbSJens Wiklander     POLARSSL_GENPRIME block.
6204817466cbSJens Wiklander   * Fixed minor memory leak in x509parse_crt() and added better
6205817466cbSJens Wiklander     handling of 'full' certificate chains (found by Mathias
6206817466cbSJens Wiklander     Olsson).
6207817466cbSJens Wiklander   * Centralized file opening and reading for x509 files into
6208817466cbSJens Wiklander     load_file()
6209817466cbSJens Wiklander   * Made definition of net_htons() endian-clean for big endian
6210817466cbSJens Wiklander     systems (Found by Gernot).
6211817466cbSJens Wiklander   * Undefining POLARSSL_HAVE_ASM now also handles prevents asm in
6212817466cbSJens Wiklander     padlock and timing code.
6213817466cbSJens Wiklander   * Fixed an off-by-one buffer allocation in ssl_set_hostname()
6214817466cbSJens Wiklander     responsible for crashes and unwanted behaviour.
6215817466cbSJens Wiklander   * Added support for Certificate Revocation List (CRL) parsing.
6216817466cbSJens Wiklander   * Added support for CRL revocation to x509parse_verify() and
6217817466cbSJens Wiklander     SSL/TLS code.
6218817466cbSJens Wiklander   * Fixed compatibility of XTEA and Camellia on a 64-bit system
6219817466cbSJens Wiklander     (found by Felix von Leitner).
6220817466cbSJens Wiklander
6221817466cbSJens Wiklander= Version 0.10.0 released on 2009-01-12
6222817466cbSJens Wiklander   * Migrated XySSL to PolarSSL
6223817466cbSJens Wiklander   * Added XTEA symmetric cipher
6224817466cbSJens Wiklander   * Added Camellia symmetric cipher
6225817466cbSJens Wiklander   * Added support for ciphersuites: SSL_RSA_CAMELLIA_128_SHA,
6226817466cbSJens Wiklander     SSL_RSA_CAMELLIA_256_SHA and SSL_EDH_RSA_CAMELLIA_256_SHA
6227817466cbSJens Wiklander   * Fixed dangerous bug that can cause a heap overflow in
6228817466cbSJens Wiklander     rsa_pkcs1_decrypt (found by Christophe Devine)
6229817466cbSJens Wiklander
6230817466cbSJens Wiklander================================================================
6231817466cbSJens WiklanderXySSL ChangeLog
6232817466cbSJens Wiklander
6233817466cbSJens Wiklander= Version 0.9 released on 2008-03-16
6234817466cbSJens Wiklander
6235817466cbSJens Wiklander    * Added support for ciphersuite: SSL_RSA_AES_128_SHA
6236817466cbSJens Wiklander    * Enabled support for large files by default in aescrypt2.c
6237817466cbSJens Wiklander    * Preliminary openssl wrapper contributed by David Barrett
6238817466cbSJens Wiklander    * Fixed a bug in ssl_write() that caused the same payload to
6239817466cbSJens Wiklander      be sent twice in non-blocking mode when send returns EAGAIN
6240817466cbSJens Wiklander    * Fixed ssl_parse_client_hello(): session id and challenge must
6241817466cbSJens Wiklander      not be swapped in the SSLv2 ClientHello (found by Greg Robson)
6242817466cbSJens Wiklander    * Added user-defined callback debug function (Krystian Kolodziej)
6243817466cbSJens Wiklander    * Before freeing a certificate, properly zero out all cert. data
6244817466cbSJens Wiklander    * Fixed the "mode" parameter so that encryption/decryption are
6245817466cbSJens Wiklander      not swapped on PadLock; also fixed compilation on older versions
6246817466cbSJens Wiklander      of gcc (bug reported by David Barrett)
6247817466cbSJens Wiklander    * Correctly handle the case in padlock_xcryptcbc() when input or
62485b25c76aSJerome Forissier      output data is non-aligned by falling back to the software
6249817466cbSJens Wiklander      implementation, as VIA Nehemiah cannot handle non-aligned buffers
6250817466cbSJens Wiklander    * Fixed a memory leak in x509parse_crt() which was reported by Greg
6251817466cbSJens Wiklander      Robson-Garth; some x509write.c fixes by Pascal Vizeli, thanks to
6252817466cbSJens Wiklander      Matthew Page who reported several bugs
6253817466cbSJens Wiklander    * Fixed x509_get_ext() to accept some rare certificates which have
6254817466cbSJens Wiklander      an INTEGER instead of a BOOLEAN for BasicConstraints::cA.
6255817466cbSJens Wiklander    * Added support on the client side for the TLS "hostname" extension
6256817466cbSJens Wiklander      (patch contributed by David Patino)
6257817466cbSJens Wiklander    * Make x509parse_verify() return BADCERT_CN_MISMATCH when an empty
6258817466cbSJens Wiklander      string is passed as the CN (bug reported by spoofy)
6259817466cbSJens Wiklander    * Added an option to enable/disable the BN assembly code
6260817466cbSJens Wiklander    * Updated rsa_check_privkey() to verify that (D*E) = 1 % (P-1)*(Q-1)
6261817466cbSJens Wiklander    * Disabled obsolete hash functions by default (MD2, MD4); updated
6262817466cbSJens Wiklander      selftest and benchmark to not test ciphers that have been disabled
6263817466cbSJens Wiklander    * Updated x509parse_cert_info() to correctly display byte 0 of the
6264817466cbSJens Wiklander      serial number, setup correct server port in the ssl client example
6265817466cbSJens Wiklander    * Fixed a critical denial-of-service with X.509 cert. verification:
6266817466cbSJens Wiklander      peer may cause xyssl to loop indefinitely by sending a certificate
6267817466cbSJens Wiklander      for which the RSA signature check fails (bug reported by Benoit)
6268817466cbSJens Wiklander    * Added test vectors for: AES-CBC, AES-CFB, DES-CBC and 3DES-CBC,
6269817466cbSJens Wiklander      HMAC-MD5, HMAC-SHA1, HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512
6270817466cbSJens Wiklander    * Fixed HMAC-SHA-384 and HMAC-SHA-512 (thanks to Josh Sinykin)
6271817466cbSJens Wiklander    * Modified ssl_parse_client_key_exchange() to protect against
6272817466cbSJens Wiklander      Daniel Bleichenbacher attack on PKCS#1 v1.5 padding, as well
6273817466cbSJens Wiklander      as the Klima-Pokorny-Rosa extension of Bleichenbacher's attack
6274817466cbSJens Wiklander    * Updated rsa_gen_key() so that ctx->N is always nbits in size
6275817466cbSJens Wiklander    * Fixed assembly PPC compilation errors on Mac OS X, thanks to
6276817466cbSJens Wiklander      David Barrett and Dusan Semen
6277817466cbSJens Wiklander
6278817466cbSJens Wiklander= Version 0.8 released on 2007-10-20
6279817466cbSJens Wiklander
6280817466cbSJens Wiklander    * Modified the HMAC functions to handle keys larger
6281817466cbSJens Wiklander      than 64 bytes, thanks to Stephane Desneux and gary ng
6282817466cbSJens Wiklander    * Fixed ssl_read_record() to properly update the handshake
6283817466cbSJens Wiklander      message digests, which fixes IE6/IE7 client authentication
6284817466cbSJens Wiklander    * Cleaned up the XYSSL* #defines, suggested by Azriel Fasten
6285817466cbSJens Wiklander    * Fixed net_recv(), thanks to Lorenz Schori and Egon Kocjan
6286817466cbSJens Wiklander    * Added user-defined callbacks for handling I/O and sessions
6287817466cbSJens Wiklander    * Added lots of debugging output in the SSL/TLS functions
6288817466cbSJens Wiklander    * Added preliminary X.509 cert. writing by Pascal Vizeli
6289817466cbSJens Wiklander    * Added preliminary support for the VIA PadLock routines
6290817466cbSJens Wiklander    * Added AES-CFB mode of operation, contributed by chmike
6291817466cbSJens Wiklander    * Added an SSL/TLS stress testing program (ssl_test.c)
6292817466cbSJens Wiklander    * Updated the RSA PKCS#1 code to allow choosing between
6293817466cbSJens Wiklander      RSA_PUBLIC and RSA_PRIVATE, as suggested by David Barrett
6294817466cbSJens Wiklander    * Updated ssl_read() to skip 0-length records from OpenSSL
6295817466cbSJens Wiklander    * Fixed the make install target to comply with *BSD make
6296817466cbSJens Wiklander    * Fixed a bug in mpi_read_binary() on 64-bit platforms
6297817466cbSJens Wiklander    * mpi_is_prime() speedups, thanks to Kevin McLaughlin
6298817466cbSJens Wiklander    * Fixed a long standing memory leak in mpi_is_prime()
6299817466cbSJens Wiklander    * Replaced realloc with malloc in mpi_grow(), and set
6300817466cbSJens Wiklander      the sign of zero as positive in mpi_init() (reported
6301817466cbSJens Wiklander      by Jonathan M. McCune)
6302817466cbSJens Wiklander
6303817466cbSJens Wiklander= Version 0.7 released on 2007-07-07
6304817466cbSJens Wiklander
6305817466cbSJens Wiklander    * Added support for the MicroBlaze soft-core processor
6306817466cbSJens Wiklander    * Fixed a bug in ssl_tls.c which sometimes prevented SSL
6307817466cbSJens Wiklander      connections from being established with non-blocking I/O
6308817466cbSJens Wiklander    * Fixed a couple bugs in the VS6 and UNIX Makefiles
6309817466cbSJens Wiklander    * Fixed the "PIC register ebx clobbered in asm" bug
6310817466cbSJens Wiklander    * Added HMAC starts/update/finish support functions
6311817466cbSJens Wiklander    * Added the SHA-224, SHA-384 and SHA-512 hash functions
6312817466cbSJens Wiklander    * Fixed the net_set_*block routines, thanks to Andreas
6313817466cbSJens Wiklander    * Added a few demonstration programs: md5sum, sha1sum,
6314817466cbSJens Wiklander      dh_client, dh_server, rsa_genkey, rsa_sign, rsa_verify
6315817466cbSJens Wiklander    * Added new bignum import and export helper functions
6316817466cbSJens Wiklander    * Rewrote README.txt in program/ssl/ca to better explain
6317817466cbSJens Wiklander      how to create a test PKI
6318817466cbSJens Wiklander
6319817466cbSJens Wiklander= Version 0.6 released on 2007-04-01
6320817466cbSJens Wiklander
6321817466cbSJens Wiklander    * Ciphers used in SSL/TLS can now be disabled at compile
6322817466cbSJens Wiklander      time, to reduce the memory footprint on embedded systems
6323817466cbSJens Wiklander    * Added multiply assembly code for the TriCore and modified
6324817466cbSJens Wiklander      havege_struct for this processor, thanks to David Patiño
6325817466cbSJens Wiklander    * Added multiply assembly code for 64-bit PowerPCs,
6326817466cbSJens Wiklander      thanks to Peking University and the OSU Open Source Lab
6327817466cbSJens Wiklander    * Added experimental support of Quantum Cryptography
6328817466cbSJens Wiklander    * Added support for autoconf, contributed by Arnaud Cornet
6329817466cbSJens Wiklander    * Fixed "long long" compilation issues on IA-64 and PPC64
6330817466cbSJens Wiklander    * Fixed a bug introduced in xyssl-0.5/timing.c: hardclock
6331817466cbSJens Wiklander      was not being correctly defined on ARM and MIPS
6332817466cbSJens Wiklander
6333817466cbSJens Wiklander= Version 0.5 released on 2007-03-01
6334817466cbSJens Wiklander
6335817466cbSJens Wiklander    * Added multiply assembly code for SPARC and Alpha
6336817466cbSJens Wiklander    * Added (beta) support for non-blocking I/O operations
6337817466cbSJens Wiklander    * Implemented session resuming and client authentication
6338817466cbSJens Wiklander    * Fixed some portability issues on WinCE, MINIX 3, Plan9
6339817466cbSJens Wiklander      (thanks to Benjamin Newman), HP-UX, FreeBSD and Solaris
6340817466cbSJens Wiklander    * Improved the performance of the EDH key exchange
6341817466cbSJens Wiklander    * Fixed a bug that caused valid packets with a payload
6342817466cbSJens Wiklander      size of 16384 bytes to be rejected
6343817466cbSJens Wiklander
6344817466cbSJens Wiklander= Version 0.4 released on 2007-02-01
6345817466cbSJens Wiklander
6346817466cbSJens Wiklander    * Added support for Ephemeral Diffie-Hellman key exchange
6347817466cbSJens Wiklander    * Added multiply asm code for SSE2, ARM, PPC, MIPS and M68K
6348817466cbSJens Wiklander    * Various improvement to the modular exponentiation code
6349817466cbSJens Wiklander    * Rewrote the headers to generate the API docs with doxygen
6350817466cbSJens Wiklander    * Fixed a bug in ssl_encrypt_buf (incorrect padding was
6351817466cbSJens Wiklander      generated) and in ssl_parse_client_hello (max. client
6352817466cbSJens Wiklander      version was not properly set), thanks to Didier Rebeix
6353817466cbSJens Wiklander    * Fixed another bug in ssl_parse_client_hello: clients with
6354817466cbSJens Wiklander      cipherlists larger than 96 bytes were incorrectly rejected
6355817466cbSJens Wiklander    * Fixed a couple memory leak in x509_read.c
6356817466cbSJens Wiklander
6357817466cbSJens Wiklander= Version 0.3 released on 2007-01-01
6358817466cbSJens Wiklander
6359817466cbSJens Wiklander    * Added server-side SSLv3 and TLSv1.0 support
6360817466cbSJens Wiklander    * Multiple fixes to enhance the compatibility with g++,
6361817466cbSJens Wiklander      thanks to Xosé Antón Otero Ferreira
6362817466cbSJens Wiklander    * Fixed a bug in the CBC code, thanks to dowst; also,
6363817466cbSJens Wiklander      the bignum code is no longer dependent on long long
6364817466cbSJens Wiklander    * Updated rsa_pkcs1_sign to handle arbitrary large inputs
6365817466cbSJens Wiklander    * Updated timing.c for improved compatibility with i386
6366817466cbSJens Wiklander      and 486 processors, thanks to Arnaud Cornet
6367817466cbSJens Wiklander
6368817466cbSJens Wiklander= Version 0.2 released on 2006-12-01
6369817466cbSJens Wiklander
6370817466cbSJens Wiklander    * Updated timing.c to support ARM and MIPS arch
6371817466cbSJens Wiklander    * Updated the MPI code to support 8086 on MSVC 1.5
6372817466cbSJens Wiklander    * Added the copyright notice at the top of havege.h
6373817466cbSJens Wiklander    * Fixed a bug in sha2_hmac, thanks to newsoft/Wenfang Zhang
6374817466cbSJens Wiklander    * Fixed a bug reported by Adrian Rüegsegger in x509_read_key
6375817466cbSJens Wiklander    * Fixed a bug reported by Torsten Lauter in ssl_read_record
6376817466cbSJens Wiklander    * Fixed a bug in rsa_check_privkey that would wrongly cause
6377817466cbSJens Wiklander      valid RSA keys to be dismissed (thanks to oldwolf)
6378817466cbSJens Wiklander    * Fixed a bug in mpi_is_prime that caused some primes to fail
6379817466cbSJens Wiklander      the Miller-Rabin primality test
6380817466cbSJens Wiklander
6381817466cbSJens Wiklander    I'd also like to thank Younès Hafri for the CRUX linux port,
6382817466cbSJens Wiklander    Khalil Petit who added XySSL into pkgsrc and Arnaud Cornet
6383817466cbSJens Wiklander    who maintains the Debian package :-)
6384817466cbSJens Wiklander
6385817466cbSJens Wiklander= Version 0.1 released on 2006-11-01
6386