xref: /third_party/mbedtls/ChangeLog (revision a8e1175b)
1a8e1175bSopenharmony_ciMbed TLS ChangeLog (Sorted per branch, date)
2a8e1175bSopenharmony_ci
3a8e1175bSopenharmony_ci= Mbed TLS 3.6.0 branch released 2024-03-28
4a8e1175bSopenharmony_ci
5a8e1175bSopenharmony_ciAPI changes
6a8e1175bSopenharmony_ci   * Remove `tls13_` in mbedtls_ssl_tls13_conf_early_data() and
7a8e1175bSopenharmony_ci     mbedtls_ssl_tls13_conf_max_early_data_size() API names. Early data
8a8e1175bSopenharmony_ci     feature may not be TLS 1.3 specific in the future. Fixes #6909.
9a8e1175bSopenharmony_ci
10a8e1175bSopenharmony_ciDefault behavior changes
11a8e1175bSopenharmony_ci   * psa_import_key() now only accepts RSA keys in the PSA standard formats.
12a8e1175bSopenharmony_ci     The undocumented ability to import other formats (PKCS#8, SubjectPublicKey,
13a8e1175bSopenharmony_ci     PEM) accepted by the pkparse module has been removed. Applications that
14a8e1175bSopenharmony_ci     need these formats can call mbedtls_pk_parse_{public,}key() followed by
15a8e1175bSopenharmony_ci     mbedtls_pk_import_into_psa().
16a8e1175bSopenharmony_ci
17a8e1175bSopenharmony_ciRequirement changes
18a8e1175bSopenharmony_ci   * Drop support for Visual Studio 2013 and 2015, and Arm Compiler 5.
19a8e1175bSopenharmony_ci
20a8e1175bSopenharmony_ciNew deprecations
21a8e1175bSopenharmony_ci   * Rename the MBEDTLS_SHA256_USE_A64_CRYPTO_xxx config options to
22a8e1175bSopenharmony_ci     MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_xxx. The old names may still
23a8e1175bSopenharmony_ci     be used, but are deprecated.
24a8e1175bSopenharmony_ci   * In the PSA API, domain parameters are no longer used for anything.
25a8e1175bSopenharmony_ci     They are deprecated and will be removed in a future version of the
26a8e1175bSopenharmony_ci     library.
27a8e1175bSopenharmony_ci   * mbedtls_ecp_write_key() is deprecated in favor of
28a8e1175bSopenharmony_ci     mbedtls_ecp_write_key_ext().
29a8e1175bSopenharmony_ci
30a8e1175bSopenharmony_ciRemovals
31a8e1175bSopenharmony_ci   * In the PSA API, the experimental way to encode the public exponent of
32a8e1175bSopenharmony_ci     an RSA key as a domain parameter is no longer supported. Use
33a8e1175bSopenharmony_ci     psa_generate_key_ext() instead.
34a8e1175bSopenharmony_ci   * Temporary function mbedtls_pk_wrap_as_opaque() is removed. To mimic the
35a8e1175bSopenharmony_ci     same behavior mbedtls_pk_get_psa_attributes() and
36a8e1175bSopenharmony_ci     mbedtls_pk_import_into_psa() can be used to import a PK key into PSA,
37a8e1175bSopenharmony_ci     while mbedtls_pk_setup_opaque() can be used to wrap a PSA key into a opaque
38a8e1175bSopenharmony_ci     PK context.
39a8e1175bSopenharmony_ci
40a8e1175bSopenharmony_ciFeatures
41a8e1175bSopenharmony_ci   * Added an example program showing how to hash with the PSA API.
42a8e1175bSopenharmony_ci   * Support Armv8-A Crypto Extension acceleration for SHA-256
43a8e1175bSopenharmony_ci     when compiling for Thumb (T32) or 32-bit Arm (A32).
44a8e1175bSopenharmony_ci   * AES-NI is now supported in Windows builds with clang and clang-cl.
45a8e1175bSopenharmony_ci     Resolves #8372.
46a8e1175bSopenharmony_ci   * Add new mbedtls_x509_csr_parse_der_with_ext_cb() routine which allows
47a8e1175bSopenharmony_ci     parsing unsupported certificate extensions via user provided callback.
48a8e1175bSopenharmony_ci   * Enable the new option MBEDTLS_BLOCK_CIPHER_NO_DECRYPT to omit
49a8e1175bSopenharmony_ci     the decryption direction of block ciphers (AES, ARIA, Camellia).
50a8e1175bSopenharmony_ci     This affects both the low-level modules and the high-level APIs
51a8e1175bSopenharmony_ci     (the cipher and PSA interfaces). This option is incompatible with modes
52a8e1175bSopenharmony_ci     that use the decryption direction (ECB in PSA, CBC, XTS, KW) and with DES.
53a8e1175bSopenharmony_ci   * Support use of Armv8-A Cryptographic Extensions for hardware acclerated
54a8e1175bSopenharmony_ci     AES when compiling for Thumb (T32) or 32-bit Arm (A32).
55a8e1175bSopenharmony_ci   * If a cipher or AEAD mechanism has a PSA driver, you can now build the
56a8e1175bSopenharmony_ci     library without the corresponding built-in implementation. Generally
57a8e1175bSopenharmony_ci     speaking that requires both the key type and algorithm to be accelerated
58a8e1175bSopenharmony_ci     or they'll both be built in. However, for CCM and GCM the built-in
59a8e1175bSopenharmony_ci     implementation is able to take advantage of a driver that only
60a8e1175bSopenharmony_ci     accelerates the key type (that is, the block cipher primitive). See
61a8e1175bSopenharmony_ci     docs/driver-only-builds.md for full details and current limitations.
62a8e1175bSopenharmony_ci   * The CTR_DRBG module will now use AES from a PSA driver if MBEDTLS_AES_C is
63a8e1175bSopenharmony_ci     disabled. This requires PSA_WANT_ALG_ECB_NO_PADDING in addition to
64a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_C and PSA_WANT_KEY_TYPE_AES.
65a8e1175bSopenharmony_ci   * Fewer modules depend on MBEDTLS_CIPHER_C, making it possible to save code
66a8e1175bSopenharmony_ci     size by disabling it in more circumstances. In particular, the CCM and
67a8e1175bSopenharmony_ci     GCM modules no longer depend on MBEDTLS_CIPHER_C. Also,
68a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO can now be enabled without MBEDTLS_CIPHER_C if all
69a8e1175bSopenharmony_ci     unauthenticated (non-AEAD) ciphers are disabled, or if they're all
70a8e1175bSopenharmony_ci     fully provided by drivers. See docs/driver-only-builds.md for full
71a8e1175bSopenharmony_ci     details and current limitations; in particular, NIST_KW and PKCS5/PKCS12
72a8e1175bSopenharmony_ci     decryption still unconditionally depend on MBEDTLS_CIPHER_C.
73a8e1175bSopenharmony_ci   * Add support for record size limit extension as defined by RFC 8449
74a8e1175bSopenharmony_ci     and configured with MBEDTLS_SSL_RECORD_SIZE_LIMIT.
75a8e1175bSopenharmony_ci     Application data sent and received will be fragmented according to
76a8e1175bSopenharmony_ci     Record size limits negotiated during handshake.
77a8e1175bSopenharmony_ci   * Improve performance of AES-GCM, AES-CTR and CTR-DRBG when
78a8e1175bSopenharmony_ci     hardware accelerated AES is not present (around 13-23% on 64-bit Arm).
79a8e1175bSopenharmony_ci   * Add functions mbedtls_ecc_group_to_psa() and mbedtls_ecc_group_from_psa()
80a8e1175bSopenharmony_ci     to convert between Mbed TLS and PSA curve identifiers.
81a8e1175bSopenharmony_ci   * Add utility functions to manipulate mbedtls_ecp_keypair objects, filling
82a8e1175bSopenharmony_ci     gaps made by making its fields private: mbedtls_ecp_set_public_key(),
83a8e1175bSopenharmony_ci     mbedtls_ecp_write_public_key(), mbedtls_ecp_keypair_calc_public(),
84a8e1175bSopenharmony_ci     mbedtls_ecp_keypair_get_group_id(). Fixes #5017, #5441, #8367, #8652.
85a8e1175bSopenharmony_ci   * Add functions mbedtls_md_psa_alg_from_type() and
86a8e1175bSopenharmony_ci     mbedtls_md_type_from_psa_alg() to convert between mbedtls_md_type_t and
87a8e1175bSopenharmony_ci     psa_algorithm_t.
88a8e1175bSopenharmony_ci   * Add partial platform support for z/OS.
89a8e1175bSopenharmony_ci   * Improve performance for gcc (versions older than 9.3.0) and IAR.
90a8e1175bSopenharmony_ci   * Add functions mbedtls_ecdsa_raw_to_der() and mbedtls_ecdsa_der_to_raw() to
91a8e1175bSopenharmony_ci     convert ECDSA signatures between raw and DER (ASN.1) formats.
92a8e1175bSopenharmony_ci   * Add support for using AES-CBC 128, 192, and 256 bit schemes
93a8e1175bSopenharmony_ci     with PKCS#5 PBES2. Keys encrypted this way can now be parsed by PK parse.
94a8e1175bSopenharmony_ci   * The new function mbedtls_rsa_get_bitlen() returns the length of the modulus
95a8e1175bSopenharmony_ci     in bits, i.e. the key size for an RSA key.
96a8e1175bSopenharmony_ci   * Add pc files for pkg-config, e.g.:
97a8e1175bSopenharmony_ci     pkg-config --cflags --libs (mbedtls|mbedcrypto|mbedx509)
98a8e1175bSopenharmony_ci   * Add getter (mbedtls_ssl_session_get_ticket_creation_time()) to access
99a8e1175bSopenharmony_ci     `mbedtls_ssl_session.ticket_creation_time`.
100a8e1175bSopenharmony_ci   * The new functions mbedtls_pk_get_psa_attributes() and
101a8e1175bSopenharmony_ci     mbedtls_pk_import_into_psa() provide a uniform way to create a PSA
102a8e1175bSopenharmony_ci     key from a PK key.
103a8e1175bSopenharmony_ci   * The benchmark program now reports times for both ephemeral and static
104a8e1175bSopenharmony_ci     ECDH in all ECDH configurations.
105a8e1175bSopenharmony_ci   * Add support for 8-bit GCM tables for Shoup's algorithm to speedup GCM
106a8e1175bSopenharmony_ci     operations when hardware accelerated AES is not present. Improves
107a8e1175bSopenharmony_ci     performance by around 30% on 64-bit Intel; 125% on Armv7-M.
108a8e1175bSopenharmony_ci   * The new function psa_generate_key_ext() allows generating an RSA
109a8e1175bSopenharmony_ci     key pair with a custom public exponent.
110a8e1175bSopenharmony_ci   * The new function mbedtls_ecp_write_key_ext() is similar to
111a8e1175bSopenharmony_ci     mbedtls_ecp_write_key(), but can be used without separately calculating
112a8e1175bSopenharmony_ci     the output length.
113a8e1175bSopenharmony_ci   * Add new accessor to expose the private group id member of
114a8e1175bSopenharmony_ci     `mbedtls_ecdh_context` structure.
115a8e1175bSopenharmony_ci   * Add new accessor to expose the `MBEDTLS_PRIVATE(ca_istrue)` member of
116a8e1175bSopenharmony_ci     `mbedtls_x509_crt` structure. This requires setting
117a8e1175bSopenharmony_ci     the MBEDTLS_X509_EXT_BASIC_CONSTRAINTS bit in the certificate's
118a8e1175bSopenharmony_ci     ext_types field.
119a8e1175bSopenharmony_ci   * mbedtls_psa_get_random() is always available as soon as
120a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_CLIENT is enabled at build time and psa_crypto_init() is
121a8e1175bSopenharmony_ci     called at runtime. This together with MBEDTLS_PSA_RANDOM_STATE can be
122a8e1175bSopenharmony_ci     used as random number generator function (f_rng) and context (p_rng) in
123a8e1175bSopenharmony_ci     legacy functions.
124a8e1175bSopenharmony_ci   * The new functions mbedtls_pk_copy_from_psa() and
125a8e1175bSopenharmony_ci     mbedtls_pk_copy_public_from_psa() provide ways to set up a PK context
126a8e1175bSopenharmony_ci     with the same content as a PSA key.
127a8e1175bSopenharmony_ci   * Add new accessors to expose the private session-id,
128a8e1175bSopenharmony_ci     session-id length, and ciphersuite-id members of
129a8e1175bSopenharmony_ci     `mbedtls_ssl_session` structure.
130a8e1175bSopenharmony_ci     Add new accessor to expose the ciphersuite-id of
131a8e1175bSopenharmony_ci     `mbedtls_ssl_ciphersuite_t` structure.Design ref: #8529
132a8e1175bSopenharmony_ci   * Mbed TLS now supports the writing and reading of TLS 1.3 early data (see
133a8e1175bSopenharmony_ci     docs/tls13-early-data.md). The support enablement is controlled at build
134a8e1175bSopenharmony_ci     time by the MBEDTLS_SSL_EARLY_DATA configuration option and at runtime by
135a8e1175bSopenharmony_ci     the mbedtls_ssl_conf_early_data() API (by default disabled in both cases).
136a8e1175bSopenharmony_ci   * Add protection for multithreaded access to the PSA keystore and protection
137a8e1175bSopenharmony_ci     for multithreaded access to the the PSA global state, including
138a8e1175bSopenharmony_ci     concurrently calling psa_crypto_init() when MBEDTLS_THREADING_C and
139a8e1175bSopenharmony_ci     MBEDTLS_THREADING_PTHREAD are defined. See
140a8e1175bSopenharmony_ci     docs/architecture/psa-thread-safety/psa-thread-safety.md for more details.
141a8e1175bSopenharmony_ci     Resolves issues #3263 and #7945.
142a8e1175bSopenharmony_ci
143a8e1175bSopenharmony_ciSecurity
144a8e1175bSopenharmony_ci   * Fix a stack buffer overread (less than 256 bytes) when parsing a TLS 1.3
145a8e1175bSopenharmony_ci     ClientHello in a TLS 1.3 server supporting some PSK key exchange mode. A
146a8e1175bSopenharmony_ci     malicious client could cause information disclosure or a denial of service.
147a8e1175bSopenharmony_ci   * Passing buffers that are stored in untrusted memory as arguments
148a8e1175bSopenharmony_ci     to PSA functions is now secure by default.
149a8e1175bSopenharmony_ci     The PSA core now protects against modification of inputs or exposure
150a8e1175bSopenharmony_ci     of intermediate outputs during operations. This is currently implemented
151a8e1175bSopenharmony_ci     by copying buffers.
152a8e1175bSopenharmony_ci     This feature increases code size and memory usage. If buffers passed to
153a8e1175bSopenharmony_ci     PSA functions are owned exclusively by the PSA core for the duration of
154a8e1175bSopenharmony_ci     the function call (i.e. no buffer parameters are in shared memory),
155a8e1175bSopenharmony_ci     copying may be disabled by setting MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS.
156a8e1175bSopenharmony_ci     Note that setting this option will cause input-output buffer overlap to
157a8e1175bSopenharmony_ci     be only partially supported (#3266).
158a8e1175bSopenharmony_ci     Fixes CVE-2024-28960.
159a8e1175bSopenharmony_ci   * Restore the maximum TLS version to be negotiated to the configured one
160a8e1175bSopenharmony_ci     when an SSL context is reset with the mbedtls_ssl_session_reset() API.
161a8e1175bSopenharmony_ci     An attacker was able to prevent an Mbed TLS server from establishing any
162a8e1175bSopenharmony_ci     TLS 1.3 connection potentially resulting in a Denial of Service or forced
163a8e1175bSopenharmony_ci     version downgrade from TLS 1.3 to TLS 1.2. Fixes #8654 reported by hey3e.
164a8e1175bSopenharmony_ci     Fixes CVE-2024-28755.
165a8e1175bSopenharmony_ci   * When negotiating TLS version on server side, do not fall back to the
166a8e1175bSopenharmony_ci     TLS 1.2 implementation of the protocol if it is disabled.
167a8e1175bSopenharmony_ci     - If the TLS 1.2 implementation was disabled at build time, a TLS 1.2
168a8e1175bSopenharmony_ci       client could put the TLS 1.3-only server in an infinite loop processing
169a8e1175bSopenharmony_ci       a TLS 1.2 ClientHello, resulting in a denial of service. Reported by
170a8e1175bSopenharmony_ci       Matthias Mucha and Thomas Blattmann, SICK AG.
171a8e1175bSopenharmony_ci     - If the TLS 1.2 implementation was disabled at runtime, a TLS 1.2 client
172a8e1175bSopenharmony_ci       was able to successfully establish a TLS 1.2 connection with the server.
173a8e1175bSopenharmony_ci       Reported by alluettiv on GitHub.
174a8e1175bSopenharmony_ci    Fixes CVE-2024-28836.
175a8e1175bSopenharmony_ci
176a8e1175bSopenharmony_ciBugfix
177a8e1175bSopenharmony_ci   * Fix the build with CMake when Everest or P256-m is enabled through
178a8e1175bSopenharmony_ci     a user configuration file or the compiler command line. Fixes #8165.
179a8e1175bSopenharmony_ci   * Fix compilation error in C++ programs when MBEDTLS_ASN1_PARSE_C is
180a8e1175bSopenharmony_ci     disabled.
181a8e1175bSopenharmony_ci   * Fix possible NULL dereference issue in X509 cert_req program if an entry
182a8e1175bSopenharmony_ci     in the san parameter is not separated by a colon.
183a8e1175bSopenharmony_ci   * Fix possible NULL dereference issue in X509 cert_write program if an entry
184a8e1175bSopenharmony_ci     in the san parameter is not separated by a colon.
185a8e1175bSopenharmony_ci   * Fix an inconsistency between implementations and usages of `__cpuid`,
186a8e1175bSopenharmony_ci     which mainly causes failures when building Windows target using
187a8e1175bSopenharmony_ci     mingw or clang. Fixes #8334 & #8332.
188a8e1175bSopenharmony_ci   * Fix build failure in conda-forge.  Fixes #8422.
189a8e1175bSopenharmony_ci   * Fix parsing of CSRs with critical extensions.
190a8e1175bSopenharmony_ci   * Switch to milliseconds as the unit for ticket creation and reception time
191a8e1175bSopenharmony_ci     instead of seconds. That avoids rounding errors when computing the age of
192a8e1175bSopenharmony_ci     tickets compared to peer using a millisecond clock (observed with GnuTLS).
193a8e1175bSopenharmony_ci     Fixes #6623.
194a8e1175bSopenharmony_ci   * Fix TLS server accepting TLS 1.2 handshake while TLS 1.2
195a8e1175bSopenharmony_ci     is disabled at runtime. Fixes #8593.
196a8e1175bSopenharmony_ci   * Remove accidental introduction of RSA signature algorithms
197a8e1175bSopenharmony_ci     in TLS Suite B Profile. Fixes #8221.
198a8e1175bSopenharmony_ci   * Fix unsupported PSA asymmetric encryption and decryption
199a8e1175bSopenharmony_ci     (psa_asymmetric_[en|de]crypt) with opaque keys.
200a8e1175bSopenharmony_ci     Resolves #8461.
201a8e1175bSopenharmony_ci   * On Linux on ARMv8, fix a build error with SHA-256 and SHA-512
202a8e1175bSopenharmony_ci     acceleration detection when the libc headers do not define the
203a8e1175bSopenharmony_ci     corresponding constant. Reported by valord577.
204a8e1175bSopenharmony_ci   * Correct initial capacities for key derivation algorithms:TLS12_PRF,
205a8e1175bSopenharmony_ci     TLS12_PSK_TO_MS, PBKDF2-HMAC, PBKDF2-CMAC
206a8e1175bSopenharmony_ci   * Fix mbedtls_pk_get_bitlen() for RSA keys whose size is not a
207a8e1175bSopenharmony_ci     multiple of 8. Fixes #868.
208a8e1175bSopenharmony_ci   * Avoid segmentation fault caused by releasing not initialized
209a8e1175bSopenharmony_ci     entropy resource in gen_key example. Fixes #8809.
210a8e1175bSopenharmony_ci   * mbedtls_pem_read_buffer() now performs a check on the padding data of
211a8e1175bSopenharmony_ci     decrypted keys and it rejects invalid ones.
212a8e1175bSopenharmony_ci   * Fix mbedtls_pk_sign(), mbedtls_pk_verify(), mbedtls_pk_decrypt() and
213a8e1175bSopenharmony_ci     mbedtls_pk_encrypt() on non-opaque RSA keys to honor the padding mode in
214a8e1175bSopenharmony_ci     the RSA context. Before, if MBEDTLS_USE_PSA_CRYPTO was enabled and the
215a8e1175bSopenharmony_ci     RSA context was configured for PKCS#1 v2.1 (PSS/OAEP), the sign/verify
216a8e1175bSopenharmony_ci     functions performed a PKCS#1 v1.5 signature instead and the
217a8e1175bSopenharmony_ci     encrypt/decrypt functions returned an error. Fixes #8824.
218a8e1175bSopenharmony_ci   * Fix missing bitflags in SSL session serialization headers. Their absence
219a8e1175bSopenharmony_ci     allowed SSL sessions saved in one configuration to be loaded in a
220a8e1175bSopenharmony_ci     different, incompatible configuration.
221a8e1175bSopenharmony_ci   * In TLS 1.3 clients, fix an interoperability problem due to the client
222a8e1175bSopenharmony_ci     generating a new random after a HelloRetryRequest. Fixes #8669.
223a8e1175bSopenharmony_ci   * Fix the restoration of the ALPN when loading serialized connection with
224a8e1175bSopenharmony_ci     the mbedtls_ssl_context_load() API.
225a8e1175bSopenharmony_ci   * Fix NULL pointer dereference in mbedtls_pk_verify_ext() when called using
226a8e1175bSopenharmony_ci     an opaque RSA context and specifying MBEDTLS_PK_RSASSA_PSS as key type.
227a8e1175bSopenharmony_ci   * Fix RSA opaque keys always using PKCS1 v1.5 algorithms instead of the
228a8e1175bSopenharmony_ci     primary algorithm of the wrapped PSA key.
229a8e1175bSopenharmony_ci   * Fully support arbitrary overlap between inputs and outputs of PSA
230a8e1175bSopenharmony_ci     functions. Note that overlap is still only partially supported when
231a8e1175bSopenharmony_ci     MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS is set (#3266).
232a8e1175bSopenharmony_ci
233a8e1175bSopenharmony_ciChanges
234a8e1175bSopenharmony_ci   * Use heap memory to allocate DER encoded public/private key.
235a8e1175bSopenharmony_ci     This reduces stack usage significantly for writing a public/private
236a8e1175bSopenharmony_ci     key to a PEM string.
237a8e1175bSopenharmony_ci   * PSA_WANT_ALG_CCM and PSA_WANT_ALG_CCM_STAR_NO_TAG are no more synonyms and
238a8e1175bSopenharmony_ci     they are now treated separately. This means that they should be
239a8e1175bSopenharmony_ci     individually enabled in order to enable respective support; also the
240a8e1175bSopenharmony_ci     corresponding MBEDTLS_PSA_ACCEL symbol should be defined in case
241a8e1175bSopenharmony_ci     acceleration is required.
242a8e1175bSopenharmony_ci   * Moved declaration of functions mbedtls_ecc_group_to_psa and
243a8e1175bSopenharmony_ci     mbedtls_ecc_group_of_psa from psa/crypto_extra.h to mbedtls/psa_util.h
244a8e1175bSopenharmony_ci   * mbedtls_pk_sign_ext() is now always available, not just when
245a8e1175bSopenharmony_ci     PSA (MBEDTLS_PSA_CRYPTO_C) is enabled.
246a8e1175bSopenharmony_ci   * Extended PSA Crypto configurations options for FFDH by making it possible
247a8e1175bSopenharmony_ci     to select only some of the parameters / groups, with the macros
248a8e1175bSopenharmony_ci     PSA_WANT_DH_RFC7919_XXXX. You now need to defined the corresponding macro
249a8e1175bSopenharmony_ci     for each size you want to support. Also, if you have an FFDH accelerator,
250a8e1175bSopenharmony_ci     you'll need to define the appropriate MBEDTLS_PSA_ACCEL macros to signal
251a8e1175bSopenharmony_ci     support for these domain parameters.
252a8e1175bSopenharmony_ci   * RSA support in PSA no longer auto-enables the pkparse and pkwrite modules,
253a8e1175bSopenharmony_ci     saving code size when those are not otherwise enabled.
254a8e1175bSopenharmony_ci   * mbedtls_mpi_exp_mod and code that uses it, notably RSA and DHM operations,
255a8e1175bSopenharmony_ci     have changed their speed/memory compromise as part of a proactive security
256a8e1175bSopenharmony_ci     improvement. The new default value of MBEDTLS_MPI_WINDOW_SIZE roughly
257a8e1175bSopenharmony_ci     preserves the current speed, at the expense of increasing memory
258a8e1175bSopenharmony_ci     consumption.
259a8e1175bSopenharmony_ci   * Rename directory containing Visual Studio files from visualc/VS2013 to
260a8e1175bSopenharmony_ci     visualc/VS2017.
261a8e1175bSopenharmony_ci   * The TLS 1.3 protocol is now enabled in the default configuration.
262a8e1175bSopenharmony_ci
263a8e1175bSopenharmony_ci= Mbed TLS 3.5.2 branch released 2024-01-26
264a8e1175bSopenharmony_ci
265a8e1175bSopenharmony_ciSecurity
266a8e1175bSopenharmony_ci   * Fix a timing side channel in private key RSA operations. This side channel
267a8e1175bSopenharmony_ci     could be sufficient for an attacker to recover the plaintext. A local
268a8e1175bSopenharmony_ci     attacker or a remote attacker who is close to the victim on the network
269a8e1175bSopenharmony_ci     might have precise enough timing measurements to exploit this. It requires
270a8e1175bSopenharmony_ci     the attacker to send a large number of messages for decryption. For
271a8e1175bSopenharmony_ci     details, see "Everlasting ROBOT: the Marvin Attack", Hubert Kario. Reported
272a8e1175bSopenharmony_ci     by Hubert Kario, Red Hat.
273a8e1175bSopenharmony_ci   * Fix a failure to validate input when writing x509 extensions lengths which
274a8e1175bSopenharmony_ci     could result in an integer overflow, causing a zero-length buffer to be
275a8e1175bSopenharmony_ci     allocated to hold the extension. The extension would then be copied into
276a8e1175bSopenharmony_ci     the buffer, causing a heap buffer overflow.
277a8e1175bSopenharmony_ci
278a8e1175bSopenharmony_ci= Mbed TLS 3.5.1 branch released 2023-11-06
279a8e1175bSopenharmony_ci
280a8e1175bSopenharmony_ciChanges
281a8e1175bSopenharmony_ci   *  Mbed TLS is now released under a dual Apache-2.0 OR GPL-2.0-or-later
282a8e1175bSopenharmony_ci      license. Users may choose which license they take the code under.
283a8e1175bSopenharmony_ci
284a8e1175bSopenharmony_ciBugfix
285a8e1175bSopenharmony_ci   * Fix accidental omission of MBEDTLS_TARGET_PREFIX in 3rdparty modules
286a8e1175bSopenharmony_ci     in CMake.
287a8e1175bSopenharmony_ci
288a8e1175bSopenharmony_ci= Mbed TLS 3.5.0 branch released 2023-10-05
289a8e1175bSopenharmony_ci
290a8e1175bSopenharmony_ciAPI changes
291a8e1175bSopenharmony_ci   * Mbed TLS 3.4 introduced support for omitting the built-in implementation
292a8e1175bSopenharmony_ci     of ECDSA and/or EC J-PAKE when those are provided by a driver. However,
293a8e1175bSopenharmony_ci     there was a flaw in the logic checking if the built-in implementation, in
294a8e1175bSopenharmony_ci     that it failed to check if all the relevant curves were supported by the
295a8e1175bSopenharmony_ci     accelerator. As a result, it was possible to declare no curves as
296a8e1175bSopenharmony_ci     accelerated and still have the built-in implementation compiled out.
297a8e1175bSopenharmony_ci     Starting with this release, it is necessary to declare which curves are
298a8e1175bSopenharmony_ci     accelerated (using MBEDTLS_PSA_ACCEL_ECC_xxx macros), or they will be
299a8e1175bSopenharmony_ci     considered not accelerated, and the built-in implementation of the curves
300a8e1175bSopenharmony_ci     and any algorithm possible using them will be included in the build.
301a8e1175bSopenharmony_ci   * Add new millisecond time type `mbedtls_ms_time_t` and `mbedtls_ms_time()`
302a8e1175bSopenharmony_ci     function, needed for TLS 1.3 ticket lifetimes. Alternative implementations
303a8e1175bSopenharmony_ci     can be created using an ALT interface.
304a8e1175bSopenharmony_ci
305a8e1175bSopenharmony_ciRequirement changes
306a8e1175bSopenharmony_ci   * Officially require Python 3.8 now that earlier versions are out of support.
307a8e1175bSopenharmony_ci   * Minimum required Windows version is now Windows Vista, or
308a8e1175bSopenharmony_ci     Windows Server 2008.
309a8e1175bSopenharmony_ci
310a8e1175bSopenharmony_ciNew deprecations
311a8e1175bSopenharmony_ci   * PSA_WANT_KEY_TYPE_xxx_KEY_PAIR and
312a8e1175bSopenharmony_ci     MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR, where xxx is either ECC or RSA,
313a8e1175bSopenharmony_ci     are now being deprecated in favor of PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_yyy and
314a8e1175bSopenharmony_ci     MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR_yyy. Here yyy can be: BASIC,
315a8e1175bSopenharmony_ci     IMPORT, EXPORT, GENERATE, DERIVE. The goal is to have a finer detail about
316a8e1175bSopenharmony_ci     the capabilities of the PSA side for either key.
317a8e1175bSopenharmony_ci   * MBEDTLS_CIPHER_BLKSIZE_MAX is deprecated in favor of
318a8e1175bSopenharmony_ci     MBEDTLS_MAX_BLOCK_LENGTH (if you intended what the name suggests:
319a8e1175bSopenharmony_ci     maximum size of any supported block cipher) or the new name
320a8e1175bSopenharmony_ci     MBEDTLS_CMAC_MAX_BLOCK_SIZE (if you intended the actual semantics:
321a8e1175bSopenharmony_ci     maximum size of a block cipher supported by the CMAC module).
322a8e1175bSopenharmony_ci   * mbedtls_pkcs5_pbes2() and mbedtls_pkcs12_pbe() functions are now
323a8e1175bSopenharmony_ci     deprecated in favor of mbedtls_pkcs5_pbes2_ext() and
324a8e1175bSopenharmony_ci     mbedtls_pkcs12_pbe_ext() as they offer more security by checking
325a8e1175bSopenharmony_ci     for overflow of the output buffer and reporting the actual length
326a8e1175bSopenharmony_ci     of the output.
327a8e1175bSopenharmony_ci
328a8e1175bSopenharmony_ciFeatures
329a8e1175bSopenharmony_ci   * All modules that use hashes or HMAC can now take advantage of PSA Crypto
330a8e1175bSopenharmony_ci     drivers when MBEDTLS_PSA_CRYPTO_C is enabled and psa_crypto_init() has
331a8e1175bSopenharmony_ci     been called. Previously (in 3.3), this was restricted to a few modules,
332a8e1175bSopenharmony_ci     and only in builds where MBEDTLS_MD_C was disabled; in particular the
333a8e1175bSopenharmony_ci     entropy module was not covered which meant an external RNG had to be
334a8e1175bSopenharmony_ci     provided - these limitations are lifted in this version. A new set of
335a8e1175bSopenharmony_ci     feature macros, MBEDTLS_MD_CAN_xxx, has been introduced that can be used
336a8e1175bSopenharmony_ci     to check for availability of hash algorithms, regardless of whether
337a8e1175bSopenharmony_ci     they're provided by a built-in implementation, a driver or both. See
338a8e1175bSopenharmony_ci     docs/driver-only-builds.md.
339a8e1175bSopenharmony_ci   * When a PSA driver for ECDH is present, it is now possible to disable
340a8e1175bSopenharmony_ci     MBEDTLS_ECDH_C in the build in order to save code size. For TLS 1.2
341a8e1175bSopenharmony_ci     key exchanges based on ECDH(E) to work, this requires
342a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO. Restartable/interruptible ECDHE operations in
343a8e1175bSopenharmony_ci     TLS 1.2 (ECDHE-ECDSA key exchange) are not supported in those builds yet,
344a8e1175bSopenharmony_ci     as PSA does not have an API for restartable ECDH yet.
345a8e1175bSopenharmony_ci   * When all of ECDH, ECDSA and EC J-PAKE are either disabled or provided by
346a8e1175bSopenharmony_ci     a driver, it is possible to disable MBEDTLS_ECP_C (and MBEDTLS_BIGNUM_C
347a8e1175bSopenharmony_ci     if not required by another module) and still get support for ECC keys and
348a8e1175bSopenharmony_ci     algorithms in PSA, with some limitations. See docs/driver-only-builds.txt
349a8e1175bSopenharmony_ci     for details.
350a8e1175bSopenharmony_ci   * Add parsing of directoryName subtype for subjectAltName extension in
351a8e1175bSopenharmony_ci     x509 certificates.
352a8e1175bSopenharmony_ci   * Add support for server-side TLS version negotiation. If both TLS 1.2 and
353a8e1175bSopenharmony_ci     TLS 1.3 protocols are enabled, the TLS server now selects TLS 1.2 or
354a8e1175bSopenharmony_ci     TLS 1.3 depending on the capabilities and preferences of TLS clients.
355a8e1175bSopenharmony_ci     Fixes #6867.
356a8e1175bSopenharmony_ci   * X.509 hostname verification now supports IPAddress Subject Alternate Names.
357a8e1175bSopenharmony_ci   * Add support for reading and writing X25519 and X448
358a8e1175bSopenharmony_ci     public and private keys in RFC 8410 format using the existing PK APIs.
359a8e1175bSopenharmony_ci   * When parsing X.509 certificates, support the extensions
360a8e1175bSopenharmony_ci     SignatureKeyIdentifier and AuthorityKeyIdentifier.
361a8e1175bSopenharmony_ci   * Don't include the PSA dispatch functions for PAKEs (psa_pake_setup() etc)
362a8e1175bSopenharmony_ci     if no PAKE algorithms are requested
363a8e1175bSopenharmony_ci   * Add support for the FFDH algorithm and DH key types in PSA, with
364a8e1175bSopenharmony_ci     parameters from RFC 7919. This includes a built-in implementation based
365a8e1175bSopenharmony_ci     on MBEDTLS_BIGNUM_C, and a driver dispatch layer enabling alternative
366a8e1175bSopenharmony_ci     implementations of FFDH through the driver entry points.
367a8e1175bSopenharmony_ci   * It is now possible to generate certificates with SubjectAltNames.
368a8e1175bSopenharmony_ci     Currently supported subtypes: DnsName, UniformResourceIdentifier,
369a8e1175bSopenharmony_ci     IP address, OtherName, and DirectoryName, as defined in RFC 5280.
370a8e1175bSopenharmony_ci     See mbedtls_x509write_crt_set_subject_alternative_name for
371a8e1175bSopenharmony_ci     more information.
372a8e1175bSopenharmony_ci   * X.509 hostname verification now partially supports URI Subject Alternate
373a8e1175bSopenharmony_ci     Names. Only exact matching, without any normalization procedures
374a8e1175bSopenharmony_ci     described in 7.4 of RFC5280, will result in a positive URI verification.
375a8e1175bSopenharmony_ci   * Add function mbedtls_oid_from_numeric_string() to parse an OID from a
376a8e1175bSopenharmony_ci     string to a DER-encoded mbedtls_asn1_buf.
377a8e1175bSopenharmony_ci   * Add SHA-3 family hash functions.
378a8e1175bSopenharmony_ci   * Add support to restrict AES to 128-bit keys in order to save code size.
379a8e1175bSopenharmony_ci     A new configuration option, MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH, can be
380a8e1175bSopenharmony_ci     used to enable this feature.
381a8e1175bSopenharmony_ci   * AES performance improvements. Uplift varies by platform,
382a8e1175bSopenharmony_ci     toolchain, optimisation flags and mode.
383a8e1175bSopenharmony_ci     Aarch64, gcc -Os and CCM, GCM and XTS benefit the most.
384a8e1175bSopenharmony_ci     On Aarch64, uplift is typically around 20 - 110%.
385a8e1175bSopenharmony_ci     When compiling with gcc -Os on Aarch64, AES-XTS improves
386a8e1175bSopenharmony_ci     by 4.5x.
387a8e1175bSopenharmony_ci   * Add support for PBKDF2-HMAC through the PSA API.
388a8e1175bSopenharmony_ci   * New symbols PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_yyy and
389a8e1175bSopenharmony_ci     MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR_yyy (where xxx is either ECC, RSA
390a8e1175bSopenharmony_ci     or DH) were introduced in order to have finer accuracy in defining the
391a8e1175bSopenharmony_ci     PSA capabilities for each key. These capabilities, named yyy above, can be
392a8e1175bSopenharmony_ci     any of: BASIC, IMPORT, EXPORT, GENERATE, DERIVE.
393a8e1175bSopenharmony_ci     - DERIVE is only available for ECC keys, not for RSA or DH ones.
394a8e1175bSopenharmony_ci     - implementations are free to enable more than what it was strictly
395a8e1175bSopenharmony_ci       requested. For example BASIC internally enables IMPORT and EXPORT
396a8e1175bSopenharmony_ci       (useful for testing purposes), but this might change in the future.
397a8e1175bSopenharmony_ci   * Add support for FFDH key exchange in TLS 1.3.
398a8e1175bSopenharmony_ci     This is automatically enabled as soon as PSA_WANT_ALG_FFDH
399a8e1175bSopenharmony_ci     and the ephemeral or psk-ephemeral key exchange mode are enabled.
400a8e1175bSopenharmony_ci     By default, all groups are offered; the list of groups can be
401a8e1175bSopenharmony_ci     configured using the existing API function mbedtls_ssl_conf_groups().
402a8e1175bSopenharmony_ci   * Improve mbedtls_x509_time performance and reduce memory use.
403a8e1175bSopenharmony_ci   * Reduce syscalls to time() during certificate verification.
404a8e1175bSopenharmony_ci   * Allow MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE to be set by
405a8e1175bSopenharmony_ci     setting the CMake variable of the same name at configuration time.
406a8e1175bSopenharmony_ci   * Add getter (mbedtls_ssl_cache_get_timeout()) to access
407a8e1175bSopenharmony_ci     `mbedtls_ssl_cache_context.timeout`.
408a8e1175bSopenharmony_ci   * Add getter (mbedtls_ssl_get_hostname()) to access
409a8e1175bSopenharmony_ci     `mbedtls_ssl_context.hostname`.
410a8e1175bSopenharmony_ci   * Add getter (mbedtls_ssl_conf_get_endpoint()) to access
411a8e1175bSopenharmony_ci     `mbedtls_ssl_config.endpoint`.
412a8e1175bSopenharmony_ci   * Support for "opaque" (PSA-held) ECC keys in the PK module has been
413a8e1175bSopenharmony_ci     extended: it is now possible to use mbedtls_pk_write_key_der(),
414a8e1175bSopenharmony_ci     mbedtls_pk_write_key_pem(), mbedtls_pk_check_pair(), and
415a8e1175bSopenharmony_ci     mbedtls_pk_verify() with opaque ECC keys (provided the PSA attributes
416a8e1175bSopenharmony_ci     allow it).
417a8e1175bSopenharmony_ci   * The documentation of mbedtls_ecp_group now describes the optimized
418a8e1175bSopenharmony_ci     representation of A for some curves. Fixes #8045.
419a8e1175bSopenharmony_ci   * Add a possibility to generate CSR's with RCF822 and directoryName subtype
420a8e1175bSopenharmony_ci     of subjectAltName extension in x509 certificates.
421a8e1175bSopenharmony_ci   * Add support for PBKDF2-CMAC through the PSA API.
422a8e1175bSopenharmony_ci   * New configuration option MBEDTLS_AES_USE_HARDWARE_ONLY introduced. When
423a8e1175bSopenharmony_ci     using CPU-accelerated AES (e.g., Arm Crypto Extensions), this option
424a8e1175bSopenharmony_ci     disables the plain C implementation and the run-time detection for the
425a8e1175bSopenharmony_ci     CPU feature, which reduces code size and avoids the vulnerability of the
426a8e1175bSopenharmony_ci     plain C implementation.
427a8e1175bSopenharmony_ci   * Accept arbitrary AttributeType and AttributeValue in certificate
428a8e1175bSopenharmony_ci     Distinguished Names using RFC 4514 syntax.
429a8e1175bSopenharmony_ci   * Applications using ECC over secp256r1 through the PSA API can use a
430a8e1175bSopenharmony_ci     new implementation with a much smaller footprint, but some minor
431a8e1175bSopenharmony_ci     usage restrictions. See the documentation of the new configuration
432a8e1175bSopenharmony_ci     option MBEDTLS_PSA_P256M_DRIVER_ENABLED for details.
433a8e1175bSopenharmony_ci
434a8e1175bSopenharmony_ciSecurity
435a8e1175bSopenharmony_ci   * Fix a case where potentially sensitive information held in memory would not
436a8e1175bSopenharmony_ci     be completely zeroized during TLS 1.2 handshake, in both server and client
437a8e1175bSopenharmony_ci     configurations.
438a8e1175bSopenharmony_ci   * In configurations with ARIA or Camellia but not AES, the value of
439a8e1175bSopenharmony_ci     MBEDTLS_CIPHER_BLKSIZE_MAX was 8, rather than 16 as the name might
440a8e1175bSopenharmony_ci     suggest. This did not affect any library code, because this macro was
441a8e1175bSopenharmony_ci     only used in relation with CMAC which does not support these ciphers.
442a8e1175bSopenharmony_ci     This may affect application code that uses this macro.
443a8e1175bSopenharmony_ci   * Developers using mbedtls_pkcs5_pbes2() or mbedtls_pkcs12_pbe() should
444a8e1175bSopenharmony_ci     review the size of the output buffer passed to this function, and note
445a8e1175bSopenharmony_ci     that the output after decryption may include CBC padding. Consider moving
446a8e1175bSopenharmony_ci     to the new functions mbedtls_pkcs5_pbes2_ext() or mbedtls_pkcs12_pbe_ext()
447a8e1175bSopenharmony_ci     which checks for overflow of the output buffer and reports the actual
448a8e1175bSopenharmony_ci     length of the output.
449a8e1175bSopenharmony_ci   * Improve padding calculations in CBC decryption, NIST key unwrapping and
450a8e1175bSopenharmony_ci     RSA OAEP decryption. With the previous implementation, some compilers
451a8e1175bSopenharmony_ci     (notably recent versions of Clang and IAR) could produce non-constant
452a8e1175bSopenharmony_ci     time code, which could allow a padding oracle attack if the attacker
453a8e1175bSopenharmony_ci     has access to precise timing measurements.
454a8e1175bSopenharmony_ci   * Updates to constant-time C code so that compilers are less likely to use
455a8e1175bSopenharmony_ci     conditional instructions, which can have an observable difference in
456a8e1175bSopenharmony_ci     timing. (Clang has been seen to do this.) Also introduce assembly
457a8e1175bSopenharmony_ci     implementations for 32- and 64-bit Arm and for x86 and x86-64, which are
458a8e1175bSopenharmony_ci     guaranteed not to use conditional instructions.
459a8e1175bSopenharmony_ci   * Fix definition of MBEDTLS_MD_MAX_BLOCK_SIZE, which was too
460a8e1175bSopenharmony_ci     small when MBEDTLS_SHA384_C was defined and MBEDTLS_SHA512_C was
461a8e1175bSopenharmony_ci     undefined. Mbed TLS itself was unaffected by this, but user code
462a8e1175bSopenharmony_ci     which used MBEDTLS_MD_MAX_BLOCK_SIZE could be affected. The only
463a8e1175bSopenharmony_ci     release containing this bug was Mbed TLS 3.4.0.
464a8e1175bSopenharmony_ci   * Fix a buffer overread when parsing short TLS application data records in
465a8e1175bSopenharmony_ci     null-cipher cipher suites. Credit to OSS-Fuzz.
466a8e1175bSopenharmony_ci   * Fix a remotely exploitable heap buffer overflow in TLS handshake parsing.
467a8e1175bSopenharmony_ci     In TLS 1.3, all configurations are affected except PSK-only ones, and
468a8e1175bSopenharmony_ci     both clients and servers are affected.
469a8e1175bSopenharmony_ci     In TLS 1.2, the affected configurations are those with
470a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO and ECDH enabled but DHM and RSA disabled,
471a8e1175bSopenharmony_ci     and only servers are affected, not clients.
472a8e1175bSopenharmony_ci     Credit to OSS-Fuzz.
473a8e1175bSopenharmony_ci
474a8e1175bSopenharmony_ciBugfix
475a8e1175bSopenharmony_ci   * Fix proper sizing for PSA_EXPORT_[KEY_PAIR/PUBLIC_KEY]_MAX_SIZE and
476a8e1175bSopenharmony_ci     PSA_SIGNATURE_MAX_SIZE buffers when at least one accelerated EC is bigger
477a8e1175bSopenharmony_ci     than all built-in ones and RSA is disabled.
478a8e1175bSopenharmony_ci     Resolves #6622.
479a8e1175bSopenharmony_ci   * Add missing md.h includes to some of the external programs from
480a8e1175bSopenharmony_ci     the programs directory. Without this, even though the configuration
481a8e1175bSopenharmony_ci     was sufficient for a particular program to work, it would only print
482a8e1175bSopenharmony_ci     a message that one of the required defines is missing.
483a8e1175bSopenharmony_ci   * Fix declaration of mbedtls_ecdsa_sign_det_restartable() function
484a8e1175bSopenharmony_ci     in the ecdsa.h header file. There was a build warning when the
485a8e1175bSopenharmony_ci     configuration macro MBEDTLS_ECDSA_SIGN_ALT was defined.
486a8e1175bSopenharmony_ci     Resolves #7407.
487a8e1175bSopenharmony_ci   * Fix an error when MBEDTLS_ECDSA_SIGN_ALT is defined but not
488a8e1175bSopenharmony_ci     MBEDTLS_ECDSA_VERIFY_ALT, causing ecdsa verify to fail. Fixes #7498.
489a8e1175bSopenharmony_ci   * Fix missing PSA initialization in sample programs when
490a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO is enabled.
491a8e1175bSopenharmony_ci   * Fix the J-PAKE driver interface for user and peer to accept any values
492a8e1175bSopenharmony_ci     (previously accepted values were limited to "client" or "server").
493a8e1175bSopenharmony_ci   * Fix clang and armclang compilation error when targeting certain Arm
494a8e1175bSopenharmony_ci     M-class CPUs (Cortex-M0, Cortex-M0+, Cortex-M1, Cortex-M23,
495a8e1175bSopenharmony_ci     SecurCore SC000). Fixes #1077.
496a8e1175bSopenharmony_ci   * Fix "unterminated '#pragma clang attribute push'" in sha256/sha512.c when
497a8e1175bSopenharmony_ci     built with MBEDTLS_SHAxxx_USE_A64_CRYPTO_IF_PRESENT but don't have a
498a8e1175bSopenharmony_ci     way to detect the crypto extensions required. A warning is still issued.
499a8e1175bSopenharmony_ci   * Fixed an issue that caused compile errors when using CMake and the IAR
500a8e1175bSopenharmony_ci     toolchain.
501a8e1175bSopenharmony_ci   * Fix very high stack usage in SSL debug code. Reported by Maximilian
502a8e1175bSopenharmony_ci     Gerhardt in #7804.
503a8e1175bSopenharmony_ci   * Fix a compilation failure in the constant_time module when
504a8e1175bSopenharmony_ci     building for arm64_32 (e.g., for watchos). Reported by Paulo
505a8e1175bSopenharmony_ci     Coutinho in #7787.
506a8e1175bSopenharmony_ci   * Fix crypt_and_hash decryption fail when used with a stream cipher
507a8e1175bSopenharmony_ci     mode of operation due to the input not being multiple of block size.
508a8e1175bSopenharmony_ci     Resolves #7417.
509a8e1175bSopenharmony_ci   * Fix a bug in which mbedtls_x509_string_to_names() would return success
510a8e1175bSopenharmony_ci     when given a invalid name string if it did not contain '=' or ','.
511a8e1175bSopenharmony_ci   * Fix compilation warnings in aes.c, which prevented the
512a8e1175bSopenharmony_ci     example TF-M configuration in configs/ from building cleanly:
513a8e1175bSopenharmony_ci     tfm_mbedcrypto_config_profile_medium.h with
514a8e1175bSopenharmony_ci     crypto_config_profile_medium.h.
515a8e1175bSopenharmony_ci   * In TLS 1.3, fix handshake failure when a client in its ClientHello
516a8e1175bSopenharmony_ci     proposes an handshake based on PSK only key exchange mode or at least
517a8e1175bSopenharmony_ci     one of the key exchange modes using ephemeral keys to a server that
518a8e1175bSopenharmony_ci     supports only the PSK key exchange mode.
519a8e1175bSopenharmony_ci   * Fix CCM* with no tag being not supported in a build with CCM as the only
520a8e1175bSopenharmony_ci     symmetric encryption algorithm and the PSA configuration enabled.
521a8e1175bSopenharmony_ci   * Fix the build with MBEDTLS_PSA_INJECT_ENTROPY. Fixes #7516.
522a8e1175bSopenharmony_ci   * Fix a compilation error on some platforms when including mbedtls/ssl.h
523a8e1175bSopenharmony_ci     with all TLS support disabled. Fixes #6628.
524a8e1175bSopenharmony_ci   * Fix x509 certificate generation to conform to RFC 5480 / RFC 5758 when
525a8e1175bSopenharmony_ci     using ECC key. The certificate was rejected by some crypto frameworks.
526a8e1175bSopenharmony_ci     Fixes #2924.
527a8e1175bSopenharmony_ci   * Fix a potential corruption of the passed-in IV when mbedtls_aes_crypt_cbc()
528a8e1175bSopenharmony_ci     is called with zero length and padlock is not enabled.
529a8e1175bSopenharmony_ci   * Fix compile failure due to empty enum in cipher_wrap.c, when building
530a8e1175bSopenharmony_ci     with a very minimal configuration. Fixes #7625.
531a8e1175bSopenharmony_ci   * Fix some cases where mbedtls_mpi_mod_exp, RSA key construction or ECDSA
532a8e1175bSopenharmony_ci     signature can silently return an incorrect result in low memory conditions.
533a8e1175bSopenharmony_ci   * Don't try to include MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE when
534a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_CONFIG is disabled.
535a8e1175bSopenharmony_ci   * Fix IAR compiler warnings.
536a8e1175bSopenharmony_ci   * Fix an issue when parsing an otherName subject alternative name into a
537a8e1175bSopenharmony_ci     mbedtls_x509_san_other_name struct. The type-id of the otherName was not
538a8e1175bSopenharmony_ci     copied to the struct. This meant that the struct had incomplete
539a8e1175bSopenharmony_ci     information about the otherName SAN and contained uninitialized memory.
540a8e1175bSopenharmony_ci   * Fix the detection of HardwareModuleName otherName SANs. These were being
541a8e1175bSopenharmony_ci     detected by comparing the wrong field and the check was erroneously
542a8e1175bSopenharmony_ci     inverted.
543a8e1175bSopenharmony_ci   * Fix a build error in some configurations with MBEDTLS_PSA_CRYPTO_CONFIG
544a8e1175bSopenharmony_ci     enabled, where some low-level modules required by requested PSA crypto
545a8e1175bSopenharmony_ci     features were not getting automatically enabled. Fixes #7420.
546a8e1175bSopenharmony_ci   * Fix undefined symbols in some builds using TLS 1.3 with a custom
547a8e1175bSopenharmony_ci     configuration file.
548a8e1175bSopenharmony_ci   * Fix log level for the got supported group message. Fixes #6765
549a8e1175bSopenharmony_ci   * Functions in the ssl_cache module now return a negative MBEDTLS_ERR_xxx
550a8e1175bSopenharmony_ci     error code on failure. Before, they returned 1 to indicate failure in
551a8e1175bSopenharmony_ci     some cases involving a missing entry or a full cache.
552a8e1175bSopenharmony_ci   * mbedtls_pk_parse_key() now rejects trailing garbage in encrypted keys.
553a8e1175bSopenharmony_ci   * Fix the build with CMake when Everest or P256-m is enabled through
554a8e1175bSopenharmony_ci     a user configuration file or the compiler command line. Fixes #8165.
555a8e1175bSopenharmony_ci
556a8e1175bSopenharmony_ciChanges
557a8e1175bSopenharmony_ci   * Enable Arm / Thumb bignum assembly for most Arm platforms when
558a8e1175bSopenharmony_ci     compiling with gcc, clang or armclang and -O0.
559a8e1175bSopenharmony_ci   * Enforce minimum RSA key size when generating a key
560a8e1175bSopenharmony_ci     to avoid accidental misuse.
561a8e1175bSopenharmony_ci   * Use heap memory to allocate DER encoded RSA private key.
562a8e1175bSopenharmony_ci     This reduces stack usage significantly for RSA signature
563a8e1175bSopenharmony_ci     operations when MBEDTLS_PSA_CRYPTO_C is defined.
564a8e1175bSopenharmony_ci   * Update Windows code to use BCryptGenRandom and wcslen, and
565a8e1175bSopenharmony_ci     ensure that conversions between size_t, ULONG, and int are
566a8e1175bSopenharmony_ci     always done safely.  Original contribution by Kevin Kane #635, #730
567a8e1175bSopenharmony_ci     followed by Simon Butcher #1453.
568a8e1175bSopenharmony_ci   * Users integrating their own PSA drivers should be aware that
569a8e1175bSopenharmony_ci     the file library/psa_crypto_driver_wrappers.c has been renamed
570a8e1175bSopenharmony_ci     to psa_crypto_driver_wrappers_no_static.c.
571a8e1175bSopenharmony_ci   * When using CBC with the cipher module, the requirement to call
572a8e1175bSopenharmony_ci     mbedtls_cipher_set_padding_mode() is now enforced. Previously, omitting
573a8e1175bSopenharmony_ci     this call accidentally applied a default padding mode chosen at compile
574a8e1175bSopenharmony_ci     time.
575a8e1175bSopenharmony_ci
576a8e1175bSopenharmony_ci= Mbed TLS 3.4.1 branch released 2023-08-04
577a8e1175bSopenharmony_ci
578a8e1175bSopenharmony_ciBugfix
579a8e1175bSopenharmony_ci   * Fix builds on Windows with clang
580a8e1175bSopenharmony_ci
581a8e1175bSopenharmony_ciChanges
582a8e1175bSopenharmony_ci   * Update test data to avoid failures of unit tests after 2023-08-07.
583a8e1175bSopenharmony_ci
584a8e1175bSopenharmony_ci= Mbed TLS 3.4.0 branch released 2023-03-28
585a8e1175bSopenharmony_ci
586a8e1175bSopenharmony_ciDefault behavior changes
587a8e1175bSopenharmony_ci   * The default priority order of TLS 1.3 cipher suites has been modified to
588a8e1175bSopenharmony_ci     follow the same rules as the TLS 1.2 cipher suites (see
589a8e1175bSopenharmony_ci     ssl_ciphersuites.c). The preferred cipher suite is now
590a8e1175bSopenharmony_ci     TLS_CHACHA20_POLY1305_SHA256.
591a8e1175bSopenharmony_ci
592a8e1175bSopenharmony_ciNew deprecations
593a8e1175bSopenharmony_ci   * mbedtls_x509write_crt_set_serial() is now being deprecated in favor of
594a8e1175bSopenharmony_ci     mbedtls_x509write_crt_set_serial_raw(). The goal here is to remove any
595a8e1175bSopenharmony_ci     direct dependency of X509 on BIGNUM_C.
596a8e1175bSopenharmony_ci   * PSA to mbedtls error translation is now unified in psa_util.h,
597a8e1175bSopenharmony_ci     deprecating mbedtls_md_error_from_psa. Each file that performs error
598a8e1175bSopenharmony_ci     translation should define its own version of PSA_TO_MBEDTLS_ERR,
599a8e1175bSopenharmony_ci     optionally providing file-specific error pairs. Please see psa_util.h for
600a8e1175bSopenharmony_ci     more details.
601a8e1175bSopenharmony_ci
602a8e1175bSopenharmony_ciFeatures
603a8e1175bSopenharmony_ci   * Added partial support for parsing the PKCS #7 Cryptographic Message
604a8e1175bSopenharmony_ci     Syntax, as defined in RFC 2315. Currently, support is limited to the
605a8e1175bSopenharmony_ci     following:
606a8e1175bSopenharmony_ci     - Only the signed-data content type, version 1 is supported.
607a8e1175bSopenharmony_ci     - Only DER encoding is supported.
608a8e1175bSopenharmony_ci     - Only a single digest algorithm per message is supported.
609a8e1175bSopenharmony_ci     - Certificates must be in X.509 format. A message must have either 0
610a8e1175bSopenharmony_ci       or 1 certificates.
611a8e1175bSopenharmony_ci     - There is no support for certificate revocation lists.
612a8e1175bSopenharmony_ci     - The authenticated and unauthenticated attribute fields of SignerInfo
613a8e1175bSopenharmony_ci       must be empty.
614a8e1175bSopenharmony_ci     Many thanks to Daniel Axtens, Nayna Jain, and Nick Child from IBM for
615a8e1175bSopenharmony_ci     contributing this feature, and to Demi-Marie Obenour for contributing
616a8e1175bSopenharmony_ci     various improvements, tests and bug fixes.
617a8e1175bSopenharmony_ci   * General performance improvements by accessing multiple bytes at a time.
618a8e1175bSopenharmony_ci     Fixes #1666.
619a8e1175bSopenharmony_ci   * Improvements to use of unaligned and byte-swapped memory, reducing code
620a8e1175bSopenharmony_ci     size and improving performance (depending on compiler and target
621a8e1175bSopenharmony_ci     architecture).
622a8e1175bSopenharmony_ci   * Add support for reading points in compressed format
623a8e1175bSopenharmony_ci     (MBEDTLS_ECP_PF_COMPRESSED) with mbedtls_ecp_point_read_binary()
624a8e1175bSopenharmony_ci     (and callers) for Short Weierstrass curves with prime p where p = 3 mod 4
625a8e1175bSopenharmony_ci     (all mbedtls MBEDTLS_ECP_DP_SECP* and MBEDTLS_ECP_DP_BP* curves
626a8e1175bSopenharmony_ci      except MBEDTLS_ECP_DP_SECP224R1 and MBEDTLS_ECP_DP_SECP224K1)
627a8e1175bSopenharmony_ci   * SHA224_C/SHA384_C are now independent from SHA384_C/SHA512_C respectively.
628a8e1175bSopenharmony_ci     This helps in saving code size when some of the above hashes are not
629a8e1175bSopenharmony_ci     required.
630a8e1175bSopenharmony_ci   * Add parsing of V3 extensions (key usage, Netscape cert-type,
631a8e1175bSopenharmony_ci     Subject Alternative Names) in x509 Certificate Sign Requests.
632a8e1175bSopenharmony_ci   * Use HOSTCC (if it is set) when compiling C code during generation of the
633a8e1175bSopenharmony_ci     configuration-independent files. This allows them to be generated when
634a8e1175bSopenharmony_ci     CC is set for cross compilation.
635a8e1175bSopenharmony_ci   * Add parsing of uniformResourceIdentifier subtype for subjectAltName
636a8e1175bSopenharmony_ci     extension in x509 certificates.
637a8e1175bSopenharmony_ci   * Add an interruptible version of sign and verify hash to the PSA interface,
638a8e1175bSopenharmony_ci     backed by internal library support for ECDSA signing and verification.
639a8e1175bSopenharmony_ci   * Add parsing of rfc822Name subtype for subjectAltName
640a8e1175bSopenharmony_ci     extension in x509 certificates.
641a8e1175bSopenharmony_ci   * The configuration macros MBEDTLS_PSA_CRYPTO_PLATFORM_FILE and
642a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_STRUCT_FILE specify alternative locations for
643a8e1175bSopenharmony_ci     the headers "psa/crypto_platform.h" and "psa/crypto_struct.h".
644a8e1175bSopenharmony_ci   * When a PSA driver for ECDSA is present, it is now possible to disable
645a8e1175bSopenharmony_ci     MBEDTLS_ECDSA_C in the build in order to save code size. For PK, X.509
646a8e1175bSopenharmony_ci     and TLS to fully work, this requires MBEDTLS_USE_PSA_CRYPTO to be enabled.
647a8e1175bSopenharmony_ci     Restartable/interruptible ECDSA operations in PK, X.509 and TLS are not
648a8e1175bSopenharmony_ci     supported in those builds yet, as driver support for interruptible ECDSA
649a8e1175bSopenharmony_ci     operations is not present yet.
650a8e1175bSopenharmony_ci   * Add a driver dispatch layer for EC J-PAKE, enabling alternative
651a8e1175bSopenharmony_ci     implementations of EC J-PAKE through the driver entry points.
652a8e1175bSopenharmony_ci   * Add new API mbedtls_ssl_cache_remove for cache entry removal by
653a8e1175bSopenharmony_ci     its session id.
654a8e1175bSopenharmony_ci   * Add support to include the SubjectAltName extension to a CSR.
655a8e1175bSopenharmony_ci   * Add support for AES with the Armv8-A Cryptographic Extension on
656a8e1175bSopenharmony_ci     64-bit Arm. A new configuration option, MBEDTLS_AESCE_C, can
657a8e1175bSopenharmony_ci     be used to enable this feature. Run-time detection is supported
658a8e1175bSopenharmony_ci     under Linux only.
659a8e1175bSopenharmony_ci   * When a PSA driver for EC J-PAKE is present, it is now possible to disable
660a8e1175bSopenharmony_ci     MBEDTLS_ECJPAKE_C in the build in order to save code size. For the
661a8e1175bSopenharmony_ci     corresponding TLS 1.2 key exchange to work, MBEDTLS_USE_PSA_CRYPTO needs
662a8e1175bSopenharmony_ci     to be enabled.
663a8e1175bSopenharmony_ci   * Add functions mbedtls_rsa_get_padding_mode() and mbedtls_rsa_get_md_alg()
664a8e1175bSopenharmony_ci     to read non-public fields for padding mode and hash id from
665a8e1175bSopenharmony_ci     an mbedtls_rsa_context, as requested in #6917.
666a8e1175bSopenharmony_ci   * AES-NI is now supported with Visual Studio.
667a8e1175bSopenharmony_ci   * AES-NI is now supported in 32-bit builds, or when MBEDTLS_HAVE_ASM
668a8e1175bSopenharmony_ci     is disabled, when compiling with GCC or Clang or a compatible compiler
669a8e1175bSopenharmony_ci     for a target CPU that supports the requisite instructions (for example
670a8e1175bSopenharmony_ci     gcc -m32 -msse2 -maes -mpclmul). (Generic x86 builds with GCC-like
671a8e1175bSopenharmony_ci     compilers still require MBEDTLS_HAVE_ASM and a 64-bit target.)
672a8e1175bSopenharmony_ci   * It is now possible to use a PSA-held (opaque) password with the TLS 1.2
673a8e1175bSopenharmony_ci     ECJPAKE key exchange, using the new API function
674a8e1175bSopenharmony_ci     mbedtls_ssl_set_hs_ecjpake_password_opaque().
675a8e1175bSopenharmony_ci
676a8e1175bSopenharmony_ciSecurity
677a8e1175bSopenharmony_ci   * Use platform-provided secure zeroization function where possible, such as
678a8e1175bSopenharmony_ci     explicit_bzero().
679a8e1175bSopenharmony_ci   * Zeroize SSL cache entries when they are freed.
680a8e1175bSopenharmony_ci   * Fix a potential heap buffer overread in TLS 1.3 client-side when
681a8e1175bSopenharmony_ci     MBEDTLS_DEBUG_C is enabled. This may result in an application crash.
682a8e1175bSopenharmony_ci   * Add support for AES with the Armv8-A Cryptographic Extension on 64-bit
683a8e1175bSopenharmony_ci     Arm, so that these systems are no longer vulnerable to timing side-channel
684a8e1175bSopenharmony_ci     attacks. This is configured by MBEDTLS_AESCE_C, which is on by default.
685a8e1175bSopenharmony_ci     Reported by Demi Marie Obenour.
686a8e1175bSopenharmony_ci   * MBEDTLS_AESNI_C, which is enabled by default, was silently ignored on
687a8e1175bSopenharmony_ci     builds that couldn't compile the GCC-style assembly implementation
688a8e1175bSopenharmony_ci     (most notably builds with Visual Studio), leaving them vulnerable to
689a8e1175bSopenharmony_ci     timing side-channel attacks. There is now an intrinsics-based AES-NI
690a8e1175bSopenharmony_ci     implementation as a fallback for when the assembly one cannot be used.
691a8e1175bSopenharmony_ci
692a8e1175bSopenharmony_ciBugfix
693a8e1175bSopenharmony_ci   * Fix possible integer overflow in mbedtls_timing_hardclock(), which
694a8e1175bSopenharmony_ci     could cause a crash in programs/test/benchmark.
695a8e1175bSopenharmony_ci   * Fix IAR compiler warnings. Fixes #6924.
696a8e1175bSopenharmony_ci   * Fix a bug in the build where directory names containing spaces were
697a8e1175bSopenharmony_ci     causing generate_errors.pl to error out resulting in a build failure.
698a8e1175bSopenharmony_ci     Fixes issue #6879.
699a8e1175bSopenharmony_ci   * In TLS 1.3, when using a ticket for session resumption, tweak its age
700a8e1175bSopenharmony_ci     calculation on the client side. It prevents a server with more accurate
701a8e1175bSopenharmony_ci     ticket timestamps (typically timestamps in milliseconds) compared to the
702a8e1175bSopenharmony_ci     Mbed TLS ticket timestamps (in seconds) to compute a ticket age smaller
703a8e1175bSopenharmony_ci     than the age computed and transmitted by the client and thus potentially
704a8e1175bSopenharmony_ci     reject the ticket. Fix #6623.
705a8e1175bSopenharmony_ci   * Fix compile error where MBEDTLS_RSA_C and MBEDTLS_X509_CRT_WRITE_C are
706a8e1175bSopenharmony_ci     defined, but MBEDTLS_PK_RSA_ALT_SUPPORT is not defined. Fixes #3174.
707a8e1175bSopenharmony_ci   * List PSA_WANT_ALG_CCM_STAR_NO_TAG in psa/crypto_config.h so that it can
708a8e1175bSopenharmony_ci     be toggled with config.py.
709a8e1175bSopenharmony_ci   * The key derivation algorithm PSA_ALG_TLS12_ECJPAKE_TO_PMS cannot be
710a8e1175bSopenharmony_ci     used on a shared secret from a key agreement since its input must be
711a8e1175bSopenharmony_ci     an ECC public key. Reject this properly.
712a8e1175bSopenharmony_ci   * mbedtls_x509write_crt_set_serial() now explicitly rejects serial numbers
713a8e1175bSopenharmony_ci     whose binary representation is longer than 20 bytes. This was already
714a8e1175bSopenharmony_ci     forbidden by the standard (RFC5280 - section 4.1.2.2) and now it's being
715a8e1175bSopenharmony_ci     enforced also at code level.
716a8e1175bSopenharmony_ci   * Fix potential undefined behavior in mbedtls_mpi_sub_abs().  Reported by
717a8e1175bSopenharmony_ci     Pascal Cuoq using TrustInSoft Analyzer in #6701; observed independently by
718a8e1175bSopenharmony_ci     Aaron Ucko under Valgrind.
719a8e1175bSopenharmony_ci   * Fix behavior of certain sample programs which could, when run with no
720a8e1175bSopenharmony_ci     arguments, access uninitialized memory in some cases. Fixes #6700 (which
721a8e1175bSopenharmony_ci     was found by TrustInSoft Analyzer during REDOCS'22) and #1120.
722a8e1175bSopenharmony_ci   * Fix parsing of X.509 SubjectAlternativeName extension. Previously,
723a8e1175bSopenharmony_ci     malformed alternative name components were not caught during initial
724a8e1175bSopenharmony_ci     certificate parsing, but only on subsequent calls to
725a8e1175bSopenharmony_ci     mbedtls_x509_parse_subject_alt_name(). Fixes #2838.
726a8e1175bSopenharmony_ci   * Make the fields of mbedtls_pk_rsassa_pss_options public. This makes it
727a8e1175bSopenharmony_ci     possible to verify RSA PSS signatures with the pk module, which was
728a8e1175bSopenharmony_ci     inadvertently broken since Mbed TLS 3.0.
729a8e1175bSopenharmony_ci   * Fix bug in conversion from OID to string in
730a8e1175bSopenharmony_ci     mbedtls_oid_get_numeric_string(). OIDs such as 2.40.0.25 are now printed
731a8e1175bSopenharmony_ci     correctly.
732a8e1175bSopenharmony_ci   * Reject OIDs with overlong-encoded subidentifiers when converting
733a8e1175bSopenharmony_ci     them to a string.
734a8e1175bSopenharmony_ci   * Reject OIDs with subidentifier values exceeding UINT_MAX.  Such
735a8e1175bSopenharmony_ci     subidentifiers can be valid, but Mbed TLS cannot currently handle them.
736a8e1175bSopenharmony_ci   * Reject OIDs that have unterminated subidentifiers, or (equivalently)
737a8e1175bSopenharmony_ci     have the most-significant bit set in their last byte.
738a8e1175bSopenharmony_ci   * Silence warnings from clang -Wdocumentation about empty \retval
739a8e1175bSopenharmony_ci     descriptions, which started appearing with Clang 15. Fixes #6960.
740a8e1175bSopenharmony_ci   * Fix the handling of renegotiation attempts in TLS 1.3. They are now
741a8e1175bSopenharmony_ci     systematically rejected.
742a8e1175bSopenharmony_ci   * Fix an unused-variable warning in TLS 1.3-only builds if
743a8e1175bSopenharmony_ci     MBEDTLS_SSL_RENEGOTIATION was enabled. Fixes #6200.
744a8e1175bSopenharmony_ci   * Fix undefined behavior in mbedtls_ssl_read() and mbedtls_ssl_write() if
745a8e1175bSopenharmony_ci     len argument is 0 and buffer is NULL.
746a8e1175bSopenharmony_ci   * Allow setting user and peer identifiers for EC J-PAKE operation
747a8e1175bSopenharmony_ci     instead of role in PAKE PSA Crypto API as described in the specification.
748a8e1175bSopenharmony_ci     This is a partial fix that allows only "client" and "server" identifiers.
749a8e1175bSopenharmony_ci   * Fix a compilation error when PSA Crypto is built with support for
750a8e1175bSopenharmony_ci     TLS12_PRF but not TLS12_PSK_TO_MS. Reported by joerchan in #7125.
751a8e1175bSopenharmony_ci   * In the TLS 1.3 server, select the preferred client cipher suite, not the
752a8e1175bSopenharmony_ci     least preferred. The selection error was introduced in Mbed TLS 3.3.0.
753a8e1175bSopenharmony_ci   * Fix TLS 1.3 session resumption when the established pre-shared key is
754a8e1175bSopenharmony_ci     384 bits long. That is the length of pre-shared keys created under a
755a8e1175bSopenharmony_ci     session where the cipher suite is TLS_AES_256_GCM_SHA384.
756a8e1175bSopenharmony_ci   * Fix an issue when compiling with MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT
757a8e1175bSopenharmony_ci     enabled, which required specifying compiler flags enabling SHA3 Crypto
758a8e1175bSopenharmony_ci     Extensions, where some compilers would emit EOR3 instructions in other
759a8e1175bSopenharmony_ci     modules, which would then fail if run on a CPU without the SHA3
760a8e1175bSopenharmony_ci     extensions. Fixes #5758.
761a8e1175bSopenharmony_ci
762a8e1175bSopenharmony_ciChanges
763a8e1175bSopenharmony_ci   * Install the .cmake files into CMAKE_INSTALL_LIBDIR/cmake/MbedTLS,
764a8e1175bSopenharmony_ci     typically /usr/lib/cmake/MbedTLS.
765a8e1175bSopenharmony_ci   * Mixed-endian systems are explicitly not supported any more.
766a8e1175bSopenharmony_ci   * When MBEDTLS_USE_PSA_CRYPTO and MBEDTLS_ECDSA_DETERMINISTIC are both
767a8e1175bSopenharmony_ci     defined, mbedtls_pk_sign() now use deterministic ECDSA for ECDSA
768a8e1175bSopenharmony_ci     signatures. This aligns the behaviour with MBEDTLS_USE_PSA_CRYPTO to
769a8e1175bSopenharmony_ci     the behaviour without it, where deterministic ECDSA was already used.
770a8e1175bSopenharmony_ci   * Visual Studio: Rename the directory containing Visual Studio files from
771a8e1175bSopenharmony_ci     visualc/VS2010 to visualc/VS2013 as we do not support building with versions
772a8e1175bSopenharmony_ci     older than 2013. Update the solution file to specify VS2013 as a minimum.
773a8e1175bSopenharmony_ci   * programs/x509/cert_write:
774a8e1175bSopenharmony_ci     - now it accepts the serial number in 2 different formats: decimal and
775a8e1175bSopenharmony_ci       hex. They cannot be used simultaneously
776a8e1175bSopenharmony_ci     - "serial" is used for the decimal format and it's limted in size to
777a8e1175bSopenharmony_ci       unsigned long long int
778a8e1175bSopenharmony_ci     - "serial_hex" is used for the hex format; max length here is
779a8e1175bSopenharmony_ci       MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN*2
780a8e1175bSopenharmony_ci   * The C code follows a new coding style. This is transparent for users but
781a8e1175bSopenharmony_ci     affects contributors and maintainers of local patches. For more
782a8e1175bSopenharmony_ci     information, see
783a8e1175bSopenharmony_ci     https://mbed-tls.readthedocs.io/en/latest/kb/how-to/rewrite-branch-for-coding-style/
784a8e1175bSopenharmony_ci   * Changed the default MBEDTLS_ECP_WINDOW_SIZE from 6 to 2.
785a8e1175bSopenharmony_ci     As tested in issue 6790, the correlation between this define and
786a8e1175bSopenharmony_ci     RSA decryption performance has changed lately due to security fixes.
787a8e1175bSopenharmony_ci     To fix the performance degradation when using default values the
788a8e1175bSopenharmony_ci     window was reduced from 6 to 2, a value that gives the best or close
789a8e1175bSopenharmony_ci     to best results when tested on Cortex-M4 and Intel i7.
790a8e1175bSopenharmony_ci   * When enabling MBEDTLS_SHA256_USE_A64_CRYPTO_* or
791a8e1175bSopenharmony_ci     MBEDTLS_SHA512_USE_A64_CRYPTO_*, it is no longer necessary to specify
792a8e1175bSopenharmony_ci     compiler target flags on the command line; the library now sets target
793a8e1175bSopenharmony_ci     options within the appropriate modules.
794a8e1175bSopenharmony_ci
795a8e1175bSopenharmony_ci= Mbed TLS 3.3.0 branch released 2022-12-14
796a8e1175bSopenharmony_ci
797a8e1175bSopenharmony_ciDefault behavior changes
798a8e1175bSopenharmony_ci   * Previously the macro MBEDTLS_SSL_DTLS_CONNECTION_ID implemented version 05
799a8e1175bSopenharmony_ci     of the IETF draft, and was marked experimental and disabled by default.
800a8e1175bSopenharmony_ci     It is now no longer experimental, and implements the final version from
801a8e1175bSopenharmony_ci     RFC 9146, which is not interoperable with the draft-05 version.
802a8e1175bSopenharmony_ci     If you need to communicate with peers that use earlier versions of
803a8e1175bSopenharmony_ci     Mbed TLS, then you need to define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
804a8e1175bSopenharmony_ci     to 1, but then you won't be able to communicate with peers that use the
805a8e1175bSopenharmony_ci     standard (non-draft) version.
806a8e1175bSopenharmony_ci     If you need to interoperate with both classes of peers with the
807a8e1175bSopenharmony_ci     same build of Mbed TLS, please let us know about your situation on the
808a8e1175bSopenharmony_ci     mailing list or GitHub.
809a8e1175bSopenharmony_ci
810a8e1175bSopenharmony_ciRequirement changes
811a8e1175bSopenharmony_ci   * When building with PSA drivers using generate_driver_wrappers.py, or
812a8e1175bSopenharmony_ci     when building the library from the development branch rather than
813a8e1175bSopenharmony_ci     from a release, the Python module jsonschema is now necessary, in
814a8e1175bSopenharmony_ci     addition to jinja2. The official list of required Python modules is
815a8e1175bSopenharmony_ci     maintained in scripts/basic.requirements.txt and may change again
816a8e1175bSopenharmony_ci     in the future.
817a8e1175bSopenharmony_ci
818a8e1175bSopenharmony_ciNew deprecations
819a8e1175bSopenharmony_ci   * Deprecate mbedtls_asn1_free_named_data().
820a8e1175bSopenharmony_ci     Use mbedtls_asn1_free_named_data_list()
821a8e1175bSopenharmony_ci     or mbedtls_asn1_free_named_data_list_shallow().
822a8e1175bSopenharmony_ci
823a8e1175bSopenharmony_ciFeatures
824a8e1175bSopenharmony_ci   * Support rsa_pss_rsae_* signature algorithms in TLS 1.2.
825a8e1175bSopenharmony_ci   * make: enable building unversioned shared library, with e.g.:
826a8e1175bSopenharmony_ci     "SHARED=1 SOEXT_TLS=so SOEXT_X509=so SOEXT_CRYPTO=so make lib"
827a8e1175bSopenharmony_ci     resulting in library names like "libmbedtls.so" rather than
828a8e1175bSopenharmony_ci     "libmbedcrypto.so.11".
829a8e1175bSopenharmony_ci   * Expose the EC J-PAKE functionality through the Draft PSA PAKE Crypto API.
830a8e1175bSopenharmony_ci     Only the ECC primitive with secp256r1 curve and SHA-256 hash algorithm
831a8e1175bSopenharmony_ci     are supported in this implementation.
832a8e1175bSopenharmony_ci   * Some modules can now use PSA drivers for hashes, including with no
833a8e1175bSopenharmony_ci     built-in implementation present, but only in some configurations.
834a8e1175bSopenharmony_ci     - RSA OAEP and PSS (PKCS#1 v2.1), PKCS5, PKCS12 and EC J-PAKE now use
835a8e1175bSopenharmony_ci       hashes from PSA when (and only when) MBEDTLS_MD_C is disabled.
836a8e1175bSopenharmony_ci     - PEM parsing of encrypted files now uses MD-5 from PSA when (and only
837a8e1175bSopenharmony_ci       when) MBEDTLS_MD5_C is disabled.
838a8e1175bSopenharmony_ci     See the documentation of the corresponding macros in mbedtls_config.h for
839a8e1175bSopenharmony_ci     details.
840a8e1175bSopenharmony_ci     Note that some modules are not able to use hashes from PSA yet, including
841a8e1175bSopenharmony_ci     the entropy module. As a consequence, for now the only way to build with
842a8e1175bSopenharmony_ci     all hashes only provided by drivers (no built-in hash) is to use
843a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG.
844a8e1175bSopenharmony_ci   * When MBEDTLS_USE_PSA_CRYPTO is enabled, X.509, TLS 1.2 and TLS 1.3 now
845a8e1175bSopenharmony_ci     properly negotiate/accept hashes based on their availability in PSA.
846a8e1175bSopenharmony_ci     As a consequence, they now work in configurations where the built-in
847a8e1175bSopenharmony_ci     implementations of (some) hashes are excluded and those hashes are only
848a8e1175bSopenharmony_ci     provided by PSA drivers. (See previous entry for limitation on RSA-PSS
849a8e1175bSopenharmony_ci     though: that module only use hashes from PSA when MBEDTLS_MD_C is off).
850a8e1175bSopenharmony_ci   * Add support for opaque keys as the private keys associated to certificates
851a8e1175bSopenharmony_ci     for authentication in TLS 1.3.
852a8e1175bSopenharmony_ci   * Add the LMS post-quantum-safe stateful-hash asymmetric signature scheme.
853a8e1175bSopenharmony_ci     Signature verification is production-ready, but generation is for testing
854a8e1175bSopenharmony_ci     purposes only. This currently only supports one parameter set
855a8e1175bSopenharmony_ci     (LMS_SHA256_M32_H10), meaning that each private key can be used to sign
856a8e1175bSopenharmony_ci     1024 messages. As such, it is not intended for use in TLS, but instead
857a8e1175bSopenharmony_ci     for verification of assets transmitted over an insecure channel,
858a8e1175bSopenharmony_ci     particularly firmware images.
859a8e1175bSopenharmony_ci   * Add the LM-OTS post-quantum-safe one-time signature scheme, which is
860a8e1175bSopenharmony_ci     required for LMS. This can be used independently, but each key can only
861a8e1175bSopenharmony_ci     be used to sign one message so is impractical for most circumstances.
862a8e1175bSopenharmony_ci   * Mbed TLS now supports TLS 1.3 key establishment via pre-shared keys.
863a8e1175bSopenharmony_ci     The pre-shared keys can be provisioned externally or via the ticket
864a8e1175bSopenharmony_ci     mechanism (session resumption).
865a8e1175bSopenharmony_ci     The ticket mechanism is supported when the configuration option
866a8e1175bSopenharmony_ci     MBEDTLS_SSL_SESSION_TICKETS is enabled.
867a8e1175bSopenharmony_ci     New options MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_xxx_ENABLED
868a8e1175bSopenharmony_ci     control the support for the three possible TLS 1.3 key exchange modes.
869a8e1175bSopenharmony_ci   * cert_write: support for setting extended key usage attributes. A
870a8e1175bSopenharmony_ci     corresponding new public API call has been added in the library,
871a8e1175bSopenharmony_ci     mbedtls_x509write_crt_set_ext_key_usage().
872a8e1175bSopenharmony_ci   * cert_write: support for writing certificate files in either PEM
873a8e1175bSopenharmony_ci     or DER format.
874a8e1175bSopenharmony_ci   * The PSA driver wrapper generator generate_driver_wrappers.py now
875a8e1175bSopenharmony_ci     supports a subset of the driver description language, including
876a8e1175bSopenharmony_ci     the following entry points: import_key, export_key, export_public_key,
877a8e1175bSopenharmony_ci     get_builtin_key, copy_key.
878a8e1175bSopenharmony_ci   * The new functions mbedtls_asn1_free_named_data_list() and
879a8e1175bSopenharmony_ci     mbedtls_asn1_free_named_data_list_shallow() simplify the management
880a8e1175bSopenharmony_ci     of memory in named data lists in X.509 structures.
881a8e1175bSopenharmony_ci   * The TLS 1.2 EC J-PAKE key exchange can now use the PSA Crypto API.
882a8e1175bSopenharmony_ci     Additional PSA key slots will be allocated in the process of such key
883a8e1175bSopenharmony_ci     exchange for builds that enable MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED and
884a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO.
885a8e1175bSopenharmony_ci   * Add support for DTLS Connection ID as defined by RFC 9146, controlled by
886a8e1175bSopenharmony_ci     MBEDTLS_SSL_DTLS_CONNECTION_ID (enabled by default) and configured with
887a8e1175bSopenharmony_ci     mbedtls_ssl_set_cid().
888a8e1175bSopenharmony_ci   * Add a driver dispatch layer for raw key agreement, enabling alternative
889a8e1175bSopenharmony_ci     implementations of raw key agreement through the key_agreement driver
890a8e1175bSopenharmony_ci     entry point. This entry point is specified in the proposed PSA driver
891a8e1175bSopenharmony_ci     interface, but had not yet been implemented.
892a8e1175bSopenharmony_ci   * Add an ad-hoc key derivation function handling EC J-PAKE to PMS
893a8e1175bSopenharmony_ci     calculation that can be used to derive the session secret in TLS 1.2,
894a8e1175bSopenharmony_ci     as described in draft-cragie-tls-ecjpake-01. This can be achieved by
895a8e1175bSopenharmony_ci     using PSA_ALG_TLS12_ECJPAKE_TO_PMS as the key derivation algorithm.
896a8e1175bSopenharmony_ci
897a8e1175bSopenharmony_ciSecurity
898a8e1175bSopenharmony_ci   * Fix potential heap buffer overread and overwrite in DTLS if
899a8e1175bSopenharmony_ci     MBEDTLS_SSL_DTLS_CONNECTION_ID is enabled and
900a8e1175bSopenharmony_ci     MBEDTLS_SSL_CID_IN_LEN_MAX > 2 * MBEDTLS_SSL_CID_OUT_LEN_MAX.
901a8e1175bSopenharmony_ci   * Fix an issue where an adversary with access to precise enough information
902a8e1175bSopenharmony_ci     about memory accesses (typically, an untrusted operating system attacking
903a8e1175bSopenharmony_ci     a secure enclave) could recover an RSA private key after observing the
904a8e1175bSopenharmony_ci     victim performing a single private-key operation if the window size used
905a8e1175bSopenharmony_ci     for the exponentiation was 3 or smaller. Found and reported by Zili KOU,
906a8e1175bSopenharmony_ci     Wenjian HE, Sharad Sinha, and Wei ZHANG. See "Cache Side-channel Attacks
907a8e1175bSopenharmony_ci     and Defenses of the Sliding Window Algorithm in TEEs" - Design, Automation
908a8e1175bSopenharmony_ci     and Test in Europe 2023.
909a8e1175bSopenharmony_ci
910a8e1175bSopenharmony_ciBugfix
911a8e1175bSopenharmony_ci   * Refactor mbedtls_aes_context to support shallow-copying. Fixes #2147.
912a8e1175bSopenharmony_ci   * Fix an issue with in-tree CMake builds in releases with GEN_FILES
913a8e1175bSopenharmony_ci     turned off: if a shipped file was missing from the working directory,
914a8e1175bSopenharmony_ci     it could be turned into a symbolic link to itself.
915a8e1175bSopenharmony_ci   * Fix a long-standing build failure when building x86 PIC code with old
916a8e1175bSopenharmony_ci     gcc (4.x). The code will be slower, but will compile. We do however
917a8e1175bSopenharmony_ci     recommend upgrading to a more recent compiler instead. Fixes #1910.
918a8e1175bSopenharmony_ci   * Fix support for little-endian Microblaze when MBEDTLS_HAVE_ASM is defined.
919a8e1175bSopenharmony_ci     Contributed by Kazuyuki Kimura to fix #2020.
920a8e1175bSopenharmony_ci   * Use double quotes to include private header file psa_crypto_cipher.h.
921a8e1175bSopenharmony_ci     Fixes 'file not found with <angled> include' error
922a8e1175bSopenharmony_ci     when building with Xcode.
923a8e1175bSopenharmony_ci   * Fix handling of broken symlinks when loading certificates using
924a8e1175bSopenharmony_ci     mbedtls_x509_crt_parse_path(). Instead of returning an error as soon as a
925a8e1175bSopenharmony_ci     broken link is encountered, skip the broken link and continue parsing
926a8e1175bSopenharmony_ci     other certificate files. Contributed by Eduardo Silva in #2602.
927a8e1175bSopenharmony_ci   * Fix an interoperability failure between an Mbed TLS client with both
928a8e1175bSopenharmony_ci     TLS 1.2 and TLS 1.3 support, and a TLS 1.2 server that supports
929a8e1175bSopenharmony_ci     rsa_pss_rsae_* signature algorithms. This failed because Mbed TLS
930a8e1175bSopenharmony_ci     advertised support for PSS in both TLS 1.2 and 1.3, but only
931a8e1175bSopenharmony_ci     actually supported PSS in TLS 1.3.
932a8e1175bSopenharmony_ci   * Fix a compilation error when using CMake with an IAR toolchain.
933a8e1175bSopenharmony_ci     Fixes #5964.
934a8e1175bSopenharmony_ci   * Fix a build error due to a missing prototype warning when
935a8e1175bSopenharmony_ci     MBEDTLS_DEPRECATED_REMOVED is enabled.
936a8e1175bSopenharmony_ci   * Fix mbedtls_ctr_drbg_free() on an initialized but unseeded context. When
937a8e1175bSopenharmony_ci     MBEDTLS_AES_ALT is enabled, it could call mbedtls_aes_free() on an
938a8e1175bSopenharmony_ci     uninitialized context.
939a8e1175bSopenharmony_ci   * Fix a build issue on Windows using CMake where the source and build
940a8e1175bSopenharmony_ci     directories could not be on different drives. Fixes #5751.
941a8e1175bSopenharmony_ci   * Fix bugs and missing dependencies when building and testing
942a8e1175bSopenharmony_ci     configurations with only one encryption type enabled in TLS 1.2.
943a8e1175bSopenharmony_ci   * Provide the missing definition of mbedtls_setbuf() in some configurations
944a8e1175bSopenharmony_ci     with MBEDTLS_PLATFORM_C disabled. Fixes #6118, #6196.
945a8e1175bSopenharmony_ci   * Fix compilation errors when trying to build with
946a8e1175bSopenharmony_ci     PSA drivers for AEAD (GCM, CCM, Chacha20-Poly1305).
947a8e1175bSopenharmony_ci   * Fix memory leak in ssl_parse_certificate_request() caused by
948a8e1175bSopenharmony_ci     mbedtls_x509_get_name() not freeing allocated objects in case of error.
949a8e1175bSopenharmony_ci     Change mbedtls_x509_get_name() to clean up allocated objects on error.
950a8e1175bSopenharmony_ci   * Fix build failure with MBEDTLS_RSA_C and MBEDTLS_PSA_CRYPTO_C but not
951a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO or MBEDTLS_PK_WRITE_C. Fixes #6408.
952a8e1175bSopenharmony_ci   * Fix build failure with MBEDTLS_RSA_C and MBEDTLS_PSA_CRYPTO_C but not
953a8e1175bSopenharmony_ci     MBEDTLS_PK_PARSE_C. Fixes #6409.
954a8e1175bSopenharmony_ci   * Fix ECDSA verification, where it was not always validating the
955a8e1175bSopenharmony_ci     public key. This bug meant that it was possible to verify a
956a8e1175bSopenharmony_ci     signature with an invalid public key, in some cases. Reported by
957a8e1175bSopenharmony_ci     Guido Vranken using Cryptofuzz in #4420.
958a8e1175bSopenharmony_ci   * Fix a possible null pointer dereference if a memory allocation fails
959a8e1175bSopenharmony_ci     in TLS PRF code. Reported by Michael Madsen in #6516.
960a8e1175bSopenharmony_ci   * Fix TLS 1.3 session resumption. Fixes #6488.
961a8e1175bSopenharmony_ci   * Add a configuration check to exclude optional client authentication
962a8e1175bSopenharmony_ci     in TLS 1.3 (where it is forbidden).
963a8e1175bSopenharmony_ci   * Fix a bug in which mbedtls_x509_crt_info() would produce non-printable
964a8e1175bSopenharmony_ci     bytes when parsing certificates containing a binary RFC 4108
965a8e1175bSopenharmony_ci     HardwareModuleName as a Subject Alternative Name extension. Hardware
966a8e1175bSopenharmony_ci     serial numbers are now rendered in hex format. Fixes #6262.
967a8e1175bSopenharmony_ci   * Fix bug in error reporting in dh_genprime.c where upon failure,
968a8e1175bSopenharmony_ci     the error code returned by mbedtls_mpi_write_file() is overwritten
969a8e1175bSopenharmony_ci     and therefore not printed.
970a8e1175bSopenharmony_ci   * In the bignum module, operations of the form (-A) - (+A) or (-A) - (-A)
971a8e1175bSopenharmony_ci     with A > 0 created an unintended representation of the value 0 which was
972a8e1175bSopenharmony_ci     not processed correctly by some bignum operations. Fix this. This had no
973a8e1175bSopenharmony_ci     consequence on cryptography code, but might affect applications that call
974a8e1175bSopenharmony_ci     bignum directly and use negative numbers.
975a8e1175bSopenharmony_ci   * Fix a bug whereby the list of signature algorithms sent as part of
976a8e1175bSopenharmony_ci     the TLS 1.2 server certificate request would get corrupted, meaning the
977a8e1175bSopenharmony_ci     first algorithm would not get sent and an entry consisting of two random
978a8e1175bSopenharmony_ci     bytes would be sent instead. Found by Serban Bejan and Dudek Sebastian.
979a8e1175bSopenharmony_ci   * Fix undefined behavior (typically harmless in practice) of
980a8e1175bSopenharmony_ci     mbedtls_mpi_add_mpi(), mbedtls_mpi_add_abs() and mbedtls_mpi_add_int()
981a8e1175bSopenharmony_ci     when both operands are 0 and the left operand is represented with 0 limbs.
982a8e1175bSopenharmony_ci   * Fix undefined behavior (typically harmless in practice) when some bignum
983a8e1175bSopenharmony_ci     functions receive the most negative value of mbedtls_mpi_sint. Credit
984a8e1175bSopenharmony_ci     to OSS-Fuzz. Fixes #6597.
985a8e1175bSopenharmony_ci   * Fix undefined behavior (typically harmless in practice) in PSA ECB
986a8e1175bSopenharmony_ci     encryption and decryption.
987a8e1175bSopenharmony_ci   * Move some SSL-specific code out of libmbedcrypto where it had been placed
988a8e1175bSopenharmony_ci     accidentally.
989a8e1175bSopenharmony_ci   * Fix a build error when compiling the bignum module for some Arm platforms.
990a8e1175bSopenharmony_ci     Fixes #6089, #6124, #6217.
991a8e1175bSopenharmony_ci
992a8e1175bSopenharmony_ciChanges
993a8e1175bSopenharmony_ci   * Add the ability to query PSA_WANT_xxx macros to query_compile_time_config.
994a8e1175bSopenharmony_ci   * Calling AEAD tag-specific functions for non-AEAD algorithms (which
995a8e1175bSopenharmony_ci     should not be done - they are documented for use only by AES-GCM and
996a8e1175bSopenharmony_ci     ChaCha20+Poly1305) now returns MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE
997a8e1175bSopenharmony_ci     instead of success (0).
998a8e1175bSopenharmony_ci
999a8e1175bSopenharmony_ci= Mbed TLS 3.2.1 branch released 2022-07-12
1000a8e1175bSopenharmony_ci
1001a8e1175bSopenharmony_ciBugfix
1002a8e1175bSopenharmony_ci   *  Re-add missing generated file library/psa_crypto_driver_wrappers.c
1003a8e1175bSopenharmony_ci
1004a8e1175bSopenharmony_ci= Mbed TLS 3.2.0 branch released 2022-07-11
1005a8e1175bSopenharmony_ci
1006a8e1175bSopenharmony_ciDefault behavior changes
1007a8e1175bSopenharmony_ci   * mbedtls_cipher_set_iv will now fail with ChaCha20 and ChaCha20+Poly1305
1008a8e1175bSopenharmony_ci     for IV lengths other than 12. The library was silently overwriting this
1009a8e1175bSopenharmony_ci     length with 12, but did not inform the caller about it. Fixes #4301.
1010a8e1175bSopenharmony_ci
1011a8e1175bSopenharmony_ciRequirement changes
1012a8e1175bSopenharmony_ci   * The library will no longer compile out of the box on a platform without
1013a8e1175bSopenharmony_ci     setbuf(). If your platform does not have setbuf(), you can configure an
1014a8e1175bSopenharmony_ci     alternative function by enabling MBEDTLS_PLATFORM_SETBUF_ALT or
1015a8e1175bSopenharmony_ci     MBEDTLS_PLATFORM_SETBUF_MACRO.
1016a8e1175bSopenharmony_ci
1017a8e1175bSopenharmony_ciNew deprecations
1018a8e1175bSopenharmony_ci   * Deprecate mbedtls_ssl_conf_max_version() and
1019a8e1175bSopenharmony_ci     mbedtls_ssl_conf_min_version() in favor of
1020a8e1175bSopenharmony_ci     mbedtls_ssl_conf_max_tls_version() and
1021a8e1175bSopenharmony_ci     mbedtls_ssl_conf_min_tls_version().
1022a8e1175bSopenharmony_ci   * Deprecate mbedtls_cipher_setup_psa(). Use psa_aead_xxx() or
1023a8e1175bSopenharmony_ci     psa_cipher_xxx() directly instead.
1024a8e1175bSopenharmony_ci   * Secure element drivers enabled by MBEDTLS_PSA_CRYPTO_SE_C are deprecated.
1025a8e1175bSopenharmony_ci     This was intended as an experimental feature, but had not been explicitly
1026a8e1175bSopenharmony_ci     documented as such. Use opaque drivers with the interface enabled by
1027a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_DRIVERS instead.
1028a8e1175bSopenharmony_ci   * Deprecate mbedtls_ssl_conf_sig_hashes() in favor of the more generic
1029a8e1175bSopenharmony_ci     mbedtls_ssl_conf_sig_algs(). Signature algorithms for the TLS 1.2 and
1030a8e1175bSopenharmony_ci     TLS 1.3 handshake should now be configured with
1031a8e1175bSopenharmony_ci     mbedtls_ssl_conf_sig_algs().
1032a8e1175bSopenharmony_ci
1033a8e1175bSopenharmony_ciFeatures
1034a8e1175bSopenharmony_ci   * Add accessor to obtain ciphersuite id from ssl context.
1035a8e1175bSopenharmony_ci   * Add accessors to get members from ciphersuite info.
1036a8e1175bSopenharmony_ci   * Add mbedtls_ssl_ticket_rotate() for external ticket rotation.
1037a8e1175bSopenharmony_ci   * Add accessor to get the raw buffer pointer from a PEM context.
1038a8e1175bSopenharmony_ci   * The structures mbedtls_ssl_config and mbedtls_ssl_context now store
1039a8e1175bSopenharmony_ci     a piece of user data which is reserved for the application. The user
1040a8e1175bSopenharmony_ci     data can be either a pointer or an integer.
1041a8e1175bSopenharmony_ci   * Add an accessor function to get the configuration associated with
1042a8e1175bSopenharmony_ci     an SSL context.
1043a8e1175bSopenharmony_ci   * Add a function to access the protocol version from an SSL context in a
1044a8e1175bSopenharmony_ci     form that's easy to compare. Fixes #5407.
1045a8e1175bSopenharmony_ci   * Add function mbedtls_md_info_from_ctx() to recall the message digest
1046a8e1175bSopenharmony_ci     information that was used to set up a message digest context.
1047a8e1175bSopenharmony_ci   * Add ALPN support in TLS 1.3 clients.
1048a8e1175bSopenharmony_ci   * Add server certificate selection callback near end of Client Hello.
1049a8e1175bSopenharmony_ci     Register callback with mbedtls_ssl_conf_cert_cb().
1050a8e1175bSopenharmony_ci   * Provide mechanism to reset handshake cert list by calling
1051a8e1175bSopenharmony_ci     mbedtls_ssl_set_hs_own_cert() with NULL value for own_cert param.
1052a8e1175bSopenharmony_ci   * Add accessor mbedtls_ssl_get_hs_sni() to retrieve SNI from within
1053a8e1175bSopenharmony_ci     cert callback (mbedtls_ssl_conf_cert_cb()) during handshake.
1054a8e1175bSopenharmony_ci   * The X.509 module now uses PSA hash acceleration if present.
1055a8e1175bSopenharmony_ci   * Add support for psa crypto key derivation for elliptic curve
1056a8e1175bSopenharmony_ci     keys. Fixes #3260.
1057a8e1175bSopenharmony_ci   * Add function mbedtls_timing_get_final_delay() to access the private
1058a8e1175bSopenharmony_ci     final delay field in an mbedtls_timing_delay_context, as requested in
1059a8e1175bSopenharmony_ci     #5183.
1060a8e1175bSopenharmony_ci    * Add mbedtls_pk_sign_ext() which allows generating RSA-PSS signatures when
1061a8e1175bSopenharmony_ci      PSA Crypto is enabled.
1062a8e1175bSopenharmony_ci   * Add function mbedtls_ecp_export() to export ECP key pair parameters.
1063a8e1175bSopenharmony_ci     Fixes #4838.
1064a8e1175bSopenharmony_ci   * Add function mbedtls_ssl_is_handshake_over() to enable querying if the SSL
1065a8e1175bSopenharmony_ci     Handshake has completed or not, and thus whether to continue calling
1066a8e1175bSopenharmony_ci     mbedtls_ssl_handshake_step(), requested in #4383.
1067a8e1175bSopenharmony_ci   * Add the function mbedtls_ssl_get_own_cid() to access our own connection id
1068a8e1175bSopenharmony_ci     within mbedtls_ssl_context, as requested in #5184.
1069a8e1175bSopenharmony_ci   * Introduce mbedtls_ssl_hs_cb_t typedef for use with
1070a8e1175bSopenharmony_ci     mbedtls_ssl_conf_cert_cb() and perhaps future callbacks
1071a8e1175bSopenharmony_ci     during TLS handshake.
1072a8e1175bSopenharmony_ci   * Add functions mbedtls_ssl_conf_max_tls_version() and
1073a8e1175bSopenharmony_ci     mbedtls_ssl_conf_min_tls_version() that use a single value to specify
1074a8e1175bSopenharmony_ci     the protocol version.
1075a8e1175bSopenharmony_ci    * Extend the existing PSA_ALG_TLS12_PSK_TO_MS() algorithm to support
1076a8e1175bSopenharmony_ci      mixed-PSK. Add an optional input PSA_KEY_DERIVATION_INPUT_OTHER_SECRET
1077a8e1175bSopenharmony_ci      holding the other secret.
1078a8e1175bSopenharmony_ci   * When MBEDTLS_PSA_CRYPTO_CONFIG is enabled, you may list the PSA crypto
1079a8e1175bSopenharmony_ci     feature requirements in the file named by the new macro
1080a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_CONFIG_FILE instead of the default psa/crypto_config.h.
1081a8e1175bSopenharmony_ci     Furthermore you may name an additional file to include after the main
1082a8e1175bSopenharmony_ci     file with the macro MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE.
1083a8e1175bSopenharmony_ci   * Add the function mbedtls_x509_crt_has_ext_type() to access the ext types
1084a8e1175bSopenharmony_ci     field within mbedtls_x509_crt context, as requested in #5585.
1085a8e1175bSopenharmony_ci   * Add HKDF-Expand and HKDF-Extract as separate algorithms in the PSA API.
1086a8e1175bSopenharmony_ci   * Add support for the ARMv8 SHA-2 acceleration instructions when building
1087a8e1175bSopenharmony_ci     for Aarch64.
1088a8e1175bSopenharmony_ci   * Add support for authentication of TLS 1.3 clients by TLS 1.3 servers.
1089a8e1175bSopenharmony_ci   * Add support for server HelloRetryRequest message. The TLS 1.3 client is
1090a8e1175bSopenharmony_ci     now capable of negotiating another shared secret if the one sent in its
1091a8e1175bSopenharmony_ci     first ClientHello was not suitable to the server.
1092a8e1175bSopenharmony_ci   * Add support for client-side TLS version negotiation. If both TLS 1.2 and
1093a8e1175bSopenharmony_ci     TLS 1.3 protocols are enabled in the build of Mbed TLS, the TLS client now
1094a8e1175bSopenharmony_ci     negotiates TLS 1.3 or TLS 1.2 with TLS servers.
1095a8e1175bSopenharmony_ci   * Enable building of Mbed TLS with TLS 1.3 protocol support but without TLS
1096a8e1175bSopenharmony_ci     1.2 protocol support.
1097a8e1175bSopenharmony_ci   * Mbed TLS provides an implementation of a TLS 1.3 server (ephemeral key
1098a8e1175bSopenharmony_ci     establishment only). See docs/architecture/tls13-support.md for a
1099a8e1175bSopenharmony_ci     description of the support. The MBEDTLS_SSL_PROTO_TLS1_3 and
1100a8e1175bSopenharmony_ci     MBEDTLS_SSL_SRV_C configuration options control this.
1101a8e1175bSopenharmony_ci   * Add accessors to configure DN hints for certificate request:
1102a8e1175bSopenharmony_ci     mbedtls_ssl_conf_dn_hints() and mbedtls_ssl_set_hs_dn_hints()
1103a8e1175bSopenharmony_ci   * The configuration option MBEDTLS_USE_PSA_CRYPTO, which previously
1104a8e1175bSopenharmony_ci     affected only a limited subset of crypto operations in TLS, X.509 and PK,
1105a8e1175bSopenharmony_ci     now causes most of them to be done using PSA Crypto; see
1106a8e1175bSopenharmony_ci     docs/use-psa-crypto.md for the list of exceptions.
1107a8e1175bSopenharmony_ci   * The function mbedtls_pk_setup_opaque() now supports RSA key pairs as well.
1108a8e1175bSopenharmony_ci     Opaque keys can now be used everywhere a private key is expected in the
1109a8e1175bSopenharmony_ci     TLS and X.509 modules.
1110a8e1175bSopenharmony_ci   * Opaque pre-shared keys for TLS, provisioned with
1111a8e1175bSopenharmony_ci     mbedtls_ssl_conf_psk_opaque() or mbedtls_ssl_set_hs_psk_opaque(), which
1112a8e1175bSopenharmony_ci     previously only worked for "pure" PSK key exchange, now can also be used
1113a8e1175bSopenharmony_ci     for the "mixed" PSK key exchanges as well: ECDHE-PSK, DHE-PSK, RSA-PSK.
1114a8e1175bSopenharmony_ci   * cmake now detects if it is being built as a sub-project, and in that case
1115a8e1175bSopenharmony_ci     disables the target export/installation and package configuration.
1116a8e1175bSopenharmony_ci   * Make USE_PSA_CRYPTO compatible with KEY_ID_ENCODES_OWNER. Fixes #5259.
1117a8e1175bSopenharmony_ci   * Add example programs cipher_aead_demo.c, md_hmac_demo.c, aead_demo.c
1118a8e1175bSopenharmony_ci     and hmac_demo.c, which use PSA and the md/cipher interfaces side
1119a8e1175bSopenharmony_ci     by side in order to illustrate how the operation is performed in PSA.
1120a8e1175bSopenharmony_ci     Addresses #5208.
1121a8e1175bSopenharmony_ci
1122a8e1175bSopenharmony_ciSecurity
1123a8e1175bSopenharmony_ci   * Zeroize dynamically-allocated buffers used by the PSA Crypto key storage
1124a8e1175bSopenharmony_ci     module before freeing them. These buffers contain secret key material, and
1125a8e1175bSopenharmony_ci     could thus potentially leak the key through freed heap.
1126a8e1175bSopenharmony_ci   * Fix potential memory leak inside mbedtls_ssl_cache_set() with
1127a8e1175bSopenharmony_ci     an invalid session id length.
1128a8e1175bSopenharmony_ci   * Add the platform function mbedtls_setbuf() to allow buffering to be
1129a8e1175bSopenharmony_ci     disabled on stdio files, to stop secrets loaded from said files being
1130a8e1175bSopenharmony_ci     potentially left in memory after file operations. Reported by
1131a8e1175bSopenharmony_ci     Glenn Strauss.
1132a8e1175bSopenharmony_ci   * Fix a potential heap buffer overread in TLS 1.2 server-side when
1133a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO is enabled, an opaque key (created with
1134a8e1175bSopenharmony_ci     mbedtls_pk_setup_opaque()) is provisioned, and a static ECDH ciphersuite
1135a8e1175bSopenharmony_ci     is selected. This may result in an application crash or potentially an
1136a8e1175bSopenharmony_ci     information leak.
1137a8e1175bSopenharmony_ci   * Fix a buffer overread in DTLS ClientHello parsing in servers with
1138a8e1175bSopenharmony_ci     MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE enabled. An unauthenticated client
1139a8e1175bSopenharmony_ci     or a man-in-the-middle could cause a DTLS server to read up to 255 bytes
1140a8e1175bSopenharmony_ci     after the end of the SSL input buffer. The buffer overread only happens
1141a8e1175bSopenharmony_ci     when MBEDTLS_SSL_IN_CONTENT_LEN is less than a threshold that depends on
1142a8e1175bSopenharmony_ci     the exact configuration: 258 bytes if using mbedtls_ssl_cookie_check(),
1143a8e1175bSopenharmony_ci     and possibly up to 571 bytes with a custom cookie check function.
1144a8e1175bSopenharmony_ci     Reported by the Cybeats PSI Team.
1145a8e1175bSopenharmony_ci    * Fix a buffer overread in TLS 1.3 Certificate parsing. An unauthenticated
1146a8e1175bSopenharmony_ci      client or server could cause an MbedTLS server or client to overread up
1147a8e1175bSopenharmony_ci      to 64 kBytes of data and potentially overread the input buffer by that
1148a8e1175bSopenharmony_ci      amount minus the size of the input buffer. As overread data undergoes
1149a8e1175bSopenharmony_ci      various checks, the likelihood of reaching the boundary of the input
1150a8e1175bSopenharmony_ci      buffer is rather small but increases as its size
1151a8e1175bSopenharmony_ci      MBEDTLS_SSL_IN_CONTENT_LEN decreases.
1152a8e1175bSopenharmony_ci   * Fix check of certificate key usage in TLS 1.3. The usage of the public key
1153a8e1175bSopenharmony_ci     provided by a client or server certificate for authentication was not
1154a8e1175bSopenharmony_ci     checked properly when validating the certificate. This could cause a
1155a8e1175bSopenharmony_ci     client or server to be able to authenticate itself through a certificate
1156a8e1175bSopenharmony_ci     to an Mbed TLS TLS 1.3 server or client while it does not own a proper
1157a8e1175bSopenharmony_ci     certificate to do so.
1158a8e1175bSopenharmony_ci
1159a8e1175bSopenharmony_ciBugfix
1160a8e1175bSopenharmony_ci   * Declare or use PSA_WANT_ALG_CCM_STAR_NO_TAG following the general
1161a8e1175bSopenharmony_ci     pattern for PSA_WANT_xxx symbols. Previously you had to specify
1162a8e1175bSopenharmony_ci     PSA_WANT_ALG_CCM for PSA_ALG_CCM_STAR_NO_TAG.
1163a8e1175bSopenharmony_ci   * Fix a memory leak if mbedtls_ssl_config_defaults() is called twice.
1164a8e1175bSopenharmony_ci   * Fixed swap of client and server random bytes when exporting them alongside
1165a8e1175bSopenharmony_ci     TLS 1.3 handshake and application traffic secret.
1166a8e1175bSopenharmony_ci   * Fix several bugs (warnings, compiler and linker errors, test failures)
1167a8e1175bSopenharmony_ci     in reduced configurations when MBEDTLS_USE_PSA_CRYPTO is enabled.
1168a8e1175bSopenharmony_ci   * Fix a bug in (D)TLS curve negotiation: when MBEDTLS_USE_PSA_CRYPTO was
1169a8e1175bSopenharmony_ci     enabled and an ECDHE-ECDSA or ECDHE-RSA key exchange was used, the
1170a8e1175bSopenharmony_ci     client would fail to check that the curve selected by the server for
1171a8e1175bSopenharmony_ci     ECDHE was indeed one that was offered. As a result, the client would
1172a8e1175bSopenharmony_ci     accept any curve that it supported, even if that curve was not allowed
1173a8e1175bSopenharmony_ci     according to its configuration. Fixes #5291.
1174a8e1175bSopenharmony_ci   * The TLS 1.3 implementation is now compatible with the
1175a8e1175bSopenharmony_ci     MBEDTLS_USE_PSA_CRYPTO configuration option.
1176a8e1175bSopenharmony_ci   * Fix unit tests that used 0 as the file UID. This failed on some
1177a8e1175bSopenharmony_ci     implementations of PSA ITS. Fixes #3838.
1178a8e1175bSopenharmony_ci   * Fix mbedtls_ssl_get_version() not reporting TLSv1.3. Fixes #5406.
1179a8e1175bSopenharmony_ci   * Fix API violation in mbedtls_md_process() test by adding a call to
1180a8e1175bSopenharmony_ci     mbedtls_md_starts(). Fixes #2227.
1181a8e1175bSopenharmony_ci   * Fix compile errors when MBEDTLS_HAVE_TIME is not defined. Add tests
1182a8e1175bSopenharmony_ci     to catch bad uses of time.h.
1183a8e1175bSopenharmony_ci   * Fix a race condition in out-of-source builds with CMake when generated data
1184a8e1175bSopenharmony_ci     files are already present. Fixes #5374.
1185a8e1175bSopenharmony_ci   * Fix the library search path when building a shared library with CMake
1186a8e1175bSopenharmony_ci     on Windows.
1187a8e1175bSopenharmony_ci   * Fix bug in the alert sending function mbedtls_ssl_send_alert_message()
1188a8e1175bSopenharmony_ci     potentially leading to corrupted alert messages being sent in case
1189a8e1175bSopenharmony_ci     the function needs to be re-called after initially returning
1190a8e1175bSopenharmony_ci     MBEDTLS_SSL_WANT_WRITE. Fixes #1916.
1191a8e1175bSopenharmony_ci   * In configurations with MBEDTLS_SSL_DTLS_CONNECTION_ID enabled but not
1192a8e1175bSopenharmony_ci     MBEDTLS_DEBUG_C, DTLS handshakes using CID would crash due to a null
1193a8e1175bSopenharmony_ci     pointer dereference. Fix this. Fixes #3998.
1194a8e1175bSopenharmony_ci     The fix was released, but not announced, in Mbed TLS 3.1.0.
1195a8e1175bSopenharmony_ci   * Fix incorrect documentation of mbedtls_x509_crt_profile. The previous
1196a8e1175bSopenharmony_ci     documentation stated that the `allowed_pks` field applies to signatures
1197a8e1175bSopenharmony_ci     only, but in fact it does apply to the public key type of the end entity
1198a8e1175bSopenharmony_ci     certificate, too. Fixes #1992.
1199a8e1175bSopenharmony_ci   * Fix undefined behavior in mbedtls_asn1_find_named_data(), where val is
1200a8e1175bSopenharmony_ci     not NULL and val_len is zero.
1201a8e1175bSopenharmony_ci   * Fix compilation error with mingw32. Fixed by Cameron Cawley in #4211.
1202a8e1175bSopenharmony_ci   * Fix compilation error when using C++ Builder on Windows. Reported by
1203a8e1175bSopenharmony_ci     Miroslav Mastny in #4015.
1204a8e1175bSopenharmony_ci   * psa_raw_key_agreement() now returns PSA_ERROR_BUFFER_TOO_SMALL when
1205a8e1175bSopenharmony_ci     applicable. Fixes #5735.
1206a8e1175bSopenharmony_ci   * Fix a bug in the x25519 example program where the removal of
1207a8e1175bSopenharmony_ci     MBEDTLS_ECDH_LEGACY_CONTEXT caused the program not to run. Fixes #4901 and
1208a8e1175bSopenharmony_ci     #3191.
1209a8e1175bSopenharmony_ci   * Fix a TLS 1.3 handshake failure when the peer Finished message has not
1210a8e1175bSopenharmony_ci     been received yet when we first try to fetch it.
1211a8e1175bSopenharmony_ci   * Encode X.509 dates before 1/1/2000 as UTCTime rather than
1212a8e1175bSopenharmony_ci     GeneralizedTime. Fixes #5465.
1213a8e1175bSopenharmony_ci   * Add mbedtls_x509_dn_get_next function to return the next relative DN in
1214a8e1175bSopenharmony_ci     an X509 name, to allow walking the name list. Fixes #5431.
1215a8e1175bSopenharmony_ci    * Fix order value of curve x448.
1216a8e1175bSopenharmony_ci   * Fix string representation of DNs when outputting values containing commas
1217a8e1175bSopenharmony_ci     and other special characters, conforming to RFC 1779. Fixes #769.
1218a8e1175bSopenharmony_ci   * Silence a warning from GCC 12 in the selftest program. Fixes #5974.
1219a8e1175bSopenharmony_ci   * Fix check_config.h to check that we have MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
1220a8e1175bSopenharmony_ci     when MBEDTLS_SSL_PROTO_TLS1_3 is specified, and make this and other
1221a8e1175bSopenharmony_ci     dependencies explicit in the documentation. Fixes #5610.
1222a8e1175bSopenharmony_ci   * Fix mbedtls_asn1_write_mpi() writing an incorrect encoding of 0.
1223a8e1175bSopenharmony_ci   * Fix a TLS 1.3 handshake failure when the first attempt to send the client
1224a8e1175bSopenharmony_ci     Finished message on the network cannot be satisfied. Fixes #5499.
1225a8e1175bSopenharmony_ci   * Fix resource leaks in mbedtls_pk_parse_public_key() in low
1226a8e1175bSopenharmony_ci     memory conditions.
1227a8e1175bSopenharmony_ci   * Fix server connection identifier setting for outgoing encrypted records
1228a8e1175bSopenharmony_ci     on DTLS 1.2 session resumption. After DTLS 1.2 session resumption with
1229a8e1175bSopenharmony_ci     connection identifier, the Mbed TLS client now properly sends the server
1230a8e1175bSopenharmony_ci     connection identifier in encrypted record headers. Fix #5872.
1231a8e1175bSopenharmony_ci   * Fix a null pointer dereference when performing some operations on zero
1232a8e1175bSopenharmony_ci     represented with 0 limbs (specifically mbedtls_mpi_mod_int() dividing
1233a8e1175bSopenharmony_ci     by 2, and mbedtls_mpi_write_string() in base 2).
1234a8e1175bSopenharmony_ci   * Fix record sizes larger than 16384 being sometimes accepted despite being
1235a8e1175bSopenharmony_ci     non-compliant. This could not lead to a buffer overflow. In particular,
1236a8e1175bSopenharmony_ci     application data size was already checked correctly.
1237a8e1175bSopenharmony_ci   * Fix MBEDTLS_SVC_KEY_ID_GET_KEY_ID() and MBEDTLS_SVC_KEY_ID_GET_OWNER_ID()
1238a8e1175bSopenharmony_ci     which have been broken, resulting in compilation errors, since Mbed TLS
1239a8e1175bSopenharmony_ci     3.0.
1240a8e1175bSopenharmony_ci   * Ensure that TLS 1.2 ciphersuite/certificate and key selection takes into
1241a8e1175bSopenharmony_ci     account not just the type of the key (RSA vs EC) but also what it can
1242a8e1175bSopenharmony_ci     actually do. Resolves #5831.
1243a8e1175bSopenharmony_ci   * Fix CMake windows host detection, especially when cross compiling.
1244a8e1175bSopenharmony_ci   * Fix an error in make where the absence of a generated file caused
1245a8e1175bSopenharmony_ci     make to break on a clean checkout. Fixes #5340.
1246a8e1175bSopenharmony_ci   * Work around an MSVC ARM64 compiler bug causing incorrect behaviour
1247a8e1175bSopenharmony_ci     in mbedtls_mpi_exp_mod(). Reported by Tautvydas Žilys in #5467.
1248a8e1175bSopenharmony_ci   * Removed the prompt to exit from all windows build programs, which was causing
1249a8e1175bSopenharmony_ci     issues in CI/CD environments.
1250a8e1175bSopenharmony_ci
1251a8e1175bSopenharmony_ciChanges
1252a8e1175bSopenharmony_ci   * The file library/psa_crypto_driver_wrappers.c is now generated
1253a8e1175bSopenharmony_ci     from a template. In the future, the generation will support
1254a8e1175bSopenharmony_ci     driver descriptions. For the time being, to customize this file,
1255a8e1175bSopenharmony_ci     see docs/proposed/psa-driver-wrappers-codegen-migration-guide.md
1256a8e1175bSopenharmony_ci   * Return PSA_ERROR_INVALID_ARGUMENT if the algorithm passed to one-shot
1257a8e1175bSopenharmony_ci     AEAD functions is not an AEAD algorithm. This aligns them with the
1258a8e1175bSopenharmony_ci     multipart functions, and the PSA Crypto API 1.1 specification.
1259a8e1175bSopenharmony_ci   * In mbedtls_pk_parse_key(), if no password is provided, don't allocate a
1260a8e1175bSopenharmony_ci     temporary variable on the heap. Suggested by Sergey Kanatov in #5304.
1261a8e1175bSopenharmony_ci   * Assume source files are in UTF-8 when using MSVC with CMake.
1262a8e1175bSopenharmony_ci   * Fix runtime library install location when building with CMake and MinGW.
1263a8e1175bSopenharmony_ci     DLLs are now installed in the bin directory instead of lib.
1264a8e1175bSopenharmony_ci   * cmake: Use GnuInstallDirs to customize install directories
1265a8e1175bSopenharmony_ci     Replace custom LIB_INSTALL_DIR variable with standard CMAKE_INSTALL_LIBDIR
1266a8e1175bSopenharmony_ci     variable. For backward compatibility, set CMAKE_INSTALL_LIBDIR if
1267a8e1175bSopenharmony_ci     LIB_INSTALL_DIR is set.
1268a8e1175bSopenharmony_ci   * Add a CMake option that enables static linking of the runtime library
1269a8e1175bSopenharmony_ci     in Microsoft Visual C++ compiler. Contributed by Microplankton.
1270a8e1175bSopenharmony_ci   * In CMake builds, add aliases for libraries so that the normal MbedTLS::*
1271a8e1175bSopenharmony_ci     targets work when MbedTLS is built as a subdirectory. This allows the
1272a8e1175bSopenharmony_ci     use of FetchContent, as requested in #5688.
1273a8e1175bSopenharmony_ci
1274a8e1175bSopenharmony_ci= mbed TLS 3.1.0 branch released 2021-12-17
1275a8e1175bSopenharmony_ci
1276a8e1175bSopenharmony_ciAPI changes
1277a8e1175bSopenharmony_ci   * New error code for GCM: MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL.
1278a8e1175bSopenharmony_ci     Alternative GCM implementations are expected to verify
1279a8e1175bSopenharmony_ci     the length of the provided output buffers and to return the
1280a8e1175bSopenharmony_ci     MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL in case the buffer length is too small.
1281a8e1175bSopenharmony_ci   * You can configure groups for a TLS key exchange with the new function
1282a8e1175bSopenharmony_ci     mbedtls_ssl_conf_groups(). It extends mbedtls_ssl_conf_curves().
1283a8e1175bSopenharmony_ci   * Declare a number of structure fields as public: the fields of
1284a8e1175bSopenharmony_ci     mbedtls_ecp_curve_info, the fields describing the result of ASN.1 and
1285a8e1175bSopenharmony_ci     X.509 parsing, and finally the field fd of mbedtls_net_context on
1286a8e1175bSopenharmony_ci     POSIX/Unix-like platforms.
1287a8e1175bSopenharmony_ci
1288a8e1175bSopenharmony_ciRequirement changes
1289a8e1175bSopenharmony_ci   * Sign-magnitude and one's complement representations for signed integers are
1290a8e1175bSopenharmony_ci     not supported. Two's complement is the only supported representation.
1291a8e1175bSopenharmony_ci
1292a8e1175bSopenharmony_ciNew deprecations
1293a8e1175bSopenharmony_ci   * Deprecate mbedtls_ssl_conf_curves() in favor of the more generic
1294a8e1175bSopenharmony_ci     mbedtls_ssl_conf_groups().
1295a8e1175bSopenharmony_ci
1296a8e1175bSopenharmony_ciRemovals
1297a8e1175bSopenharmony_ci   * Remove the partial support for running unit tests via Greentea on Mbed OS,
1298a8e1175bSopenharmony_ci     which had been unmaintained since 2018.
1299a8e1175bSopenharmony_ci
1300a8e1175bSopenharmony_ciFeatures
1301a8e1175bSopenharmony_ci   * Enable support for Curve448 via the PSA API. Contributed by
1302a8e1175bSopenharmony_ci     Archana Madhavan in #4626. Fixes #3399 and #4249.
1303a8e1175bSopenharmony_ci   * The identifier of the CID TLS extension can be configured by defining
1304a8e1175bSopenharmony_ci     MBEDTLS_TLS_EXT_CID at compile time.
1305a8e1175bSopenharmony_ci   * Implement the PSA multipart AEAD interface, currently supporting
1306a8e1175bSopenharmony_ci     ChaChaPoly and GCM.
1307a8e1175bSopenharmony_ci   * Warn if errors from certain functions are ignored. This is currently
1308a8e1175bSopenharmony_ci     supported on GCC-like compilers and on MSVC and can be configured through
1309a8e1175bSopenharmony_ci     the macro MBEDTLS_CHECK_RETURN. The warnings are always enabled
1310a8e1175bSopenharmony_ci     (where supported) for critical functions where ignoring the return
1311a8e1175bSopenharmony_ci     value is almost always a bug. Enable the new configuration option
1312a8e1175bSopenharmony_ci     MBEDTLS_CHECK_RETURN_WARNING to get warnings for other functions. This
1313a8e1175bSopenharmony_ci     is currently implemented in the AES, DES and md modules, and will be
1314a8e1175bSopenharmony_ci     extended to other modules in the future.
1315a8e1175bSopenharmony_ci   * Add missing PSA macros declared by PSA Crypto API 1.0.0:
1316a8e1175bSopenharmony_ci     PSA_ALG_IS_SIGN_HASH, PSA_ALG_NONE, PSA_HASH_BLOCK_LENGTH, PSA_KEY_ID_NULL.
1317a8e1175bSopenharmony_ci   * Add support for CCM*-no-tag cipher to the PSA.
1318a8e1175bSopenharmony_ci     Currently only 13-byte long IV's are supported.
1319a8e1175bSopenharmony_ci     For decryption a minimum of 16-byte long input is expected.
1320a8e1175bSopenharmony_ci     These restrictions may be subject to change.
1321a8e1175bSopenharmony_ci   * Add new API mbedtls_ct_memcmp for constant time buffer comparison.
1322a8e1175bSopenharmony_ci   * Add functions to get the IV and block size from cipher_info structs.
1323a8e1175bSopenharmony_ci   * Add functions to check if a cipher supports variable IV or key size.
1324a8e1175bSopenharmony_ci   * Add the internal implementation of and support for CCM to the PSA multipart
1325a8e1175bSopenharmony_ci     AEAD interface.
1326a8e1175bSopenharmony_ci   * Mbed TLS provides a minimum viable implementation of the TLS 1.3
1327a8e1175bSopenharmony_ci     protocol. See docs/architecture/tls13-support.md for the definition of
1328a8e1175bSopenharmony_ci     the TLS 1.3 Minimum Viable Product (MVP). The MBEDTLS_SSL_PROTO_TLS1_3
1329a8e1175bSopenharmony_ci     configuration option controls the enablement of the support. The APIs
1330a8e1175bSopenharmony_ci     mbedtls_ssl_conf_min_version() and mbedtls_ssl_conf_max_version() allow
1331a8e1175bSopenharmony_ci     to select the 1.3 version of the protocol to establish a TLS connection.
1332a8e1175bSopenharmony_ci   * Add PSA API definition for ARIA.
1333a8e1175bSopenharmony_ci
1334a8e1175bSopenharmony_ciSecurity
1335a8e1175bSopenharmony_ci   * Zeroize several intermediate variables used to calculate the expected
1336a8e1175bSopenharmony_ci     value when verifying a MAC or AEAD tag. This hardens the library in
1337a8e1175bSopenharmony_ci     case the value leaks through a memory disclosure vulnerability. For
1338a8e1175bSopenharmony_ci     example, a memory disclosure vulnerability could have allowed a
1339a8e1175bSopenharmony_ci     man-in-the-middle to inject fake ciphertext into a DTLS connection.
1340a8e1175bSopenharmony_ci   * In psa_aead_generate_nonce(), do not read back from the output buffer.
1341a8e1175bSopenharmony_ci     This fixes a potential policy bypass or decryption oracle vulnerability
1342a8e1175bSopenharmony_ci     if the output buffer is in memory that is shared with an untrusted
1343a8e1175bSopenharmony_ci     application.
1344a8e1175bSopenharmony_ci   * In psa_cipher_generate_iv() and psa_cipher_encrypt(), do not read back
1345a8e1175bSopenharmony_ci     from the output buffer. This fixes a potential policy bypass or decryption
1346a8e1175bSopenharmony_ci     oracle vulnerability if the output buffer is in memory that is shared with
1347a8e1175bSopenharmony_ci     an untrusted application.
1348a8e1175bSopenharmony_ci   * Fix a double-free that happened after mbedtls_ssl_set_session() or
1349a8e1175bSopenharmony_ci     mbedtls_ssl_get_session() failed with MBEDTLS_ERR_SSL_ALLOC_FAILED
1350a8e1175bSopenharmony_ci     (out of memory). After that, calling mbedtls_ssl_session_free()
1351a8e1175bSopenharmony_ci     and mbedtls_ssl_free() would cause an internal session buffer to
1352a8e1175bSopenharmony_ci     be free()'d twice.
1353a8e1175bSopenharmony_ci
1354a8e1175bSopenharmony_ciBugfix
1355a8e1175bSopenharmony_ci   * Stop using reserved identifiers as local variables. Fixes #4630.
1356a8e1175bSopenharmony_ci   * The GNU makefiles invoke python3 in preference to python except on Windows.
1357a8e1175bSopenharmony_ci     The check was accidentally not performed when cross-compiling for Windows
1358a8e1175bSopenharmony_ci     on Linux. Fix this. Fixes #4774.
1359a8e1175bSopenharmony_ci   * Prevent divide by zero if either of PSA_CIPHER_ENCRYPT_OUTPUT_SIZE() or
1360a8e1175bSopenharmony_ci     PSA_CIPHER_UPDATE_OUTPUT_SIZE() were called using an asymmetric key type.
1361a8e1175bSopenharmony_ci   * Fix a parameter set but unused in psa_crypto_cipher.c. Fixes #4935.
1362a8e1175bSopenharmony_ci   * Don't use the obsolete header path sys/fcntl.h in unit tests.
1363a8e1175bSopenharmony_ci     These header files cause compilation errors in musl.
1364a8e1175bSopenharmony_ci     Fixes #4969.
1365a8e1175bSopenharmony_ci   * Fix missing constraints on x86_64 and aarch64 assembly code
1366a8e1175bSopenharmony_ci     for bignum multiplication that broke some bignum operations with
1367a8e1175bSopenharmony_ci     (at least) Clang 12.
1368a8e1175bSopenharmony_ci     Fixes #4116, #4786, #4917, #4962.
1369a8e1175bSopenharmony_ci   * Fix mbedtls_cipher_crypt: AES-ECB when MBEDTLS_USE_PSA_CRYPTO is enabled.
1370a8e1175bSopenharmony_ci   * Failures of alternative implementations of AES or DES single-block
1371a8e1175bSopenharmony_ci     functions enabled with MBEDTLS_AES_ENCRYPT_ALT, MBEDTLS_AES_DECRYPT_ALT,
1372a8e1175bSopenharmony_ci     MBEDTLS_DES_CRYPT_ECB_ALT or MBEDTLS_DES3_CRYPT_ECB_ALT were ignored.
1373a8e1175bSopenharmony_ci     This does not concern the implementation provided with Mbed TLS,
1374a8e1175bSopenharmony_ci     where this function cannot fail, or full-module replacements with
1375a8e1175bSopenharmony_ci     MBEDTLS_AES_ALT or MBEDTLS_DES_ALT. Reported by Armelle Duboc in #1092.
1376a8e1175bSopenharmony_ci   * Some failures of HMAC operations were ignored. These failures could only
1377a8e1175bSopenharmony_ci     happen with an alternative implementation of the underlying hash module.
1378a8e1175bSopenharmony_ci   * Fix the error returned by psa_generate_key() for a public key. Fixes #4551.
1379a8e1175bSopenharmony_ci   * Fix compile-time or run-time errors in PSA
1380a8e1175bSopenharmony_ci     AEAD functions when ChachaPoly is disabled. Fixes #5065.
1381a8e1175bSopenharmony_ci   * Remove PSA'a AEAD finish/verify output buffer limitation for GCM.
1382a8e1175bSopenharmony_ci     The requirement of minimum 15 bytes for output buffer in
1383a8e1175bSopenharmony_ci     psa_aead_finish() and psa_aead_verify() does not apply to the built-in
1384a8e1175bSopenharmony_ci     implementation of GCM.
1385a8e1175bSopenharmony_ci   * Move GCM's update output buffer length verification from PSA AEAD to
1386a8e1175bSopenharmony_ci     the built-in implementation of the GCM.
1387a8e1175bSopenharmony_ci     The requirement for output buffer size to be equal or greater then
1388a8e1175bSopenharmony_ci     input buffer size is valid only for the built-in implementation of GCM.
1389a8e1175bSopenharmony_ci     Alternative GCM implementations can process whole blocks only.
1390a8e1175bSopenharmony_ci   * Fix the build of sample programs when neither MBEDTLS_ERROR_C nor
1391a8e1175bSopenharmony_ci     MBEDTLS_ERROR_STRERROR_DUMMY is enabled.
1392a8e1175bSopenharmony_ci   * Fix PSA_ALG_RSA_PSS verification accepting an arbitrary salt length.
1393a8e1175bSopenharmony_ci     This algorithm now accepts only the same salt length for verification
1394a8e1175bSopenharmony_ci     that it produces when signing, as documented. Use the new algorithm
1395a8e1175bSopenharmony_ci     PSA_ALG_RSA_PSS_ANY_SALT to accept any salt length. Fixes #4946.
1396a8e1175bSopenharmony_ci   * The existing predicate macro name PSA_ALG_IS_HASH_AND_SIGN is now reserved
1397a8e1175bSopenharmony_ci     for algorithm values that fully encode the hashing step, as per the PSA
1398a8e1175bSopenharmony_ci     Crypto API specification. This excludes PSA_ALG_RSA_PKCS1V15_SIGN_RAW and
1399a8e1175bSopenharmony_ci     PSA_ALG_ECDSA_ANY. The new predicate macro PSA_ALG_IS_SIGN_HASH covers
1400a8e1175bSopenharmony_ci     all algorithms that can be used with psa_{sign,verify}_hash(), including
1401a8e1175bSopenharmony_ci     these two.
1402a8e1175bSopenharmony_ci   * Fix issue in Makefile on Linux with SHARED=1, that caused shared libraries
1403a8e1175bSopenharmony_ci     not to list other shared libraries they need.
1404a8e1175bSopenharmony_ci   * Fix a bug in mbedtls_gcm_starts() when the bit length of the iv
1405a8e1175bSopenharmony_ci     exceeds 2^32. Fixes #4884.
1406a8e1175bSopenharmony_ci   * Fix an uninitialized variable warning in test_suite_ssl.function with GCC
1407a8e1175bSopenharmony_ci     version 11.
1408a8e1175bSopenharmony_ci   * Fix the build when no SHA2 module is included. Fixes #4930.
1409a8e1175bSopenharmony_ci   * Fix the build when only the bignum module is included. Fixes #4929.
1410a8e1175bSopenharmony_ci   * Fix a potential invalid pointer dereference and infinite loop bugs in
1411a8e1175bSopenharmony_ci     pkcs12 functions when the password is empty. Fix the documentation to
1412a8e1175bSopenharmony_ci     better describe the inputs to these functions and their possible values.
1413a8e1175bSopenharmony_ci     Fixes #5136.
1414a8e1175bSopenharmony_ci   * The key usage flags PSA_KEY_USAGE_SIGN_MESSAGE now allows the MAC
1415a8e1175bSopenharmony_ci     operations psa_mac_compute() and psa_mac_sign_setup().
1416a8e1175bSopenharmony_ci   * The key usage flags PSA_KEY_USAGE_VERIFY_MESSAGE now allows the MAC
1417a8e1175bSopenharmony_ci     operations psa_mac_verify() and psa_mac_verify_setup().
1418a8e1175bSopenharmony_ci
1419a8e1175bSopenharmony_ciChanges
1420a8e1175bSopenharmony_ci    * Explicitly mark the fields mbedtls_ssl_session.exported and
1421a8e1175bSopenharmony_ci      mbedtls_ssl_config.respect_cli_pref as private. This was an
1422a8e1175bSopenharmony_ci      oversight during the run-up to the release of Mbed TLS 3.0.
1423a8e1175bSopenharmony_ci      The fields were never intended to be public.
1424a8e1175bSopenharmony_ci   * Implement multi-part CCM API.
1425a8e1175bSopenharmony_ci     The multi-part functions: mbedtls_ccm_starts(), mbedtls_ccm_set_lengths(),
1426a8e1175bSopenharmony_ci     mbedtls_ccm_update_ad(), mbedtls_ccm_update(), mbedtls_ccm_finish()
1427a8e1175bSopenharmony_ci     were introduced in mbedTLS 3.0 release, however their implementation was
1428a8e1175bSopenharmony_ci     postponed until now.
1429a8e1175bSopenharmony_ci     Implemented functions support chunked data input for both CCM and CCM*
1430a8e1175bSopenharmony_ci     algorithms.
1431a8e1175bSopenharmony_ci   * Remove MBEDTLS_SSL_EXPORT_KEYS, making it always on and increasing the
1432a8e1175bSopenharmony_ci     code size by about 80B on an M0 build. This option only gated an ability
1433a8e1175bSopenharmony_ci     to set a callback, but was deemed unnecessary as it was yet another define
1434a8e1175bSopenharmony_ci     to remember when writing tests, or test configurations. Fixes #4653.
1435a8e1175bSopenharmony_ci   * Improve the performance of base64 constant-flow code. The result is still
1436a8e1175bSopenharmony_ci     slower than the original non-constant-flow implementation, but much faster
1437a8e1175bSopenharmony_ci     than the previous constant-flow implementation. Fixes #4814.
1438a8e1175bSopenharmony_ci   * Ignore plaintext/ciphertext lengths for CCM*-no-tag operations.
1439a8e1175bSopenharmony_ci     For CCM* encryption/decryption without authentication, input
1440a8e1175bSopenharmony_ci     length will be ignored.
1441a8e1175bSopenharmony_ci   * Indicate in the error returned if the nonce length used with
1442a8e1175bSopenharmony_ci     ChaCha20-Poly1305 is invalid, and not just unsupported.
1443a8e1175bSopenharmony_ci   * The mbedcrypto library includes a new source code module constant_time.c,
1444a8e1175bSopenharmony_ci     containing various functions meant to resist timing side channel attacks.
1445a8e1175bSopenharmony_ci     This module does not have a separate configuration option, and functions
1446a8e1175bSopenharmony_ci     from this module will be included in the build as required. Currently
1447a8e1175bSopenharmony_ci     most of the interface of this module is private and may change at any
1448a8e1175bSopenharmony_ci     time.
1449a8e1175bSopenharmony_ci   * The generated configuration-independent files are now automatically
1450a8e1175bSopenharmony_ci     generated by the CMake build system on Unix-like systems. This is not
1451a8e1175bSopenharmony_ci     yet supported when cross-compiling.
1452a8e1175bSopenharmony_ci
1453a8e1175bSopenharmony_ci= Mbed TLS 3.0.0 branch released 2021-07-07
1454a8e1175bSopenharmony_ci
1455a8e1175bSopenharmony_ciAPI changes
1456a8e1175bSopenharmony_ci   * Remove HAVEGE module.
1457a8e1175bSopenharmony_ci     The design of HAVEGE makes it unsuitable for microcontrollers. Platforms
1458a8e1175bSopenharmony_ci     with a more complex CPU usually have an operating system interface that
1459a8e1175bSopenharmony_ci     provides better randomness. Instead of HAVEGE, declare OS or hardware RNG
1460a8e1175bSopenharmony_ci     interfaces with mbedtls_entropy_add_source() and/or use an entropy seed
1461a8e1175bSopenharmony_ci     file created securely during device provisioning. See
1462a8e1175bSopenharmony_ci     https://mbed-tls.readthedocs.io/en/latest/kb/how-to/add-entropy-sources-to-entropy-pool/ for
1463a8e1175bSopenharmony_ci     more information.
1464a8e1175bSopenharmony_ci   * Add missing const attributes to API functions.
1465a8e1175bSopenharmony_ci   * Remove helpers for the transition from Mbed TLS 1.3 to Mbed TLS 2.0: the
1466a8e1175bSopenharmony_ci     header compat-1.3.h and the script rename.pl.
1467a8e1175bSopenharmony_ci   * Remove certs module from the API.
1468a8e1175bSopenharmony_ci     Transfer keys and certificates embedded in the library to the test
1469a8e1175bSopenharmony_ci     component. This contributes to minimizing library API and discourages
1470a8e1175bSopenharmony_ci     users from using unsafe keys in production.
1471a8e1175bSopenharmony_ci   * Move alt helpers and definitions.
1472a8e1175bSopenharmony_ci     Various helpers and definitions available for use in alt implementations
1473a8e1175bSopenharmony_ci     have been moved out of the include/ directory and into the library/
1474a8e1175bSopenharmony_ci     directory. The files concerned are ecp_internal.h and rsa_internal.h
1475a8e1175bSopenharmony_ci     which have also been renamed to ecp_internal_alt.h and rsa_alt_helpers.h
1476a8e1175bSopenharmony_ci     respectively.
1477a8e1175bSopenharmony_ci   * Move internal headers.
1478a8e1175bSopenharmony_ci     Header files that were only meant for the library's internal use and
1479a8e1175bSopenharmony_ci     were not meant to be used in application code have been moved out of
1480a8e1175bSopenharmony_ci     the include/ directory. The headers concerned are bn_mul.h, aesni.h,
1481a8e1175bSopenharmony_ci     padlock.h, entropy_poll.h and *_internal.h.
1482a8e1175bSopenharmony_ci   * Drop support for parsing SSLv2 ClientHello
1483a8e1175bSopenharmony_ci     (MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO).
1484a8e1175bSopenharmony_ci   * Drop support for SSLv3 (MBEDTLS_SSL_PROTO_SSL3).
1485a8e1175bSopenharmony_ci   * Drop support for TLS record-level compression (MBEDTLS_ZLIB_SUPPORT).
1486a8e1175bSopenharmony_ci   * Drop support for RC4 TLS ciphersuites.
1487a8e1175bSopenharmony_ci   * Drop support for single-DES ciphersuites.
1488a8e1175bSopenharmony_ci   * Drop support for MBEDTLS_SSL_HW_RECORD_ACCEL.
1489a8e1175bSopenharmony_ci   * Update AEAD output size macros to bring them in line with the PSA Crypto
1490a8e1175bSopenharmony_ci     API version 1.0 spec. This version of the spec parameterizes them on the
1491a8e1175bSopenharmony_ci     key type used, as well as the key bit-size in the case of
1492a8e1175bSopenharmony_ci     PSA_AEAD_TAG_LENGTH.
1493a8e1175bSopenharmony_ci   * Add configuration option MBEDTLS_X509_REMOVE_INFO which
1494a8e1175bSopenharmony_ci     removes the mbedtls_x509_*_info(), mbedtls_debug_print_crt()
1495a8e1175bSopenharmony_ci     as well as other functions and constants only used by
1496a8e1175bSopenharmony_ci     those functions. This reduces the code footprint by
1497a8e1175bSopenharmony_ci     several kB.
1498a8e1175bSopenharmony_ci   * Remove SSL error codes `MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED`
1499a8e1175bSopenharmony_ci     and `MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH` which are never
1500a8e1175bSopenharmony_ci     returned from the public SSL API.
1501a8e1175bSopenharmony_ci   * Remove `MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE` and return
1502a8e1175bSopenharmony_ci     `MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL` instead.
1503a8e1175bSopenharmony_ci   * The output parameter of mbedtls_sha512_finish, mbedtls_sha512,
1504a8e1175bSopenharmony_ci     mbedtls_sha256_finish and mbedtls_sha256 now has a pointer type
1505a8e1175bSopenharmony_ci     rather than array type. This removes spurious warnings in some compilers
1506a8e1175bSopenharmony_ci     when outputting a SHA-384 or SHA-224 hash into a buffer of exactly
1507a8e1175bSopenharmony_ci     the hash size.
1508a8e1175bSopenharmony_ci   * Remove the MBEDTLS_TEST_NULL_ENTROPY config option. Fixes #4388.
1509a8e1175bSopenharmony_ci   * The interface of the GCM module has changed to remove restrictions on
1510a8e1175bSopenharmony_ci     how the input to multipart operations is broken down. mbedtls_gcm_finish()
1511a8e1175bSopenharmony_ci     now takes extra output parameters for the last partial output block.
1512a8e1175bSopenharmony_ci     mbedtls_gcm_update() now takes extra parameters for the output length.
1513a8e1175bSopenharmony_ci     The software implementation always produces the full output at each
1514a8e1175bSopenharmony_ci     call to mbedtls_gcm_update(), but alternative implementations activated
1515a8e1175bSopenharmony_ci     by MBEDTLS_GCM_ALT may delay partial blocks to the next call to
1516a8e1175bSopenharmony_ci     mbedtls_gcm_update() or mbedtls_gcm_finish(). Furthermore, applications
1517a8e1175bSopenharmony_ci     no longer pass the associated data to mbedtls_gcm_starts(), but to the
1518a8e1175bSopenharmony_ci     new function mbedtls_gcm_update_ad().
1519a8e1175bSopenharmony_ci     These changes are backward compatible for users of the cipher API.
1520a8e1175bSopenharmony_ci   * Replace MBEDTLS_SHA512_NO_SHA384 config option with MBEDTLS_SHA384_C.
1521a8e1175bSopenharmony_ci     This separates config option enabling the SHA384 algorithm from option
1522a8e1175bSopenharmony_ci     enabling the SHA512 algorithm. Fixes #4034.
1523a8e1175bSopenharmony_ci   * Introduce MBEDTLS_SHA224_C.
1524a8e1175bSopenharmony_ci     This separates config option enabling the SHA224 algorithm from option
1525a8e1175bSopenharmony_ci     enabling SHA256.
1526a8e1175bSopenharmony_ci   * The getter and setter API of the SSL session cache (used for
1527a8e1175bSopenharmony_ci     session-ID based session resumption) has changed to that of
1528a8e1175bSopenharmony_ci     a key-value store with keys being session IDs and values
1529a8e1175bSopenharmony_ci     being opaque instances of `mbedtls_ssl_session`.
1530a8e1175bSopenharmony_ci   * Remove the mode parameter from RSA operation functions. Signature and
1531a8e1175bSopenharmony_ci     decryption functions now always use the private key and verification and
1532a8e1175bSopenharmony_ci     encryption use the public key. Verification functions also no longer have
1533a8e1175bSopenharmony_ci     RNG parameters.
1534a8e1175bSopenharmony_ci   * Modify semantics of `mbedtls_ssl_conf_[opaque_]psk()`:
1535a8e1175bSopenharmony_ci     In Mbed TLS 2.X, the API prescribes that later calls overwrite
1536a8e1175bSopenharmony_ci     the effect of earlier calls. In Mbed TLS 3.0, calling
1537a8e1175bSopenharmony_ci     `mbedtls_ssl_conf_[opaque_]psk()` more than once will fail,
1538a8e1175bSopenharmony_ci     leaving the PSK that was configured first intact.
1539a8e1175bSopenharmony_ci     Support for more than one PSK may be added in 3.X.
1540a8e1175bSopenharmony_ci   * The function mbedtls_x509write_csr_set_extension() has an extra parameter
1541a8e1175bSopenharmony_ci     which allows to mark an extension as critical. Fixes #4055.
1542a8e1175bSopenharmony_ci   * For multi-part AEAD operations with the cipher module, calling
1543a8e1175bSopenharmony_ci     mbedtls_cipher_finish() is now mandatory. Previously the documentation
1544a8e1175bSopenharmony_ci     was unclear on this point, and this function happened to never do
1545a8e1175bSopenharmony_ci     anything with the currently implemented AEADs, so in practice it was
1546a8e1175bSopenharmony_ci     possible to skip calling it, which is no longer supported.
1547a8e1175bSopenharmony_ci   * The option MBEDTLS_ECP_FIXED_POINT_OPTIM use pre-computed comb tables
1548a8e1175bSopenharmony_ci     instead of computing tables in runtime. Thus, this option now increase
1549a8e1175bSopenharmony_ci     code size, and it does not increase RAM usage in runtime anymore.
1550a8e1175bSopenharmony_ci   * Remove the SSL APIs mbedtls_ssl_get_input_max_frag_len() and
1551a8e1175bSopenharmony_ci     mbedtls_ssl_get_output_max_frag_len(), and add a new API
1552a8e1175bSopenharmony_ci     mbedtls_ssl_get_max_in_record_payload(), complementing the existing
1553a8e1175bSopenharmony_ci     mbedtls_ssl_get_max_out_record_payload().
1554a8e1175bSopenharmony_ci     Uses of mbedtls_ssl_get_input_max_frag_len() and
1555a8e1175bSopenharmony_ci     mbedtls_ssl_get_input_max_frag_len() should be replaced by
1556a8e1175bSopenharmony_ci     mbedtls_ssl_get_max_in_record_payload() and
1557a8e1175bSopenharmony_ci     mbedtls_ssl_get_max_out_record_payload(), respectively.
1558a8e1175bSopenharmony_ci   * mbedtls_rsa_init() now always selects the PKCS#1v1.5 encoding for an RSA
1559a8e1175bSopenharmony_ci     key. To use an RSA key with PSS or OAEP, call mbedtls_rsa_set_padding()
1560a8e1175bSopenharmony_ci     after initializing the context. mbedtls_rsa_set_padding() now returns an
1561a8e1175bSopenharmony_ci     error if its parameters are invalid.
1562a8e1175bSopenharmony_ci   * Replace MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE by a runtime
1563a8e1175bSopenharmony_ci     configuration function mbedtls_ssl_conf_preference_order(). Fixes #4398.
1564a8e1175bSopenharmony_ci   * Instead of accessing the len field of a DHM context, which is no longer
1565a8e1175bSopenharmony_ci     supported, use the new function mbedtls_dhm_get_len() .
1566a8e1175bSopenharmony_ci   * In modules that implement cryptographic hash functions, many functions
1567a8e1175bSopenharmony_ci     mbedtls_xxx() now return int instead of void, and the corresponding
1568a8e1175bSopenharmony_ci     function mbedtls_xxx_ret() which was identical except for returning int
1569a8e1175bSopenharmony_ci     has been removed. This also concerns mbedtls_xxx_drbg_update(). See the
1570a8e1175bSopenharmony_ci     migration guide for more information. Fixes #4212.
1571a8e1175bSopenharmony_ci   * For all functions that take a random number generator (RNG) as a
1572a8e1175bSopenharmony_ci     parameter, this parameter is now mandatory (that is, NULL is not an
1573a8e1175bSopenharmony_ci     acceptable value). Functions which previously accepted NULL and now
1574a8e1175bSopenharmony_ci     reject it are: the X.509 CRT and CSR writing functions; the PK and RSA
1575a8e1175bSopenharmony_ci     sign and decrypt function; mbedtls_rsa_private(); the functions
1576a8e1175bSopenharmony_ci     in DHM and ECDH that compute the shared secret; the scalar multiplication
1577a8e1175bSopenharmony_ci     functions in ECP.
1578a8e1175bSopenharmony_ci   * The following functions now require an RNG parameter:
1579a8e1175bSopenharmony_ci     mbedtls_ecp_check_pub_priv(), mbedtls_pk_check_pair(),
1580a8e1175bSopenharmony_ci     mbedtls_pk_parse_key(), mbedtls_pk_parse_keyfile().
1581a8e1175bSopenharmony_ci   * mbedtls_ssl_conf_export_keys_ext_cb() and
1582a8e1175bSopenharmony_ci     mbedtls_ssl_conf_export_keys_cb() have been removed and
1583a8e1175bSopenharmony_ci     replaced by a new API mbedtls_ssl_set_export_keys_cb().
1584a8e1175bSopenharmony_ci     Raw keys and IVs are no longer passed to the callback.
1585a8e1175bSopenharmony_ci     Further, callbacks now receive an additional parameter
1586a8e1175bSopenharmony_ci     indicating the type of secret that's being exported,
1587a8e1175bSopenharmony_ci     paving the way for the larger number of secrets
1588a8e1175bSopenharmony_ci     in TLS 1.3. Finally, the key export callback and
1589a8e1175bSopenharmony_ci     context are now connection-specific.
1590a8e1175bSopenharmony_ci   * Signature functions in the RSA and PK modules now require the hash
1591a8e1175bSopenharmony_ci     length parameter to be the size of the hash input. For RSA signatures
1592a8e1175bSopenharmony_ci     other than raw PKCS#1 v1.5, this must match the output size of the
1593a8e1175bSopenharmony_ci     specified hash algorithm.
1594a8e1175bSopenharmony_ci   * The functions mbedtls_pk_sign(), mbedtls_pk_sign_restartable(),
1595a8e1175bSopenharmony_ci     mbedtls_ecdsa_write_signature() and
1596a8e1175bSopenharmony_ci     mbedtls_ecdsa_write_signature_restartable() now take an extra parameter
1597a8e1175bSopenharmony_ci     indicating the size of the output buffer for the signature.
1598a8e1175bSopenharmony_ci   * Implement one-shot cipher functions, psa_cipher_encrypt and
1599a8e1175bSopenharmony_ci     psa_cipher_decrypt, according to the PSA Crypto API 1.0.0
1600a8e1175bSopenharmony_ci     specification.
1601a8e1175bSopenharmony_ci   * Direct access to fields of structures declared in public headers is no
1602a8e1175bSopenharmony_ci     longer supported except for fields that are documented public. Use accessor
1603a8e1175bSopenharmony_ci     functions instead. For more information, see the migration guide entry
1604a8e1175bSopenharmony_ci     "Most structure fields are now private".
1605a8e1175bSopenharmony_ci   * mbedtls_ssl_get_session_pointer() has been removed, and
1606a8e1175bSopenharmony_ci     mbedtls_ssl_{set,get}_session() may now only be called once for any given
1607a8e1175bSopenharmony_ci     SSL context.
1608a8e1175bSopenharmony_ci
1609a8e1175bSopenharmony_ciDefault behavior changes
1610a8e1175bSopenharmony_ci   * Enable by default the functionalities which have no reason to be disabled.
1611a8e1175bSopenharmony_ci     They are: ARIA block cipher, CMAC mode, elliptic curve J-PAKE library and
1612a8e1175bSopenharmony_ci     Key Wrapping mode as defined in NIST SP 800-38F. Fixes #4036.
1613a8e1175bSopenharmony_ci   * Some default policies for X.509 certificate verification and TLS have
1614a8e1175bSopenharmony_ci     changed: curves and hashes weaker than 255 bits are no longer accepted
1615a8e1175bSopenharmony_ci     by default. The default order in TLS now favors faster curves over larger
1616a8e1175bSopenharmony_ci     curves.
1617a8e1175bSopenharmony_ci
1618a8e1175bSopenharmony_ciRequirement changes
1619a8e1175bSopenharmony_ci   * The library now uses the %zu format specifier with the printf() family of
1620a8e1175bSopenharmony_ci     functions, so requires a toolchain that supports it. This change does not
1621a8e1175bSopenharmony_ci     affect the maintained LTS branches, so when contributing changes please
1622a8e1175bSopenharmony_ci     bear this in mind and do not add them to backported code.
1623a8e1175bSopenharmony_ci   * If you build the development version of Mbed TLS, rather than an official
1624a8e1175bSopenharmony_ci     release, some configuration-independent files are now generated at build
1625a8e1175bSopenharmony_ci     time rather than checked into source control. This includes some library
1626a8e1175bSopenharmony_ci     source files as well as the Visual Studio solution. Perl, Python 3 and a
1627a8e1175bSopenharmony_ci     C compiler for the host platform are required. See “Generated source files
1628a8e1175bSopenharmony_ci     in the development branch” in README.md for more information.
1629a8e1175bSopenharmony_ci   * Refresh the minimum supported versions of tools to build the
1630a8e1175bSopenharmony_ci     library. CMake versions older than 3.10.2 and Python older
1631a8e1175bSopenharmony_ci     than 3.6 are no longer supported.
1632a8e1175bSopenharmony_ci
1633a8e1175bSopenharmony_ciRemovals
1634a8e1175bSopenharmony_ci   * Remove the MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
1635a8e1175bSopenharmony_ci     compile-time option, which was off by default. Users should not trust
1636a8e1175bSopenharmony_ci     certificates signed with SHA-1 due to the known attacks against SHA-1.
1637a8e1175bSopenharmony_ci     If needed, SHA-1 certificates can still be verified by using a custom
1638a8e1175bSopenharmony_ci     verification profile.
1639a8e1175bSopenharmony_ci   * Removed deprecated things in psa/crypto_compat.h. Fixes #4284
1640a8e1175bSopenharmony_ci   * Removed deprecated functions from hashing modules. Fixes #4280.
1641a8e1175bSopenharmony_ci   * Remove PKCS#11 library wrapper. PKCS#11 has limited functionality,
1642a8e1175bSopenharmony_ci     lacks automated tests and has scarce documentation. Also, PSA Crypto
1643a8e1175bSopenharmony_ci     provides a more flexible private key management.
1644a8e1175bSopenharmony_ci     More details on PCKS#11 wrapper removal can be found in the mailing list
1645a8e1175bSopenharmony_ci     https://lists.trustedfirmware.org/pipermail/mbed-tls/2020-April/000024.html
1646a8e1175bSopenharmony_ci   * Remove deprecated error codes. Fix #4283
1647a8e1175bSopenharmony_ci   * Remove MBEDTLS_ENABLE_WEAK_CIPHERSUITES configuration option. Fixes #4416.
1648a8e1175bSopenharmony_ci   * Remove the MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
1649a8e1175bSopenharmony_ci     compile-time option. This option has been inactive for a long time.
1650a8e1175bSopenharmony_ci     Please use the `lifetime` parameter of `mbedtls_ssl_ticket_setup()`
1651a8e1175bSopenharmony_ci     instead.
1652a8e1175bSopenharmony_ci   * Remove the following deprecated functions and constants of hex-encoded
1653a8e1175bSopenharmony_ci     primes based on RFC 5114 and RFC 3526 from library code and tests:
1654a8e1175bSopenharmony_ci     mbedtls_aes_encrypt(), mbedtls_aes_decrypt(), mbedtls_mpi_is_prime(),
1655a8e1175bSopenharmony_ci     mbedtls_cipher_auth_encrypt(), mbedtls_cipher_auth_decrypt(),
1656a8e1175bSopenharmony_ci     mbedtls_ctr_drbg_update(), mbedtls_hmac_drbg_update(),
1657a8e1175bSopenharmony_ci     mbedtls_ecdsa_write_signature_det(), mbedtls_ecdsa_sign_det(),
1658a8e1175bSopenharmony_ci     mbedtls_ssl_conf_dh_param(), mbedtls_ssl_get_max_frag_len(),
1659a8e1175bSopenharmony_ci     MBEDTLS_DHM_RFC5114_MODP_2048_P, MBEDTLS_DHM_RFC5114_MODP_2048_G,
1660a8e1175bSopenharmony_ci     MBEDTLS_DHM_RFC3526_MODP_2048_P, MBEDTLS_DHM_RFC3526_MODP_2048_G,
1661a8e1175bSopenharmony_ci     MBEDTLS_DHM_RFC3526_MODP_3072_P, MBEDTLS_DHM_RFC3526_MODP_3072_G,
1662a8e1175bSopenharmony_ci     MBEDTLS_DHM_RFC3526_MODP_4096_P, MBEDTLS_DHM_RFC3526_MODP_4096_G.
1663a8e1175bSopenharmony_ci     Remove the deprecated file: include/mbedtls/net.h. Fixes #4282.
1664a8e1175bSopenharmony_ci   * Remove MBEDTLS_SSL_MAX_CONTENT_LEN configuration option, since
1665a8e1175bSopenharmony_ci     MBEDTLS_SSL_IN_CONTENT_LEN and MBEDTLS_SSL_OUT_CONTENT_LEN replace
1666a8e1175bSopenharmony_ci     it. Fixes #4362.
1667a8e1175bSopenharmony_ci   * Remove the MBEDTLS_SSL_RECORD_CHECKING option and enable by default its
1668a8e1175bSopenharmony_ci     previous action. Fixes #4361.
1669a8e1175bSopenharmony_ci   * Remove support for TLS 1.0, TLS 1.1 and DTLS 1.0, as well as support for
1670a8e1175bSopenharmony_ci     CBC record splitting, fallback SCSV, and the ability to configure
1671a8e1175bSopenharmony_ci     ciphersuites per version, which are no longer relevant. This removes the
1672a8e1175bSopenharmony_ci     configuration options MBEDTLS_SSL_PROTO_TLS1,
1673a8e1175bSopenharmony_ci     MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING and
1674a8e1175bSopenharmony_ci     MBEDTLS_SSL_FALLBACK_SCSV as well as the functions
1675a8e1175bSopenharmony_ci     mbedtls_ssl_conf_cbc_record_splitting(),
1676a8e1175bSopenharmony_ci     mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(),
1677a8e1175bSopenharmony_ci     and mbedtls_ssl_conf_ciphersuites_for_version(). Fixes #4286.
1678a8e1175bSopenharmony_ci   * The RSA module no longer supports private-key operations with the public
1679a8e1175bSopenharmony_ci     key and vice versa.
1680a8e1175bSopenharmony_ci   * Remove the MBEDTLS_SSL_DTLS_BADMAC_LIMIT config.h option. Fixes #4403.
1681a8e1175bSopenharmony_ci   * Remove all the 3DES ciphersuites:
1682a8e1175bSopenharmony_ci     MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
1683a8e1175bSopenharmony_ci     MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
1684a8e1175bSopenharmony_ci     MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
1685a8e1175bSopenharmony_ci     MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
1686a8e1175bSopenharmony_ci     MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
1687a8e1175bSopenharmony_ci     MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
1688a8e1175bSopenharmony_ci     MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA,
1689a8e1175bSopenharmony_ci     MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
1690a8e1175bSopenharmony_ci     MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA. Remove the
1691a8e1175bSopenharmony_ci     MBEDTLS_REMOVE_3DES_CIPHERSUITES option which is no longer relevant.
1692a8e1175bSopenharmony_ci     Fixes #4367.
1693a8e1175bSopenharmony_ci   * Remove the MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 option and let the code
1694a8e1175bSopenharmony_ci     behave as if it was always disabled. Fixes #4386.
1695a8e1175bSopenharmony_ci   * Remove MBEDTLS_ECDH_LEGACY_CONTEXT config option since this was purely for
1696a8e1175bSopenharmony_ci     backward compatibility which is no longer supported. Addresses #4404.
1697a8e1175bSopenharmony_ci   * Remove the following macros: MBEDTLS_CHECK_PARAMS,
1698a8e1175bSopenharmony_ci     MBEDTLS_CHECK_PARAMS_ASSERT, MBEDTLS_PARAM_FAILED,
1699a8e1175bSopenharmony_ci     MBEDTLS_PARAM_FAILED_ALT. Fixes #4313.
1700a8e1175bSopenharmony_ci   * Remove the  MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION config.h
1701a8e1175bSopenharmony_ci     option. The mbedtls_x509_crt_parse_der_with_ext_cb() is the way to go for
1702a8e1175bSopenharmony_ci     migration path. Fixes #4378.
1703a8e1175bSopenharmony_ci   * Remove the MBEDTLS_X509_CHECK_KEY_USAGE and
1704a8e1175bSopenharmony_ci     MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE config.h options and let the code
1705a8e1175bSopenharmony_ci     behave as if they were always enabled. Fixes #4405.
1706a8e1175bSopenharmony_ci   * MBEDTLS_ECP_MAX_BITS is no longer a configuration option because it is
1707a8e1175bSopenharmony_ci     now determined automatically based on supported curves.
1708a8e1175bSopenharmony_ci   * Remove the following functions: mbedtls_timing_self_test(),
1709a8e1175bSopenharmony_ci     mbedtls_hardclock_poll(), mbedtls_timing_hardclock() and
1710a8e1175bSopenharmony_ci     mbedtls_set_alarm(). Fixes #4083.
1711a8e1175bSopenharmony_ci   * The configuration option MBEDTLS_ECP_NO_INTERNAL_RNG has been removed as
1712a8e1175bSopenharmony_ci     it no longer had any effect.
1713a8e1175bSopenharmony_ci   * Remove all support for MD2, MD4, RC4, Blowfish and XTEA. This removes the
1714a8e1175bSopenharmony_ci     corresponding modules and all their APIs and related configuration
1715a8e1175bSopenharmony_ci     options. Fixes #4084.
1716a8e1175bSopenharmony_ci   * Remove MBEDTLS_SSL_TRUNCATED_HMAC and also remove
1717a8e1175bSopenharmony_ci     MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT config option. Users are better served by
1718a8e1175bSopenharmony_ci     using a CCM-8 ciphersuite than a CBC ciphersuite with truncated HMAC.
1719a8e1175bSopenharmony_ci     See issue #4341 for more details.
1720a8e1175bSopenharmony_ci   * Remove the compile-time option
1721a8e1175bSopenharmony_ci     MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE.
1722a8e1175bSopenharmony_ci
1723a8e1175bSopenharmony_ciFeatures
1724a8e1175bSopenharmony_ci   * Add mbedtls_rsa_rsassa_pss_sign_ext() function allowing to generate a
1725a8e1175bSopenharmony_ci     signature with a specific salt length. This function allows to validate
1726a8e1175bSopenharmony_ci     test cases provided in the NIST's CAVP test suite. Contributed by Cédric
1727a8e1175bSopenharmony_ci     Meuter in PR #3183.
1728a8e1175bSopenharmony_ci   * Added support for built-in driver keys through the PSA opaque crypto
1729a8e1175bSopenharmony_ci     driver interface. Refer to the documentation of
1730a8e1175bSopenharmony_ci     MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS for more information.
1731a8e1175bSopenharmony_ci   * Implement psa_sign_message() and psa_verify_message().
1732a8e1175bSopenharmony_ci   * The multi-part GCM interface (mbedtls_gcm_update() or
1733a8e1175bSopenharmony_ci     mbedtls_cipher_update()) no longer requires the size of partial inputs to
1734a8e1175bSopenharmony_ci     be a multiple of 16.
1735a8e1175bSopenharmony_ci   * The multi-part GCM interface now supports chunked associated data through
1736a8e1175bSopenharmony_ci     multiple calls to mbedtls_gcm_update_ad().
1737a8e1175bSopenharmony_ci   * The new function mbedtls_mpi_random() generates a random value in a
1738a8e1175bSopenharmony_ci     given range uniformly.
1739a8e1175bSopenharmony_ci   * Alternative implementations of the AES, DHM, ECJPAKE, ECP, RSA and timing
1740a8e1175bSopenharmony_ci     modules had undocumented constraints on their context types. These
1741a8e1175bSopenharmony_ci     constraints have been relaxed.
1742a8e1175bSopenharmony_ci     See docs/architecture/alternative-implementations.md for the remaining
1743a8e1175bSopenharmony_ci     constraints.
1744a8e1175bSopenharmony_ci   * The new functions mbedtls_dhm_get_len() and mbedtls_dhm_get_bitlen()
1745a8e1175bSopenharmony_ci     query the size of the modulus in a Diffie-Hellman context.
1746a8e1175bSopenharmony_ci   * The new function mbedtls_dhm_get_value() copy a field out of a
1747a8e1175bSopenharmony_ci     Diffie-Hellman context.
1748a8e1175bSopenharmony_ci   * Use the new function mbedtls_ecjpake_set_point_format() to select the
1749a8e1175bSopenharmony_ci     point format for ECJPAKE instead of accessing the point_format field
1750a8e1175bSopenharmony_ci     directly, which is no longer supported.
1751a8e1175bSopenharmony_ci   * Implement psa_mac_compute() and psa_mac_verify() as defined in the
1752a8e1175bSopenharmony_ci     PSA Cryptograpy API 1.0.0 specification.
1753a8e1175bSopenharmony_ci
1754a8e1175bSopenharmony_ciSecurity
1755a8e1175bSopenharmony_ci   * Fix a bias in the generation of finite-field Diffie-Hellman-Merkle (DHM)
1756a8e1175bSopenharmony_ci     private keys and of blinding values for DHM and elliptic curves (ECP)
1757a8e1175bSopenharmony_ci     computations. Reported by FlorianF89 in #4245.
1758a8e1175bSopenharmony_ci   * Fix a potential side channel vulnerability in ECDSA ephemeral key generation.
1759a8e1175bSopenharmony_ci     An adversary who is capable of very precise timing measurements could
1760a8e1175bSopenharmony_ci     learn partial information about the leading bits of the nonce used for the
1761a8e1175bSopenharmony_ci     signature, allowing the recovery of the private key after observing a
1762a8e1175bSopenharmony_ci     large number of signature operations. This completes a partial fix in
1763a8e1175bSopenharmony_ci     Mbed TLS 2.20.0.
1764a8e1175bSopenharmony_ci   * Fix an issue where an adversary with access to precise enough information
1765a8e1175bSopenharmony_ci     about memory accesses (typically, an untrusted operating system attacking
1766a8e1175bSopenharmony_ci     a secure enclave) could recover an RSA private key after observing the
1767a8e1175bSopenharmony_ci     victim performing a single private-key operation. Found and reported by
1768a8e1175bSopenharmony_ci     Zili KOU, Wenjian HE, Sharad Sinha, and Wei ZHANG.
1769a8e1175bSopenharmony_ci   * Fix an issue where an adversary with access to precise enough timing
1770a8e1175bSopenharmony_ci     information (typically, a co-located process) could recover a Curve25519
1771a8e1175bSopenharmony_ci     or Curve448 static ECDH key after inputting a chosen public key and
1772a8e1175bSopenharmony_ci     observing the victim performing the corresponding private-key operation.
1773a8e1175bSopenharmony_ci     Found and reported by Leila Batina, Lukas Chmielewski, Björn Haase, Niels
1774a8e1175bSopenharmony_ci     Samwel and Peter Schwabe.
1775a8e1175bSopenharmony_ci
1776a8e1175bSopenharmony_ciBugfix
1777a8e1175bSopenharmony_ci   * Fix premature fopen() call in mbedtls_entropy_write_seed_file which may
1778a8e1175bSopenharmony_ci     lead to the seed file corruption in case if the path to the seed file is
1779a8e1175bSopenharmony_ci     equal to MBEDTLS_PLATFORM_STD_NV_SEED_FILE. Contributed by Victor
1780a8e1175bSopenharmony_ci     Krasnoshchok in #3616.
1781a8e1175bSopenharmony_ci   * PSA functions creating a key now return PSA_ERROR_INVALID_ARGUMENT rather
1782a8e1175bSopenharmony_ci     than PSA_ERROR_INVALID_HANDLE when the identifier specified for the key
1783a8e1175bSopenharmony_ci     to create is not valid, bringing them in line with version 1.0.0 of the
1784a8e1175bSopenharmony_ci     specification. Fix #4271.
1785a8e1175bSopenharmony_ci   * Add printf function attributes to mbedtls_debug_print_msg to ensure we
1786a8e1175bSopenharmony_ci     get printf format specifier warnings.
1787a8e1175bSopenharmony_ci   * PSA functions other than psa_open_key now return PSA_ERROR_INVALID_HANDLE
1788a8e1175bSopenharmony_ci     rather than PSA_ERROR_DOES_NOT_EXIST for an invalid handle, bringing them
1789a8e1175bSopenharmony_ci     in line with version 1.0.0 of the specification. Fix #4162.
1790a8e1175bSopenharmony_ci   * Fix a bug in ECDSA that would cause it to fail when the hash is all-bits
1791a8e1175bSopenharmony_ci     zero. Fixes #1792
1792a8e1175bSopenharmony_ci   * Fix some cases in the bignum module where the library constructed an
1793a8e1175bSopenharmony_ci     unintended representation of the value 0 which was not processed
1794a8e1175bSopenharmony_ci     correctly by some bignum operations. This could happen when
1795a8e1175bSopenharmony_ci     mbedtls_mpi_read_string() was called on "-0", or when
1796a8e1175bSopenharmony_ci     mbedtls_mpi_mul_mpi() and mbedtls_mpi_mul_int() was called with one of
1797a8e1175bSopenharmony_ci     the arguments being negative and the other being 0. Fixes #4643.
1798a8e1175bSopenharmony_ci   * Fix a compilation error when MBEDTLS_ECP_RANDOMIZE_MXZ_ALT is
1799a8e1175bSopenharmony_ci     defined. Fixes #4217.
1800a8e1175bSopenharmony_ci   * Fix an incorrect error code when parsing a PKCS#8 private key.
1801a8e1175bSopenharmony_ci   * In a TLS client, enforce the Diffie-Hellman minimum parameter size
1802a8e1175bSopenharmony_ci     set with mbedtls_ssl_conf_dhm_min_bitlen() precisely. Before, the
1803a8e1175bSopenharmony_ci     minimum size was rounded down to the nearest multiple of 8.
1804a8e1175bSopenharmony_ci   * In library/net_sockets.c, _POSIX_C_SOURCE and _XOPEN_SOURCE are
1805a8e1175bSopenharmony_ci     defined to specific values.  If the code is used in a context
1806a8e1175bSopenharmony_ci     where these are already defined, this can result in a compilation
1807a8e1175bSopenharmony_ci     error.  Instead, assume that if they are defined, the values will
1808a8e1175bSopenharmony_ci     be adequate to build Mbed TLS.
1809a8e1175bSopenharmony_ci   * With MBEDTLS_PSA_CRYPTO_C disabled, some functions were getting built
1810a8e1175bSopenharmony_ci     nonetheless, resulting in undefined reference errors when building a
1811a8e1175bSopenharmony_ci     shared library. Reported by Guillermo Garcia M. in #4411.
1812a8e1175bSopenharmony_ci   * The cipher suite TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384 was not available
1813a8e1175bSopenharmony_ci     when SHA-1 was disabled and was offered when SHA-1 was enabled but SHA-384
1814a8e1175bSopenharmony_ci     was disabled. Fix the dependency. Fixes #4472.
1815a8e1175bSopenharmony_ci   * Do not offer SHA384 cipher suites when SHA-384 is disabled. Fixes #4499.
1816a8e1175bSopenharmony_ci   * Fix test suite code on platforms where int32_t is not int, such as
1817a8e1175bSopenharmony_ci     Arm Cortex-M. Fixes #4530.
1818a8e1175bSopenharmony_ci   * Fix some issues affecting MBEDTLS_ARIA_ALT implementations: a misplaced
1819a8e1175bSopenharmony_ci     directive in a header and a missing initialization in the self-test.
1820a8e1175bSopenharmony_ci   * Fix a missing initialization in the Camellia self-test, affecting
1821a8e1175bSopenharmony_ci     MBEDTLS_CAMELLIA_ALT implementations.
1822a8e1175bSopenharmony_ci   * Restore the ability to configure PSA via Mbed TLS options to support RSA
1823a8e1175bSopenharmony_ci     key pair operations but exclude RSA key generation. When MBEDTLS_GENPRIME
1824a8e1175bSopenharmony_ci     is not defined PSA will no longer attempt to use mbedtls_rsa_gen_key().
1825a8e1175bSopenharmony_ci     Fixes #4512.
1826a8e1175bSopenharmony_ci   * Fix a regression introduced in 2.24.0 which broke (D)TLS CBC ciphersuites
1827a8e1175bSopenharmony_ci     (when the encrypt-then-MAC extension is not in use) with some ALT
1828a8e1175bSopenharmony_ci     implementations of the underlying hash (SHA-1, SHA-256, SHA-384), causing
1829a8e1175bSopenharmony_ci     the affected side to wrongly reject valid messages. Fixes #4118.
1830a8e1175bSopenharmony_ci   * Remove outdated check-config.h check that prevented implementing the
1831a8e1175bSopenharmony_ci     timing module on Mbed OS. Fixes #4633.
1832a8e1175bSopenharmony_ci   * Fix PSA_ALG_TLS12_PRF and PSA_ALG_TLS12_PSK_TO_MS being too permissive
1833a8e1175bSopenharmony_ci     about missing inputs.
1834a8e1175bSopenharmony_ci   * Fix mbedtls_net_poll() and mbedtls_net_recv_timeout() often failing with
1835a8e1175bSopenharmony_ci     MBEDTLS_ERR_NET_POLL_FAILED on Windows. Fixes #4465.
1836a8e1175bSopenharmony_ci   * Fix a resource leak in a test suite with an alternative AES
1837a8e1175bSopenharmony_ci     implementation. Fixes #4176.
1838a8e1175bSopenharmony_ci   * Fix a crash in mbedtls_mpi_debug_mpi on a bignum having 0 limbs. This
1839a8e1175bSopenharmony_ci     could notably be triggered by setting the TLS debug level to 3 or above
1840a8e1175bSopenharmony_ci     and using a Montgomery curve for the key exchange. Reported by lhuang04
1841a8e1175bSopenharmony_ci     in #4578. Fixes #4608.
1842a8e1175bSopenharmony_ci   * psa_verify_hash() was relying on implementation-specific behavior of
1843a8e1175bSopenharmony_ci     mbedtls_rsa_rsassa_pss_verify() and was causing failures in some _ALT
1844a8e1175bSopenharmony_ci     implementations. This reliance is now removed. Fixes #3990.
1845a8e1175bSopenharmony_ci   * Disallow inputs of length different from the corresponding hash when
1846a8e1175bSopenharmony_ci     signing or verifying with PSA_ALG_RSA_PSS (The PSA Crypto API mandates
1847a8e1175bSopenharmony_ci     that PSA_ALG_RSA_PSS uses the same hash throughout the algorithm.)
1848a8e1175bSopenharmony_ci   * Fix a null pointer dereference when mbedtls_mpi_exp_mod() was called with
1849a8e1175bSopenharmony_ci     A=0 represented with 0 limbs. Up to and including Mbed TLS 2.26, this bug
1850a8e1175bSopenharmony_ci     could not be triggered by code that constructed A with one of the
1851a8e1175bSopenharmony_ci     mbedtls_mpi_read_xxx functions (including in particular TLS code) since
1852a8e1175bSopenharmony_ci     those always built an mpi object with at least one limb.
1853a8e1175bSopenharmony_ci     Credit to OSS-Fuzz. Fixes #4641.
1854a8e1175bSopenharmony_ci   * Fix mbedtls_mpi_gcd(G,A,B) when the value of B is zero. This had no
1855a8e1175bSopenharmony_ci     effect on Mbed TLS's internal use of mbedtls_mpi_gcd(), but may affect
1856a8e1175bSopenharmony_ci     applications that call mbedtls_mpi_gcd() directly. Fixes #4642.
1857a8e1175bSopenharmony_ci   * The PSA API no longer allows the creation or destruction of keys with a
1858a8e1175bSopenharmony_ci     read-only lifetime. The persistence level PSA_KEY_PERSISTENCE_READ_ONLY
1859a8e1175bSopenharmony_ci     can now only be used as intended, for keys that cannot be modified through
1860a8e1175bSopenharmony_ci     normal use of the API.
1861a8e1175bSopenharmony_ci   * When MBEDTLS_PSA_CRYPTO_SPM is enabled, crypto_spe.h was not included
1862a8e1175bSopenharmony_ci     in all the right places. Include it from crypto_platform.h, which is
1863a8e1175bSopenharmony_ci     the natural place. Fixes #4649.
1864a8e1175bSopenharmony_ci   * Fix which alert is sent in some cases to conform to the
1865a8e1175bSopenharmony_ci     applicable RFC: on an invalid Finished message value, an
1866a8e1175bSopenharmony_ci     invalid max_fragment_length extension, or an
1867a8e1175bSopenharmony_ci     unsupported extension used by the server.
1868a8e1175bSopenharmony_ci   * Correct (change from 12 to 13 bytes) the value of the macro describing the
1869a8e1175bSopenharmony_ci     maximum nonce length returned by psa_aead_generate_nonce().
1870a8e1175bSopenharmony_ci
1871a8e1175bSopenharmony_ciChanges
1872a8e1175bSopenharmony_ci   * Fix the setting of the read timeout in the DTLS sample programs.
1873a8e1175bSopenharmony_ci   * Add extra printf compiler warning flags to builds.
1874a8e1175bSopenharmony_ci   * Fix memsan build false positive in x509_crt.c with clang 11
1875a8e1175bSopenharmony_ci   * Alternative implementations of CMAC may now opt to not support 3DES as a
1876a8e1175bSopenharmony_ci     CMAC block cipher, and still pass the CMAC self test.
1877a8e1175bSopenharmony_ci   * Remove the AES sample application programs/aes/aescrypt2 which shows
1878a8e1175bSopenharmony_ci     bad cryptographic practice. Fix #1906.
1879a8e1175bSopenharmony_ci   * Remove configs/config-psa-crypto.h, which no longer had any intended
1880a8e1175bSopenharmony_ci     differences from the default configuration, but had accidentally diverged.
1881a8e1175bSopenharmony_ci   * When building the test suites with GNU make, invoke python3 or python, not
1882a8e1175bSopenharmony_ci     python2, which is no longer supported upstream.
1883a8e1175bSopenharmony_ci   * fix build failure on MinGW toolchain when __USE_MING_ANSI_STDIO is on.
1884a8e1175bSopenharmony_ci     When that flag is on, standard GNU C printf format specifiers
1885a8e1175bSopenharmony_ci     should be used.
1886a8e1175bSopenharmony_ci   * Replace MBEDTLS_SSL_CID_PADDING_GRANULARITY and
1887a8e1175bSopenharmony_ci     MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY with a new single unified option
1888a8e1175bSopenharmony_ci     MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY. Fixes #4335.
1889a8e1175bSopenharmony_ci   * Reduce the default value of MBEDTLS_ECP_WINDOW_SIZE. This reduces RAM usage
1890a8e1175bSopenharmony_ci     during ECC operations at a negligible performance cost.
1891a8e1175bSopenharmony_ci   * mbedtls_mpi_read_binary(), mbedtls_mpi_read_binary_le() and
1892a8e1175bSopenharmony_ci     mbedtls_mpi_read_string() now construct an mbedtls_mpi object with 0 limbs
1893a8e1175bSopenharmony_ci     when their input has length 0. Note that this is an implementation detail
1894a8e1175bSopenharmony_ci     and can change at any time, so this change should be transparent, but it
1895a8e1175bSopenharmony_ci     may result in mbedtls_mpi_write_binary() or mbedtls_mpi_write_string()
1896a8e1175bSopenharmony_ci     now writing an empty string where it previously wrote one or more
1897a8e1175bSopenharmony_ci     zero digits when operating from values constructed with an mpi_read
1898a8e1175bSopenharmony_ci     function and some mpi operations.
1899a8e1175bSopenharmony_ci   * Add CMake package config generation for CMake projects consuming Mbed TLS.
1900a8e1175bSopenharmony_ci   * config.h has been split into build_info.h and mbedtls_config.h
1901a8e1175bSopenharmony_ci     build_info.h is intended to be included from C code directly, while
1902a8e1175bSopenharmony_ci     mbedtls_config.h is intended to be edited by end users wishing to
1903a8e1175bSopenharmony_ci     change the build configuration, and should generally only be included from
1904a8e1175bSopenharmony_ci     build_info.h.
1905a8e1175bSopenharmony_ci   * The handling of MBEDTLS_CONFIG_FILE has been moved into build_info.h.
1906a8e1175bSopenharmony_ci   * A config file version symbol, MBEDTLS_CONFIG_VERSION was introduced.
1907a8e1175bSopenharmony_ci     Defining it to a particular value will ensure that Mbed TLS interprets
1908a8e1175bSopenharmony_ci     the config file in a way that's compatible with the config file format
1909a8e1175bSopenharmony_ci     used by the Mbed TLS release whose MBEDTLS_VERSION_NUMBER has the same
1910a8e1175bSopenharmony_ci     value.
1911a8e1175bSopenharmony_ci     The only value supported by Mbed TLS 3.0.0 is 0x03000000.
1912a8e1175bSopenharmony_ci   * Various changes to which alert and/or error code may be returned
1913a8e1175bSopenharmony_ci   * during the TLS handshake.
1914a8e1175bSopenharmony_ci   * Implicitly add PSA_KEY_USAGE_SIGN_MESSAGE key usage policy flag when
1915a8e1175bSopenharmony_ci     PSA_KEY_USAGE_SIGN_HASH flag is set and PSA_KEY_USAGE_VERIFY_MESSAGE flag
1916a8e1175bSopenharmony_ci     when PSA_KEY_USAGE_VERIFY_HASH flag is set. This usage flag extension
1917a8e1175bSopenharmony_ci     is also applied when loading a key from storage.
1918a8e1175bSopenharmony_ci
1919a8e1175bSopenharmony_ci= mbed TLS 2.26.0 branch released 2021-03-08
1920a8e1175bSopenharmony_ci
1921a8e1175bSopenharmony_ciAPI changes
1922a8e1175bSopenharmony_ci   * Renamed the PSA Crypto API output buffer size macros to bring them in line
1923a8e1175bSopenharmony_ci     with version 1.0.0 of the specification.
1924a8e1175bSopenharmony_ci   * The API glue function mbedtls_ecc_group_of_psa() now takes the curve size
1925a8e1175bSopenharmony_ci     in bits rather than bytes, with an additional flag to indicate if the
1926a8e1175bSopenharmony_ci     size may have been rounded up to a whole number of bytes.
1927a8e1175bSopenharmony_ci   * Renamed the PSA Crypto API AEAD tag length macros to bring them in line
1928a8e1175bSopenharmony_ci     with version 1.0.0 of the specification.
1929a8e1175bSopenharmony_ci
1930a8e1175bSopenharmony_ciDefault behavior changes
1931a8e1175bSopenharmony_ci   * In mbedtls_rsa_context objects, the ver field was formerly documented
1932a8e1175bSopenharmony_ci     as always 0. It is now reserved for internal purposes and may take
1933a8e1175bSopenharmony_ci     different values.
1934a8e1175bSopenharmony_ci
1935a8e1175bSopenharmony_ciNew deprecations
1936a8e1175bSopenharmony_ci   * PSA_KEY_EXPORT_MAX_SIZE, PSA_HASH_SIZE, PSA_MAC_FINAL_SIZE,
1937a8e1175bSopenharmony_ci     PSA_BLOCK_CIPHER_BLOCK_SIZE, PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE and
1938a8e1175bSopenharmony_ci     PSA_ALG_TLS12_PSK_TO_MS_MAX_PSK_LEN have been renamed, and the old names
1939a8e1175bSopenharmony_ci     deprecated.
1940a8e1175bSopenharmony_ci   * PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH and PSA_ALG_AEAD_WITH_TAG_LENGTH
1941a8e1175bSopenharmony_ci     have been renamed, and the old names deprecated.
1942a8e1175bSopenharmony_ci
1943a8e1175bSopenharmony_ciFeatures
1944a8e1175bSopenharmony_ci   * The PSA crypto subsystem can now use HMAC_DRBG instead of CTR_DRBG.
1945a8e1175bSopenharmony_ci     CTR_DRBG is used by default if it is available, but you can override
1946a8e1175bSopenharmony_ci     this choice by setting MBEDTLS_PSA_HMAC_DRBG_MD_TYPE at compile time.
1947a8e1175bSopenharmony_ci     Fix #3354.
1948a8e1175bSopenharmony_ci   * Automatic fallback to a software implementation of ECP when
1949a8e1175bSopenharmony_ci     MBEDTLS_ECP_xxx_ALT accelerator hooks are in use can now be turned off
1950a8e1175bSopenharmony_ci     through setting the new configuration flag MBEDTLS_ECP_NO_FALLBACK.
1951a8e1175bSopenharmony_ci   * The PSA crypto subsystem can now be configured to use less static RAM by
1952a8e1175bSopenharmony_ci     tweaking the setting for the maximum amount of keys simultaneously in RAM.
1953a8e1175bSopenharmony_ci     MBEDTLS_PSA_KEY_SLOT_COUNT sets the maximum number of volatile keys that
1954a8e1175bSopenharmony_ci     can exist simultaneously. It has a sensible default if not overridden.
1955a8e1175bSopenharmony_ci   * Partial implementation of the PSA crypto driver interface: Mbed TLS can
1956a8e1175bSopenharmony_ci     now use an external random generator instead of the library's own
1957a8e1175bSopenharmony_ci     entropy collection and DRBG code. Enable MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
1958a8e1175bSopenharmony_ci     and see the documentation of mbedtls_psa_external_get_random() for details.
1959a8e1175bSopenharmony_ci   * Applications using both mbedtls_xxx and psa_xxx functions (for example,
1960a8e1175bSopenharmony_ci     applications using TLS and MBEDTLS_USE_PSA_CRYPTO) can now use the PSA
1961a8e1175bSopenharmony_ci     random generator with mbedtls_xxx functions. See the documentation of
1962a8e1175bSopenharmony_ci     mbedtls_psa_get_random() for details.
1963a8e1175bSopenharmony_ci   * In the PSA API, the policy for a MAC or AEAD algorithm can specify a
1964a8e1175bSopenharmony_ci     minimum MAC or tag length thanks to the new wildcards
1965a8e1175bSopenharmony_ci     PSA_ALG_AT_LEAST_THIS_LENGTH_MAC and
1966a8e1175bSopenharmony_ci     PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG.
1967a8e1175bSopenharmony_ci
1968a8e1175bSopenharmony_ciSecurity
1969a8e1175bSopenharmony_ci   * Fix a security reduction in CTR_DRBG when the initial seeding obtained a
1970a8e1175bSopenharmony_ci     nonce from entropy. Applications were affected if they called
1971a8e1175bSopenharmony_ci     mbedtls_ctr_drbg_set_nonce_len(), if they called
1972a8e1175bSopenharmony_ci     mbedtls_ctr_drbg_set_entropy_len() with a size that was 3/2 times the key
1973a8e1175bSopenharmony_ci     length, or when the entropy module uses SHA-256 and CTR_DRBG uses AES-256.
1974a8e1175bSopenharmony_ci     In such cases, a random nonce was necessary to achieve the advertised
1975a8e1175bSopenharmony_ci     security strength, but the code incorrectly used a constant instead of
1976a8e1175bSopenharmony_ci     entropy from the nonce.
1977a8e1175bSopenharmony_ci     Found by John Stroebel in #3819 and fixed in #3973.
1978a8e1175bSopenharmony_ci   * Fix a buffer overflow in mbedtls_mpi_sub_abs() when calculating
1979a8e1175bSopenharmony_ci     |A| - |B| where |B| is larger than |A| and has more limbs (so the
1980a8e1175bSopenharmony_ci     function should return MBEDTLS_ERR_MPI_NEGATIVE_VALUE). Only
1981a8e1175bSopenharmony_ci     applications calling mbedtls_mpi_sub_abs() directly are affected:
1982a8e1175bSopenharmony_ci     all calls inside the library were safe since this function is
1983a8e1175bSopenharmony_ci     only called with |A| >= |B|. Reported by Guido Vranken in #4042.
1984a8e1175bSopenharmony_ci   * Fix an errorneous estimation for an internal buffer in
1985a8e1175bSopenharmony_ci     mbedtls_pk_write_key_pem(). If MBEDTLS_MPI_MAX_SIZE is set to an odd
1986a8e1175bSopenharmony_ci     value the function might fail to write a private RSA keys of the largest
1987a8e1175bSopenharmony_ci     supported size.
1988a8e1175bSopenharmony_ci     Found by Daniel Otte, reported in #4093 and fixed in #4094.
1989a8e1175bSopenharmony_ci   * Fix a stack buffer overflow with mbedtls_net_poll() and
1990a8e1175bSopenharmony_ci     mbedtls_net_recv_timeout() when given a file descriptor that is
1991a8e1175bSopenharmony_ci     beyond FD_SETSIZE. Reported by FigBug in #4169.
1992a8e1175bSopenharmony_ci   * Guard against strong local side channel attack against base64 tables by
1993a8e1175bSopenharmony_ci     making access aceess to them use constant flow code.
1994a8e1175bSopenharmony_ci
1995a8e1175bSopenharmony_ciBugfix
1996a8e1175bSopenharmony_ci   * Fix use-after-scope error in programs/ssl/ssl_client2.c and ssl_server2.c
1997a8e1175bSopenharmony_ci   * Fix memory leak that occured when calling psa_close_key() on a
1998a8e1175bSopenharmony_ci     wrapped key with MBEDTLS_PSA_CRYPTO_SE_C defined.
1999a8e1175bSopenharmony_ci   * Fix an incorrect error code if an RSA private operation glitched.
2000a8e1175bSopenharmony_ci   * Fix a memory leak in an error case in psa_generate_derived_key_internal().
2001a8e1175bSopenharmony_ci   * Fix a resource leak in CTR_DRBG and HMAC_DRBG when MBEDTLS_THREADING_C
2002a8e1175bSopenharmony_ci     is enabled, on platforms where initializing a mutex allocates resources.
2003a8e1175bSopenharmony_ci     This was a regression introduced in the previous release. Reported in
2004a8e1175bSopenharmony_ci     #4017, #4045 and #4071.
2005a8e1175bSopenharmony_ci   * Ensure that calling mbedtls_rsa_free() or mbedtls_entropy_free()
2006a8e1175bSopenharmony_ci     twice is safe. This happens for RSA when some Mbed TLS library functions
2007a8e1175bSopenharmony_ci     fail. Such a double-free was not safe when MBEDTLS_THREADING_C was
2008a8e1175bSopenharmony_ci     enabled on platforms where freeing a mutex twice is not safe.
2009a8e1175bSopenharmony_ci   * Fix a resource leak in a bad-arguments case of mbedtls_rsa_gen_key()
2010a8e1175bSopenharmony_ci     when MBEDTLS_THREADING_C is enabled on platforms where initializing
2011a8e1175bSopenharmony_ci     a mutex allocates resources.
2012a8e1175bSopenharmony_ci   * Fixes a bug where, if the library was configured to include support for
2013a8e1175bSopenharmony_ci     both the old SE interface and the new PSA driver interface, external keys were
2014a8e1175bSopenharmony_ci     not loaded from storage. This was fixed by #3996.
2015a8e1175bSopenharmony_ci   * This change makes 'mbedtls_x509write_crt_set_basic_constraints'
2016a8e1175bSopenharmony_ci     consistent with RFC 5280 4.2.1.9 which says: "Conforming CAs MUST
2017a8e1175bSopenharmony_ci     include this extension in all CA certificates that contain public keys
2018a8e1175bSopenharmony_ci     used to validate digital signatures on certificates and MUST mark the
2019a8e1175bSopenharmony_ci     extension as critical in such certificates." Previous to this change,
2020a8e1175bSopenharmony_ci     the extension was always marked as non-critical. This was fixed by
2021a8e1175bSopenharmony_ci     #3698.
2022a8e1175bSopenharmony_ci
2023a8e1175bSopenharmony_ciChanges
2024a8e1175bSopenharmony_ci   * A new library C file psa_crypto_client.c has been created to contain
2025a8e1175bSopenharmony_ci     the PSA code needed by a PSA crypto client when the PSA crypto
2026a8e1175bSopenharmony_ci     implementation is not included into the library.
2027a8e1175bSopenharmony_ci   * On recent enough versions of FreeBSD and DragonFlyBSD, the entropy module
2028a8e1175bSopenharmony_ci     now uses the getrandom syscall instead of reading from /dev/urandom.
2029a8e1175bSopenharmony_ci
2030a8e1175bSopenharmony_ci= mbed TLS 2.25.0 branch released 2020-12-11
2031a8e1175bSopenharmony_ci
2032a8e1175bSopenharmony_ciAPI changes
2033a8e1175bSopenharmony_ci   * The numerical values of the PSA Crypto API macros have been updated to
2034a8e1175bSopenharmony_ci     conform to version 1.0.0 of the specification.
2035a8e1175bSopenharmony_ci   * PSA_ALG_STREAM_CIPHER replaces PSA_ALG_CHACHA20 and PSA_ALG_ARC4.
2036a8e1175bSopenharmony_ci     The underlying stream cipher is determined by the key type
2037a8e1175bSopenharmony_ci     (PSA_KEY_TYPE_CHACHA20 or PSA_KEY_TYPE_ARC4).
2038a8e1175bSopenharmony_ci   * The functions mbedtls_cipher_auth_encrypt() and
2039a8e1175bSopenharmony_ci     mbedtls_cipher_auth_decrypt() no longer accept NIST_KW contexts,
2040a8e1175bSopenharmony_ci     as they have no way to check if the output buffer is large enough.
2041a8e1175bSopenharmony_ci     Please use mbedtls_cipher_auth_encrypt_ext() and
2042a8e1175bSopenharmony_ci     mbedtls_cipher_auth_decrypt_ext() instead. Credit to OSS-Fuzz and
2043a8e1175bSopenharmony_ci     Cryptofuzz. Fixes #3665.
2044a8e1175bSopenharmony_ci
2045a8e1175bSopenharmony_ciRequirement changes
2046a8e1175bSopenharmony_ci   * Update the minimum required CMake version to 2.8.12.  This silences a
2047a8e1175bSopenharmony_ci     warning on CMake 3.19.0. #3801
2048a8e1175bSopenharmony_ci
2049a8e1175bSopenharmony_ciNew deprecations
2050a8e1175bSopenharmony_ci   * PSA_ALG_CHACHA20 and PSA_ALG_ARC4 have been deprecated.
2051a8e1175bSopenharmony_ci     Use PSA_ALG_STREAM_CIPHER instead.
2052a8e1175bSopenharmony_ci   * The functions mbedtls_cipher_auth_encrypt() and
2053a8e1175bSopenharmony_ci     mbedtls_cipher_auth_decrypt() are deprecated in favour of the new
2054a8e1175bSopenharmony_ci     functions mbedtls_cipher_auth_encrypt_ext() and
2055a8e1175bSopenharmony_ci     mbedtls_cipher_auth_decrypt_ext(). Please note that with AEAD ciphers,
2056a8e1175bSopenharmony_ci     these new functions always append the tag to the ciphertext, and include
2057a8e1175bSopenharmony_ci     the tag in the ciphertext length.
2058a8e1175bSopenharmony_ci
2059a8e1175bSopenharmony_ciFeatures
2060a8e1175bSopenharmony_ci   * Partial implementation of the new PSA Crypto accelerator APIs. (Symmetric
2061a8e1175bSopenharmony_ci     ciphers, asymmetric signing/verification and key generation, validate_key
2062a8e1175bSopenharmony_ci     entry point, and export_public_key interface.)
2063a8e1175bSopenharmony_ci   * Add support for ECB to the PSA cipher API.
2064a8e1175bSopenharmony_ci   * In PSA, allow using a key declared with a base key agreement algorithm
2065a8e1175bSopenharmony_ci     in combined key agreement and derivation operations, as long as the key
2066a8e1175bSopenharmony_ci     agreement algorithm in use matches the algorithm the key was declared with.
2067a8e1175bSopenharmony_ci     This is currently non-standard behaviour, but expected to make it into a
2068a8e1175bSopenharmony_ci     future revision of the PSA Crypto standard.
2069a8e1175bSopenharmony_ci   * Add MBEDTLS_TARGET_PREFIX CMake variable, which is prefixed to the mbedtls,
2070a8e1175bSopenharmony_ci     mbedcrypto, mbedx509 and apidoc CMake target names. This can be used by
2071a8e1175bSopenharmony_ci     external CMake projects that include this one to avoid CMake target name
2072a8e1175bSopenharmony_ci     clashes.  The default value of this variable is "", so default target names
2073a8e1175bSopenharmony_ci     are unchanged.
2074a8e1175bSopenharmony_ci   * Add support for DTLS-SRTP as defined in RFC 5764. Contributed by Johan
2075a8e1175bSopenharmony_ci     Pascal, improved by Ron Eldor.
2076a8e1175bSopenharmony_ci   * In the PSA API, it is no longer necessary to open persistent keys:
2077a8e1175bSopenharmony_ci     operations now accept the key identifier. The type psa_key_handle_t is now
2078a8e1175bSopenharmony_ci     identical to psa_key_id_t instead of being platform-defined. This bridges
2079a8e1175bSopenharmony_ci     the last major gap to compliance with the PSA Cryptography specification
2080a8e1175bSopenharmony_ci     version 1.0.0. Opening persistent keys is still supported for backward
2081a8e1175bSopenharmony_ci     compatibility, but will be deprecated and later removed in future
2082a8e1175bSopenharmony_ci     releases.
2083a8e1175bSopenharmony_ci   * PSA_AEAD_NONCE_LENGTH, PSA_AEAD_NONCE_MAX_SIZE, PSA_CIPHER_IV_LENGTH and
2084a8e1175bSopenharmony_ci     PSA_CIPHER_IV_MAX_SIZE macros have been added as defined in version
2085a8e1175bSopenharmony_ci     1.0.0 of the PSA Crypto API specification.
2086a8e1175bSopenharmony_ci
2087a8e1175bSopenharmony_ciSecurity
2088a8e1175bSopenharmony_ci   * The functions mbedtls_cipher_auth_encrypt() and
2089a8e1175bSopenharmony_ci     mbedtls_cipher_auth_decrypt() would write past the minimum documented
2090a8e1175bSopenharmony_ci     size of the output buffer when used with NIST_KW. As a result, code using
2091a8e1175bSopenharmony_ci     those functions as documented with NIST_KW could have a buffer overwrite
2092a8e1175bSopenharmony_ci     of up to 15 bytes, with consequences ranging up to arbitrary code
2093a8e1175bSopenharmony_ci     execution depending on the location of the output buffer.
2094a8e1175bSopenharmony_ci   * Limit the size of calculations performed by mbedtls_mpi_exp_mod to
2095a8e1175bSopenharmony_ci     MBEDTLS_MPI_MAX_SIZE to prevent a potential denial of service when
2096a8e1175bSopenharmony_ci     generating Diffie-Hellman key pairs. Credit to OSS-Fuzz.
2097a8e1175bSopenharmony_ci   * A failure of the random generator was ignored in mbedtls_mpi_fill_random(),
2098a8e1175bSopenharmony_ci     which is how most uses of randomization in asymmetric cryptography
2099a8e1175bSopenharmony_ci     (including key generation, intermediate value randomization and blinding)
2100a8e1175bSopenharmony_ci     are implemented. This could cause failures or the silent use of non-random
2101a8e1175bSopenharmony_ci     values. A random generator can fail if it needs reseeding and cannot not
2102a8e1175bSopenharmony_ci     obtain entropy, or due to an internal failure (which, for Mbed TLS's own
2103a8e1175bSopenharmony_ci     CTR_DRBG or HMAC_DRBG, can only happen due to a misconfiguration).
2104a8e1175bSopenharmony_ci   * Fix a compliance issue whereby we were not checking the tag on the
2105a8e1175bSopenharmony_ci     algorithm parameters (only the size) when comparing the signature in the
2106a8e1175bSopenharmony_ci     description part of the cert to the real signature. This meant that a
2107a8e1175bSopenharmony_ci     NULL algorithm parameters entry would look identical to an array of REAL
2108a8e1175bSopenharmony_ci     (size zero) to the library and thus the certificate would be considered
2109a8e1175bSopenharmony_ci     valid. However, if the parameters do not match in *any* way then the
2110a8e1175bSopenharmony_ci     certificate should be considered invalid, and indeed OpenSSL marks these
2111a8e1175bSopenharmony_ci     certs as invalid when mbedtls did not.
2112a8e1175bSopenharmony_ci     Many thanks to guidovranken who found this issue via differential fuzzing
2113a8e1175bSopenharmony_ci     and reported it in #3629.
2114a8e1175bSopenharmony_ci   * Zeroising of local buffers and variables which are used for calculations
2115a8e1175bSopenharmony_ci     in mbedtls_pkcs5_pbkdf2_hmac(), mbedtls_internal_sha*_process(),
2116a8e1175bSopenharmony_ci     mbedtls_internal_md*_process() and mbedtls_internal_ripemd160_process()
2117a8e1175bSopenharmony_ci     functions to erase sensitive data from memory. Reported by
2118a8e1175bSopenharmony_ci     Johan Malmgren and Johan Uppman Bruce from Sectra.
2119a8e1175bSopenharmony_ci
2120a8e1175bSopenharmony_ciBugfix
2121a8e1175bSopenharmony_ci   * Fix an invalid (but nonzero) return code from mbedtls_pk_parse_subpubkey()
2122a8e1175bSopenharmony_ci     when the input has trailing garbage. Fixes #2512.
2123a8e1175bSopenharmony_ci   * Fix build failure in configurations where MBEDTLS_USE_PSA_CRYPTO is
2124a8e1175bSopenharmony_ci     enabled but ECDSA is disabled. Contributed by jdurkop. Fixes #3294.
2125a8e1175bSopenharmony_ci   * Include the psa_constant_names generated source code in the source tree
2126a8e1175bSopenharmony_ci     instead of generating it at build time. Fixes #3524.
2127a8e1175bSopenharmony_ci   * Fix rsa_prepare_blinding() to retry when the blinding value is not
2128a8e1175bSopenharmony_ci     invertible (mod N), instead of returning MBEDTLS_ERR_RSA_RNG_FAILED. This
2129a8e1175bSopenharmony_ci     addresses a regression but is rare in practice (approx. 1 in 2/sqrt(N)).
2130a8e1175bSopenharmony_ci     Found by Synopsys Coverity, fix contributed by Peter Kolbus (Garmin).
2131a8e1175bSopenharmony_ci     Fixes #3647.
2132a8e1175bSopenharmony_ci   * Use socklen_t on Android and other POSIX-compliant system
2133a8e1175bSopenharmony_ci   * Fix the build when the macro _GNU_SOURCE is defined to a non-empty value.
2134a8e1175bSopenharmony_ci     Fix #3432.
2135a8e1175bSopenharmony_ci   * Consistently return PSA_ERROR_INVALID_ARGUMENT on invalid cipher input
2136a8e1175bSopenharmony_ci     sizes (instead of PSA_ERROR_BAD_STATE in some cases) to make the
2137a8e1175bSopenharmony_ci     psa_cipher_* functions compliant with the PSA Crypto API specification.
2138a8e1175bSopenharmony_ci   * mbedtls_ecp_curve_list() now lists Curve25519 and Curve448 under the names
2139a8e1175bSopenharmony_ci     "x25519" and "x448". These curves support ECDH but not ECDSA. If you need
2140a8e1175bSopenharmony_ci     only the curves that support ECDSA, filter the list with
2141a8e1175bSopenharmony_ci     mbedtls_ecdsa_can_do().
2142a8e1175bSopenharmony_ci   * Fix psa_generate_key() returning an error when asked to generate
2143a8e1175bSopenharmony_ci     an ECC key pair on Curve25519 or secp244k1.
2144a8e1175bSopenharmony_ci   * Fix psa_key_derivation_output_key() to allow the output of a combined key
2145a8e1175bSopenharmony_ci     agreement and subsequent key derivation operation to be used as a key
2146a8e1175bSopenharmony_ci     inside of the PSA Crypto core.
2147a8e1175bSopenharmony_ci   * Fix handling of EOF against 0xff bytes and on platforms with unsigned
2148a8e1175bSopenharmony_ci     chars. Fixes a build failure on platforms where char is unsigned. Fixes
2149a8e1175bSopenharmony_ci     #3794.
2150a8e1175bSopenharmony_ci   * Fix an off-by-one error in the additional data length check for
2151a8e1175bSopenharmony_ci     CCM, which allowed encryption with a non-standard length field.
2152a8e1175bSopenharmony_ci     Fixes #3719.
2153a8e1175bSopenharmony_ci   * Correct the default IV size for mbedtls_cipher_info_t structures using
2154a8e1175bSopenharmony_ci     MBEDTLS_MODE_ECB to 0, since ECB mode ciphers don't use IVs.
2155a8e1175bSopenharmony_ci   * Make arc4random_buf available on NetBSD and OpenBSD when _POSIX_C_SOURCE is
2156a8e1175bSopenharmony_ci     defined. Fix contributed in #3571.
2157a8e1175bSopenharmony_ci   * Fix conditions for including string.h in error.c. Fixes #3866.
2158a8e1175bSopenharmony_ci   * psa_set_key_id() now also sets the lifetime to persistent for keys located
2159a8e1175bSopenharmony_ci     in a secure element.
2160a8e1175bSopenharmony_ci   * Attempting to create a volatile key with a non-zero key identifier now
2161a8e1175bSopenharmony_ci     fails. Previously the key identifier was just ignored when creating a
2162a8e1175bSopenharmony_ci     volatile key.
2163a8e1175bSopenharmony_ci   * Attempting to create or register a key with a key identifier in the vendor
2164a8e1175bSopenharmony_ci     range now fails.
2165a8e1175bSopenharmony_ci   * Fix build failures on GCC 11. Fixes #3782.
2166a8e1175bSopenharmony_ci   * Add missing arguments of debug message in mbedtls_ssl_decrypt_buf.
2167a8e1175bSopenharmony_ci   * Fix a memory leak in mbedtls_mpi_sub_abs() when the result was negative
2168a8e1175bSopenharmony_ci     (an error condition) and the second operand was aliased to the result.
2169a8e1175bSopenharmony_ci   * Fix a case in elliptic curve arithmetic where an out-of-memory condition
2170a8e1175bSopenharmony_ci     could go undetected, resulting in an incorrect result.
2171a8e1175bSopenharmony_ci   * In CTR_DRBG and HMAC_DRBG, don't reset the reseed interval in seed().
2172a8e1175bSopenharmony_ci     Fixes #2927.
2173a8e1175bSopenharmony_ci   * In PEM writing functions, fill the trailing part of the buffer with null
2174a8e1175bSopenharmony_ci     bytes. This guarantees that the corresponding parsing function can read
2175a8e1175bSopenharmony_ci     the buffer back, which was the case for mbedtls_x509write_{crt,csr}_pem
2176a8e1175bSopenharmony_ci     until this property was inadvertently broken in Mbed TLS 2.19.0.
2177a8e1175bSopenharmony_ci     Fixes #3682.
2178a8e1175bSopenharmony_ci   * Fix a build failure that occurred with the MBEDTLS_AES_SETKEY_DEC_ALT
2179a8e1175bSopenharmony_ci     option on. In this configuration key management methods that are required
2180a8e1175bSopenharmony_ci     for MBEDTLS_CIPHER_MODE_XTS were excluded from the build and made it fail.
2181a8e1175bSopenharmony_ci     Fixes #3818. Reported by John Stroebel.
2182a8e1175bSopenharmony_ci
2183a8e1175bSopenharmony_ciChanges
2184a8e1175bSopenharmony_ci   * Reduce stack usage significantly during sliding window exponentiation.
2185a8e1175bSopenharmony_ci     Reported in #3591 and fix contributed in #3592 by Daniel Otte.
2186a8e1175bSopenharmony_ci   * The PSA persistent storage format is updated to always store the key bits
2187a8e1175bSopenharmony_ci     attribute. No automatic upgrade path is provided. Previously stored keys
2188a8e1175bSopenharmony_ci     must be erased, or manually upgraded based on the key storage format
2189a8e1175bSopenharmony_ci     specification (docs/architecture/mbed-crypto-storage-specification.md).
2190a8e1175bSopenharmony_ci     Fixes #3740.
2191a8e1175bSopenharmony_ci   * Remove the zeroization of a pointer variable in AES rounds. It was valid
2192a8e1175bSopenharmony_ci     but spurious and misleading since it looked like a mistaken attempt to
2193a8e1175bSopenharmony_ci     zeroize the pointed-to buffer. Reported by Antonio de la Piedra, CEA
2194a8e1175bSopenharmony_ci     Leti, France.
2195a8e1175bSopenharmony_ci
2196a8e1175bSopenharmony_ci= mbed TLS 2.24.0 branch released 2020-09-01
2197a8e1175bSopenharmony_ci
2198a8e1175bSopenharmony_ciAPI changes
2199a8e1175bSopenharmony_ci   * In the PSA API, rename the types of elliptic curve and Diffie-Hellman
2200a8e1175bSopenharmony_ci     group families to psa_ecc_family_t and psa_dh_family_t, in line with the
2201a8e1175bSopenharmony_ci     PSA Crypto API specification version 1.0.0.
2202a8e1175bSopenharmony_ci     Rename associated macros as well:
2203a8e1175bSopenharmony_ci     PSA_ECC_CURVE_xxx renamed to PSA_ECC_FAMILY_xxx
2204a8e1175bSopenharmony_ci     PSA_DH_GROUP_xxx renamed to PSA_DH_FAMILY_xxx
2205a8e1175bSopenharmony_ci     PSA_KEY_TYPE_GET_CURVE renamed to to PSA_KEY_TYPE_ECC_GET_FAMILY
2206a8e1175bSopenharmony_ci     PSA_KEY_TYPE_GET_GROUP renamed to PSA_KEY_TYPE_DH_GET_FAMILY
2207a8e1175bSopenharmony_ci
2208a8e1175bSopenharmony_ciDefault behavior changes
2209a8e1175bSopenharmony_ci   * Stop storing persistent information about externally stored keys created
2210a8e1175bSopenharmony_ci     through PSA Crypto with a volatile lifetime. Reported in #3288 and
2211a8e1175bSopenharmony_ci     contributed by Steven Cooreman in #3382.
2212a8e1175bSopenharmony_ci
2213a8e1175bSopenharmony_ciFeatures
2214a8e1175bSopenharmony_ci   * The new function mbedtls_ecp_write_key() exports private ECC keys back to
2215a8e1175bSopenharmony_ci     a byte buffer. It is the inverse of the existing mbedtls_ecp_read_key().
2216a8e1175bSopenharmony_ci   * Support building on e2k (Elbrus) architecture: correctly enable
2217a8e1175bSopenharmony_ci     -Wformat-signedness, and fix the code that causes signed-one-bit-field
2218a8e1175bSopenharmony_ci     and sign-compare warnings. Contributed by makise-homura (Igor Molchanov)
2219a8e1175bSopenharmony_ci     <akemi_homura@kurisa.ch>.
2220a8e1175bSopenharmony_ci
2221a8e1175bSopenharmony_ciSecurity
2222a8e1175bSopenharmony_ci   * Fix a vulnerability in the verification of X.509 certificates when
2223a8e1175bSopenharmony_ci     matching the expected common name (the cn argument of
2224a8e1175bSopenharmony_ci     mbedtls_x509_crt_verify()) with the actual certificate name: when the
2225a8e1175bSopenharmony_ci     subjecAltName extension is present, the expected name was compared to any
2226a8e1175bSopenharmony_ci     name in that extension regardless of its type. This means that an
2227a8e1175bSopenharmony_ci     attacker could for example impersonate a 4-bytes or 16-byte domain by
2228a8e1175bSopenharmony_ci     getting a certificate for the corresponding IPv4 or IPv6 (this would
2229a8e1175bSopenharmony_ci     require the attacker to control that IP address, though). Similar attacks
2230a8e1175bSopenharmony_ci     using other subjectAltName name types might be possible. Found and
2231a8e1175bSopenharmony_ci     reported by kFYatek in #3498.
2232a8e1175bSopenharmony_ci   * When checking X.509 CRLs, a certificate was only considered as revoked if
2233a8e1175bSopenharmony_ci     its revocationDate was in the past according to the local clock if
2234a8e1175bSopenharmony_ci     available. In particular, on builds without MBEDTLS_HAVE_TIME_DATE,
2235a8e1175bSopenharmony_ci     certificates were never considered as revoked. On builds with
2236a8e1175bSopenharmony_ci     MBEDTLS_HAVE_TIME_DATE, an attacker able to control the local clock (for
2237a8e1175bSopenharmony_ci     example, an untrusted OS attacking a secure enclave) could prevent
2238a8e1175bSopenharmony_ci     revocation of certificates via CRLs. Fixed by no longer checking the
2239a8e1175bSopenharmony_ci     revocationDate field, in accordance with RFC 5280. Reported by
2240a8e1175bSopenharmony_ci     yuemonangong in #3340. Reported independently and fixed by
2241a8e1175bSopenharmony_ci     Raoul Strackx and Jethro Beekman in #3433.
2242a8e1175bSopenharmony_ci   * In (D)TLS record decryption, when using a CBC ciphersuites without the
2243a8e1175bSopenharmony_ci     Encrypt-then-Mac extension, use constant code flow memory access patterns
2244a8e1175bSopenharmony_ci     to extract and check the MAC. This is an improvement to the existing
2245a8e1175bSopenharmony_ci     countermeasure against Lucky 13 attacks. The previous countermeasure was
2246a8e1175bSopenharmony_ci     effective against network-based attackers, but less so against local
2247a8e1175bSopenharmony_ci     attackers. The new countermeasure defends against local attackers, even
2248a8e1175bSopenharmony_ci     if they have access to fine-grained measurements. In particular, this
2249a8e1175bSopenharmony_ci     fixes a local Lucky 13 cache attack found and reported by Tuba Yavuz,
2250a8e1175bSopenharmony_ci     Farhaan Fowze, Ken (Yihan) Bai, Grant Hernandez, and Kevin Butler
2251a8e1175bSopenharmony_ci     (University of Florida) and Dave Tian (Purdue University).
2252a8e1175bSopenharmony_ci   * Fix side channel in RSA private key operations and static (finite-field)
2253a8e1175bSopenharmony_ci     Diffie-Hellman. An adversary with precise enough timing and memory access
2254a8e1175bSopenharmony_ci     information (typically an untrusted operating system attacking a secure
2255a8e1175bSopenharmony_ci     enclave) could bypass an existing counter-measure (base blinding) and
2256a8e1175bSopenharmony_ci     potentially fully recover the private key.
2257a8e1175bSopenharmony_ci   * Fix a 1-byte buffer overread in mbedtls_x509_crl_parse_der().
2258a8e1175bSopenharmony_ci     Credit to OSS-Fuzz for detecting the problem and to Philippe Antoine
2259a8e1175bSopenharmony_ci     for pinpointing the problematic code.
2260a8e1175bSopenharmony_ci   * Zeroising of plaintext buffers in mbedtls_ssl_read() to erase unused
2261a8e1175bSopenharmony_ci     application data from memory. Reported in #689 by
2262a8e1175bSopenharmony_ci     Johan Uppman Bruce of Sectra.
2263a8e1175bSopenharmony_ci
2264a8e1175bSopenharmony_ciBugfix
2265a8e1175bSopenharmony_ci   * Library files installed after a CMake build no longer have execute
2266a8e1175bSopenharmony_ci     permission.
2267a8e1175bSopenharmony_ci   * Use local labels in mbedtls_padlock_has_support() to fix an invalid symbol
2268a8e1175bSopenharmony_ci     redefinition if the function is inlined.
2269a8e1175bSopenharmony_ci     Reported in #3451 and fix contributed in #3452 by okhowang.
2270a8e1175bSopenharmony_ci   * Fix the endianness of Curve25519 keys imported/exported through the PSA
2271a8e1175bSopenharmony_ci     APIs. psa_import_key and psa_export_key will now correctly expect/output
2272a8e1175bSopenharmony_ci     Montgomery keys in little-endian as defined by RFC7748. Contributed by
2273a8e1175bSopenharmony_ci     Steven Cooreman in #3425.
2274a8e1175bSopenharmony_ci   * Fix build errors when the only enabled elliptic curves are Montgomery
2275a8e1175bSopenharmony_ci     curves. Raised by signpainter in #941 and by Taiki-San in #1412. This
2276a8e1175bSopenharmony_ci     also fixes missing declarations reported by Steven Cooreman in #1147.
2277a8e1175bSopenharmony_ci   * Fix self-test failure when the only enabled short Weierstrass elliptic
2278a8e1175bSopenharmony_ci     curve is secp192k1. Fixes #2017.
2279a8e1175bSopenharmony_ci   * PSA key import will now correctly import a Curve25519/Curve448 public key
2280a8e1175bSopenharmony_ci     instead of erroring out. Contributed by Steven Cooreman in #3492.
2281a8e1175bSopenharmony_ci   * Use arc4random_buf on NetBSD instead of rand implementation with cyclical
2282a8e1175bSopenharmony_ci     lower bits. Fix contributed in #3540.
2283a8e1175bSopenharmony_ci   * Fix a memory leak in mbedtls_md_setup() when using HMAC under low memory
2284a8e1175bSopenharmony_ci     conditions. Reported and fix suggested by Guido Vranken in #3486.
2285a8e1175bSopenharmony_ci   * Fix bug in redirection of unit test outputs on platforms where stdout is
2286a8e1175bSopenharmony_ci     defined as a macro. First reported in #2311 and fix contributed in #3528.
2287a8e1175bSopenharmony_ci
2288a8e1175bSopenharmony_ciChanges
2289a8e1175bSopenharmony_ci   * Only pass -Wformat-signedness to versions of GCC that support it. Reported
2290a8e1175bSopenharmony_ci     in #3478 and fix contributed in #3479 by okhowang.
2291a8e1175bSopenharmony_ci   * Reduce the stack consumption of mbedtls_x509write_csr_der() which
2292a8e1175bSopenharmony_ci     previously could lead to stack overflow on constrained devices.
2293a8e1175bSopenharmony_ci     Contributed by Doru Gucea and Simon Leet in #3464.
2294a8e1175bSopenharmony_ci   * Undefine the ASSERT macro before defining it locally, in case it is defined
2295a8e1175bSopenharmony_ci     in a platform header. Contributed by Abdelatif Guettouche in #3557.
2296a8e1175bSopenharmony_ci   * Update copyright notices to use Linux Foundation guidance. As a result,
2297a8e1175bSopenharmony_ci     the copyright of contributors other than Arm is now acknowledged, and the
2298a8e1175bSopenharmony_ci     years of publishing are no longer tracked in the source files. This also
2299a8e1175bSopenharmony_ci     eliminates the need for the lines declaring the files to be part of
2300a8e1175bSopenharmony_ci     MbedTLS. Fixes #3457.
2301a8e1175bSopenharmony_ci   * Add the command line parameter key_pwd to the ssl_client2 and ssl_server2
2302a8e1175bSopenharmony_ci     example applications which allows to provide a password for the key file
2303a8e1175bSopenharmony_ci     specified through the existing key_file argument. This allows the use of
2304a8e1175bSopenharmony_ci     these applications with password-protected key files. Analogously but for
2305a8e1175bSopenharmony_ci     ssl_server2 only, add the command line parameter key_pwd2 which allows to
2306a8e1175bSopenharmony_ci     set a password for the key file provided through the existing key_file2
2307a8e1175bSopenharmony_ci     argument.
2308a8e1175bSopenharmony_ci
2309a8e1175bSopenharmony_ci= mbed TLS 2.23.0 branch released 2020-07-01
2310a8e1175bSopenharmony_ci
2311a8e1175bSopenharmony_ciDefault behavior changes
2312a8e1175bSopenharmony_ci   * In the experimental PSA secure element interface, change the encoding of
2313a8e1175bSopenharmony_ci     key lifetimes to encode a persistence level and the location. Although C
2314a8e1175bSopenharmony_ci     prototypes do not effectively change, code calling
2315a8e1175bSopenharmony_ci     psa_register_se_driver() must be modified to pass the driver's location
2316a8e1175bSopenharmony_ci     instead of the keys' lifetime. If the library is upgraded on an existing
2317a8e1175bSopenharmony_ci     device, keys created with the old lifetime value will not be readable or
2318a8e1175bSopenharmony_ci     removable through Mbed TLS after the upgrade.
2319a8e1175bSopenharmony_ci
2320a8e1175bSopenharmony_ciFeatures
2321a8e1175bSopenharmony_ci   * New functions in the error module return constant strings for
2322a8e1175bSopenharmony_ci     high- and low-level error codes, complementing mbedtls_strerror()
2323a8e1175bSopenharmony_ci     which constructs a string for any error code, including compound
2324a8e1175bSopenharmony_ci     ones, but requires a writable buffer. Contributed by Gaurav Aggarwal
2325a8e1175bSopenharmony_ci     in #3176.
2326a8e1175bSopenharmony_ci   * The new utility programs/ssl/ssl_context_info prints a human-readable
2327a8e1175bSopenharmony_ci     dump of an SSL context saved with mbedtls_ssl_context_save().
2328a8e1175bSopenharmony_ci   * Add support for midipix, a POSIX layer for Microsoft Windows.
2329a8e1175bSopenharmony_ci   * Add new mbedtls_x509_crt_parse_der_with_ext_cb() routine which allows
2330a8e1175bSopenharmony_ci     parsing unsupported certificate extensions via user provided callback.
2331a8e1175bSopenharmony_ci     Contributed by Nicola Di Lieto <nicola.dilieto@gmail.com> in #3243 as
2332a8e1175bSopenharmony_ci     a solution to #3241.
2333a8e1175bSopenharmony_ci   * Pass the "certificate policies" extension to the callback supplied to
2334a8e1175bSopenharmony_ci     mbedtls_x509_crt_parse_der_with_ext_cb() if it contains unsupported
2335a8e1175bSopenharmony_ci     policies (#3419).
2336a8e1175bSopenharmony_ci   * Added support to entropy_poll for the kern.arandom syscall supported on
2337a8e1175bSopenharmony_ci     some BSD systems. Contributed by Nia Alarie in #3423.
2338a8e1175bSopenharmony_ci   * Add support for Windows 2000 in net_sockets. Contributed by opatomic. #3239
2339a8e1175bSopenharmony_ci
2340a8e1175bSopenharmony_ciSecurity
2341a8e1175bSopenharmony_ci   * Fix a side channel vulnerability in modular exponentiation that could
2342a8e1175bSopenharmony_ci     reveal an RSA private key used in a secure enclave. Noticed by Sangho Lee,
2343a8e1175bSopenharmony_ci     Ming-Wei Shih, Prasun Gera, Taesoo Kim and Hyesoon Kim (Georgia Institute
2344a8e1175bSopenharmony_ci     of Technology); and Marcus Peinado (Microsoft Research). Reported by Raoul
2345a8e1175bSopenharmony_ci     Strackx (Fortanix) in #3394.
2346a8e1175bSopenharmony_ci   * Fix side channel in mbedtls_ecp_check_pub_priv() and
2347a8e1175bSopenharmony_ci     mbedtls_pk_parse_key() / mbedtls_pk_parse_keyfile() (when loading a
2348a8e1175bSopenharmony_ci     private key that didn't include the uncompressed public key), as well as
2349a8e1175bSopenharmony_ci     mbedtls_ecp_mul() / mbedtls_ecp_mul_restartable() when called with a NULL
2350a8e1175bSopenharmony_ci     f_rng argument. An attacker with access to precise enough timing and
2351a8e1175bSopenharmony_ci     memory access information (typically an untrusted operating system
2352a8e1175bSopenharmony_ci     attacking a secure enclave) could fully recover the ECC private key.
2353a8e1175bSopenharmony_ci     Found and reported by Alejandro Cabrera Aldaya and Billy Brumley.
2354a8e1175bSopenharmony_ci   * Fix issue in Lucky 13 counter-measure that could make it ineffective when
2355a8e1175bSopenharmony_ci     hardware accelerators were used (using one of the MBEDTLS_SHAxxx_ALT
2356a8e1175bSopenharmony_ci     macros). This would cause the original Lucky 13 attack to be possible in
2357a8e1175bSopenharmony_ci     those configurations, allowing an active network attacker to recover
2358a8e1175bSopenharmony_ci     plaintext after repeated timing measurements under some conditions.
2359a8e1175bSopenharmony_ci     Reported and fix suggested by Luc Perneel in #3246.
2360a8e1175bSopenharmony_ci
2361a8e1175bSopenharmony_ciBugfix
2362a8e1175bSopenharmony_ci   * Fix the Visual Studio Release x64 build configuration for mbedtls itself.
2363a8e1175bSopenharmony_ci     Completes a previous fix in Mbed TLS 2.19 that only fixed the build for
2364a8e1175bSopenharmony_ci     the example programs. Reported in #1430 and fix contributed by irwir.
2365a8e1175bSopenharmony_ci   * Fix undefined behavior in X.509 certificate parsing if the
2366a8e1175bSopenharmony_ci     pathLenConstraint basic constraint value is equal to INT_MAX.
2367a8e1175bSopenharmony_ci     The actual effect with almost every compiler is the intended
2368a8e1175bSopenharmony_ci     behavior, so this is unlikely to be exploitable anywhere. #3192
2369a8e1175bSopenharmony_ci   * Fix issue with a detected HW accelerated record error not being exposed
2370a8e1175bSopenharmony_ci     due to shadowed variable. Contributed by Sander Visser in #3310.
2371a8e1175bSopenharmony_ci   * Avoid NULL pointer dereferencing if mbedtls_ssl_free() is called with a
2372a8e1175bSopenharmony_ci     NULL pointer argument. Contributed by Sander Visser in #3312.
2373a8e1175bSopenharmony_ci   * Fix potential linker errors on dual world platforms by inlining
2374a8e1175bSopenharmony_ci     mbedtls_gcc_group_to_psa(). This allows the pk.c module to link separately
2375a8e1175bSopenharmony_ci     from psa_crypto.c. Fixes #3300.
2376a8e1175bSopenharmony_ci   * Remove dead code in X.509 certificate parsing. Contributed by irwir in
2377a8e1175bSopenharmony_ci     #2855.
2378a8e1175bSopenharmony_ci   * Include asn1.h in error.c. Fixes #3328 reported by David Hu.
2379a8e1175bSopenharmony_ci   * Fix potential memory leaks in ecp_randomize_jac() and ecp_randomize_mxz()
2380a8e1175bSopenharmony_ci     when PRNG function fails. Contributed by Jonas Lejeune in #3318.
2381a8e1175bSopenharmony_ci   * Remove unused macros from MSVC projects. Reported in #3297 and fix
2382a8e1175bSopenharmony_ci     submitted in #3333 by irwir.
2383a8e1175bSopenharmony_ci   * Add additional bounds checks in ssl_write_client_hello() preventing
2384a8e1175bSopenharmony_ci     output buffer overflow if the configuration declared a buffer that was
2385a8e1175bSopenharmony_ci     too small.
2386a8e1175bSopenharmony_ci   * Set _POSIX_C_SOURCE to at least 200112L in C99 code. Reported in #3420 and
2387a8e1175bSopenharmony_ci     fix submitted in #3421 by Nia Alarie.
2388a8e1175bSopenharmony_ci   * Fix building library/net_sockets.c and the ssl_mail_client program on
2389a8e1175bSopenharmony_ci     NetBSD. Contributed by Nia Alarie in #3422.
2390a8e1175bSopenharmony_ci   * Fix false positive uninitialised variable reported by cpp-check.
2391a8e1175bSopenharmony_ci     Contributed by Sander Visser in #3311.
2392a8e1175bSopenharmony_ci   * Update iv and len context pointers manually when reallocating buffers
2393a8e1175bSopenharmony_ci     using the MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH feature. This caused issues
2394a8e1175bSopenharmony_ci     when receiving a connection with CID, when these fields were shifted
2395a8e1175bSopenharmony_ci     in ssl_parse_record_header().
2396a8e1175bSopenharmony_ci
2397a8e1175bSopenharmony_ciChanges
2398a8e1175bSopenharmony_ci   * Fix warnings about signedness issues in format strings. The build is now
2399a8e1175bSopenharmony_ci     clean of -Wformat-signedness warnings. Contributed by Kenneth Soerensen
2400a8e1175bSopenharmony_ci     in #3153.
2401a8e1175bSopenharmony_ci   * Fix minor performance issue in operations on Curve25519 caused by using a
2402a8e1175bSopenharmony_ci     suboptimal modular reduction in one place. Found and fix contributed by
2403a8e1175bSopenharmony_ci     Aurelien Jarno in #3209.
2404a8e1175bSopenharmony_ci   * Combine identical cases in switch statements in md.c. Contributed
2405a8e1175bSopenharmony_ci     by irwir in #3208.
2406a8e1175bSopenharmony_ci   * Simplify a bounds check in ssl_write_certificate_request(). Contributed
2407a8e1175bSopenharmony_ci     by irwir in #3150.
2408a8e1175bSopenharmony_ci   * Unify the example programs termination to call mbedtls_exit() instead of
2409a8e1175bSopenharmony_ci     using a return command. This has been done to enable customization of the
2410a8e1175bSopenharmony_ci     behavior in bare metal environments.
2411a8e1175bSopenharmony_ci   * Fix mbedtls_x509_dn_gets to escape non-ASCII characters as "?".
2412a8e1175bSopenharmony_ci     Contributed by Koh M. Nakagawa in #3326.
2413a8e1175bSopenharmony_ci   * Use FindPython3 when cmake version >= 3.15.0
2414a8e1175bSopenharmony_ci   * Abort the ClientHello writing function as soon as some extension doesn't
2415a8e1175bSopenharmony_ci     fit into the record buffer. Previously, such extensions were silently
2416a8e1175bSopenharmony_ci     dropped. As a consequence, the TLS handshake now fails when the output
2417a8e1175bSopenharmony_ci     buffer is not large enough to hold the ClientHello.
2418a8e1175bSopenharmony_ci   * The unit tests now rely on header files in tests/include/test and source
2419a8e1175bSopenharmony_ci     files in tests/src. When building with make or cmake, the files in
2420a8e1175bSopenharmony_ci     tests/src are compiled and the resulting object linked into each test
2421a8e1175bSopenharmony_ci     executable.
2422a8e1175bSopenharmony_ci   * The ECP module, enabled by `MBEDTLS_ECP_C`, now depends on
2423a8e1175bSopenharmony_ci     `MBEDTLS_CTR_DRBG_C` or `MBEDTLS_HMAC_DRBG_C` for some side-channel
2424a8e1175bSopenharmony_ci     coutermeasures. If side channels are not a concern, this dependency can
2425a8e1175bSopenharmony_ci     be avoided by enabling the new option `MBEDTLS_ECP_NO_INTERNAL_RNG`.
2426a8e1175bSopenharmony_ci   * Align MSVC error flag with GCC and Clang. Contributed by Carlos Gomes
2427a8e1175bSopenharmony_ci     Martinho. #3147
2428a8e1175bSopenharmony_ci   * Remove superfluous assignment in mbedtls_ssl_parse_certificate(). Reported
2429a8e1175bSopenharmony_ci     in #3182 and fix submitted by irwir. #3217
2430a8e1175bSopenharmony_ci   * Fix typo in XTS tests. Reported and fix submitted by Kxuan. #3319
2431a8e1175bSopenharmony_ci
2432a8e1175bSopenharmony_ci= mbed TLS 2.22.0 branch released 2020-04-14
2433a8e1175bSopenharmony_ci
2434a8e1175bSopenharmony_ciNew deprecations
2435a8e1175bSopenharmony_ci   * Deprecate MBEDTLS_SSL_HW_RECORD_ACCEL that enables function hooks in the
2436a8e1175bSopenharmony_ci     SSL module for hardware acceleration of individual records.
2437a8e1175bSopenharmony_ci   * Deprecate mbedtls_ssl_get_max_frag_len() in favour of
2438a8e1175bSopenharmony_ci     mbedtls_ssl_get_output_max_frag_len() and
2439a8e1175bSopenharmony_ci     mbedtls_ssl_get_input_max_frag_len() to be more precise about which max
2440a8e1175bSopenharmony_ci     fragment length is desired.
2441a8e1175bSopenharmony_ci
2442a8e1175bSopenharmony_ciSecurity
2443a8e1175bSopenharmony_ci   * Fix issue in DTLS handling of new associations with the same parameters
2444a8e1175bSopenharmony_ci     (RFC 6347 section 4.2.8): an attacker able to send forged UDP packets to
2445a8e1175bSopenharmony_ci     the server could cause it to drop established associations with
2446a8e1175bSopenharmony_ci     legitimate clients, resulting in a Denial of Service. This could only
2447a8e1175bSopenharmony_ci     happen when MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE was enabled in config.h
2448a8e1175bSopenharmony_ci     (which it is by default).
2449a8e1175bSopenharmony_ci   * Fix side channel in ECC code that allowed an adversary with access to
2450a8e1175bSopenharmony_ci     precise enough timing and memory access information (typically an
2451a8e1175bSopenharmony_ci     untrusted operating system attacking a secure enclave) to fully recover
2452a8e1175bSopenharmony_ci     an ECDSA private key. Found and reported by Alejandro Cabrera Aldaya,
2453a8e1175bSopenharmony_ci     Billy Brumley and Cesar Pereida Garcia. CVE-2020-10932
2454a8e1175bSopenharmony_ci   * Fix a potentially remotely exploitable buffer overread in a
2455a8e1175bSopenharmony_ci     DTLS client when parsing the Hello Verify Request message.
2456a8e1175bSopenharmony_ci
2457a8e1175bSopenharmony_ciFeatures
2458a8e1175bSopenharmony_ci   * The new build option MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH automatically
2459a8e1175bSopenharmony_ci     resizes the I/O buffers before and after handshakes, reducing the memory
2460a8e1175bSopenharmony_ci     consumption during application data transfer.
2461a8e1175bSopenharmony_ci
2462a8e1175bSopenharmony_ciBugfix
2463a8e1175bSopenharmony_ci   * Fix compilation failure when both MBEDTLS_SSL_PROTO_DTLS and
2464a8e1175bSopenharmony_ci     MBEDTLS_SSL_HW_RECORD_ACCEL are enabled.
2465a8e1175bSopenharmony_ci   * Remove a spurious check in ssl_parse_client_psk_identity that triggered
2466a8e1175bSopenharmony_ci     a warning with some compilers. Fix contributed by irwir in #2856.
2467a8e1175bSopenharmony_ci   * Fix a function name in a debug message. Contributed by Ercan Ozturk in
2468a8e1175bSopenharmony_ci     #3013.
2469a8e1175bSopenharmony_ci
2470a8e1175bSopenharmony_ciChanges
2471a8e1175bSopenharmony_ci   * Mbed Crypto is no longer a Git submodule. The crypto part of the library
2472a8e1175bSopenharmony_ci     is back directly in the present repository.
2473a8e1175bSopenharmony_ci   * Split mbedtls_ssl_get_max_frag_len() into
2474a8e1175bSopenharmony_ci     mbedtls_ssl_get_output_max_frag_len() and
2475a8e1175bSopenharmony_ci     mbedtls_ssl_get_input_max_frag_len() to ensure that a sufficient input
2476a8e1175bSopenharmony_ci     buffer is allocated by the server (if MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
2477a8e1175bSopenharmony_ci     is defined), regardless of what MFL was configured for it.
2478a8e1175bSopenharmony_ci
2479a8e1175bSopenharmony_ci= mbed TLS 2.21.0 branch released 2020-02-20
2480a8e1175bSopenharmony_ci
2481a8e1175bSopenharmony_ciNew deprecations
2482a8e1175bSopenharmony_ci   * Deprecate MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO that enables parsing
2483a8e1175bSopenharmony_ci     SSLv2 ClientHello messages.
2484a8e1175bSopenharmony_ci   * Deprecate MBEDTLS_SSL_PROTO_SSL3 that enables support for SSLv3.
2485a8e1175bSopenharmony_ci   * Deprecate for MBEDTLS_PKCS11_C, the wrapper around the pkcs11-helper
2486a8e1175bSopenharmony_ci     library which allows TLS authentication to use keys stored in a
2487a8e1175bSopenharmony_ci     PKCS#11 token such as a smartcard.
2488a8e1175bSopenharmony_ci
2489a8e1175bSopenharmony_ciSecurity
2490a8e1175bSopenharmony_ci   * Fix potential memory overread when performing an ECDSA signature
2491a8e1175bSopenharmony_ci     operation. The overread only happens with cryptographically low
2492a8e1175bSopenharmony_ci     probability (of the order of 2^-n where n is the bitsize of the curve)
2493a8e1175bSopenharmony_ci     unless the RNG is broken, and could result in information disclosure or
2494a8e1175bSopenharmony_ci     denial of service (application crash or extra resource consumption).
2495a8e1175bSopenharmony_ci     Found by Auke Zeilstra and Peter Schwabe, using static analysis.
2496a8e1175bSopenharmony_ci   * To avoid a side channel vulnerability when parsing an RSA private key,
2497a8e1175bSopenharmony_ci     read all the CRT parameters from the DER structure rather than
2498a8e1175bSopenharmony_ci     reconstructing them. Found by Alejandro Cabrera Aldaya and Billy Bob
2499a8e1175bSopenharmony_ci     Brumley. Reported and fix contributed by Jack Lloyd.
2500a8e1175bSopenharmony_ci     ARMmbed/mbed-crypto#352
2501a8e1175bSopenharmony_ci
2502a8e1175bSopenharmony_ciFeatures
2503a8e1175bSopenharmony_ci   * The new build option MBEDTLS_SHA512_NO_SHA384 allows building SHA-512
2504a8e1175bSopenharmony_ci     support without SHA-384.
2505a8e1175bSopenharmony_ci
2506a8e1175bSopenharmony_ciAPI changes
2507a8e1175bSopenharmony_ci   * Change the encoding of key types and curves in the PSA API. The new
2508a8e1175bSopenharmony_ci     values are aligned with the upcoming release of the PSA Crypto API
2509a8e1175bSopenharmony_ci     specification version 1.0.0. The main change which may break some
2510a8e1175bSopenharmony_ci     existing code is that elliptic curve key types no longer encode the
2511a8e1175bSopenharmony_ci     exact curve: a psa_ecc_curve_t or psa_key_type_t value only encodes
2512a8e1175bSopenharmony_ci     a curve family and the key size determines the exact curve (for example,
2513a8e1175bSopenharmony_ci     PSA_ECC_CURVE_SECP_R1 with 256 bits is P256R1). ARMmbed/mbed-crypto#330
2514a8e1175bSopenharmony_ci
2515a8e1175bSopenharmony_ciBugfix
2516a8e1175bSopenharmony_ci   * Fix an unchecked call to mbedtls_md() in the x509write module.
2517a8e1175bSopenharmony_ci   * Fix build failure with MBEDTLS_ZLIB_SUPPORT enabled. Reported by
2518a8e1175bSopenharmony_ci     Jack Lloyd in #2859. Fix submitted by jiblime in #2963.
2519a8e1175bSopenharmony_ci   * Fix some false-positive uninitialized variable warnings in X.509. Fix
2520a8e1175bSopenharmony_ci     contributed by apple-ihack-geek in #2663.
2521a8e1175bSopenharmony_ci   * Fix a possible error code mangling in psa_mac_verify_finish() when
2522a8e1175bSopenharmony_ci     a cryptographic accelerator fails. ARMmbed/mbed-crypto#345
2523a8e1175bSopenharmony_ci   * Fix a bug in mbedtls_pk_parse_key() that would cause it to accept some
2524a8e1175bSopenharmony_ci     RSA keys that would later be rejected by functions expecting private
2525a8e1175bSopenharmony_ci     keys. Found by Catena cyber using oss-fuzz (issue 20467).
2526a8e1175bSopenharmony_ci   * Fix a bug in mbedtls_pk_parse_key() that would cause it to
2527a8e1175bSopenharmony_ci     accept some RSA keys with invalid values by silently fixing those values.
2528a8e1175bSopenharmony_ci
2529a8e1175bSopenharmony_ci= mbed TLS 2.20.0 branch released 2020-01-15
2530a8e1175bSopenharmony_ci
2531a8e1175bSopenharmony_ciDefault behavior changes
2532a8e1175bSopenharmony_ci   * The initial seeding of a CTR_DRBG instance makes a second call to the
2533a8e1175bSopenharmony_ci     entropy function to obtain entropy for a nonce if the entropy size is less
2534a8e1175bSopenharmony_ci     than 3/2 times the key size. In case you want to disable the extra call to
2535a8e1175bSopenharmony_ci     grab entropy, you can call mbedtls_ctr_drbg_set_nonce_len() to force the
2536a8e1175bSopenharmony_ci     nonce length to 0.
2537a8e1175bSopenharmony_ci
2538a8e1175bSopenharmony_ciSecurity
2539a8e1175bSopenharmony_ci   * Enforce that mbedtls_entropy_func() gathers a total of
2540a8e1175bSopenharmony_ci     MBEDTLS_ENTROPY_BLOCK_SIZE bytes or more from strong sources. In the
2541a8e1175bSopenharmony_ci     default configuration, on a platform with a single entropy source, the
2542a8e1175bSopenharmony_ci     entropy module formerly only grabbed 32 bytes, which is good enough for
2543a8e1175bSopenharmony_ci     security if the source is genuinely strong, but less than the expected 64
2544a8e1175bSopenharmony_ci     bytes (size of the entropy accumulator).
2545a8e1175bSopenharmony_ci   * Zeroize local variables in mbedtls_internal_aes_encrypt() and
2546a8e1175bSopenharmony_ci     mbedtls_internal_aes_decrypt() before exiting the function. The value of
2547a8e1175bSopenharmony_ci     these variables can be used to recover the last round key. To follow best
2548a8e1175bSopenharmony_ci     practice and to limit the impact of buffer overread vulnerabilities (like
2549a8e1175bSopenharmony_ci     Heartbleed) we need to zeroize them before exiting the function.
2550a8e1175bSopenharmony_ci     Issue reported by Tuba Yavuz, Farhaan Fowze, Ken (Yihang) Bai,
2551a8e1175bSopenharmony_ci     Grant Hernandez, and Kevin Butler (University of Florida) and
2552a8e1175bSopenharmony_ci     Dave Tian (Purdue University).
2553a8e1175bSopenharmony_ci   * Fix side channel vulnerability in ECDSA. Our bignum implementation is not
2554a8e1175bSopenharmony_ci     constant time/constant trace, so side channel attacks can retrieve the
2555a8e1175bSopenharmony_ci     blinded value, factor it (as it is smaller than RSA keys and not guaranteed
2556a8e1175bSopenharmony_ci     to have only large prime factors), and then, by brute force, recover the
2557a8e1175bSopenharmony_ci     key. Reported by Alejandro Cabrera Aldaya and Billy Brumley.
2558a8e1175bSopenharmony_ci   * Fix side channel vulnerability in ECDSA key generation. Obtaining precise
2559a8e1175bSopenharmony_ci     timings on the comparison in the key generation enabled the attacker to
2560a8e1175bSopenharmony_ci     learn leading bits of the ephemeral key used during ECDSA signatures and to
2561a8e1175bSopenharmony_ci     recover the private key. Reported by Jeremy Dubeuf.
2562a8e1175bSopenharmony_ci   * Catch failure of AES functions in mbedtls_ctr_drbg_random(). Uncaught
2563a8e1175bSopenharmony_ci     failures could happen with alternative implementations of AES. Bug
2564a8e1175bSopenharmony_ci     reported and fix proposed by Johan Uppman Bruce and Christoffer Lauri,
2565a8e1175bSopenharmony_ci     Sectra.
2566a8e1175bSopenharmony_ci
2567a8e1175bSopenharmony_ciFeatures
2568a8e1175bSopenharmony_ci   * Key derivation inputs in the PSA API can now either come from a key object
2569a8e1175bSopenharmony_ci     or from a buffer regardless of the step type.
2570a8e1175bSopenharmony_ci   * The CTR_DRBG module can grab a nonce from the entropy source during the
2571a8e1175bSopenharmony_ci     initial seeding. The default nonce length is chosen based on the key size
2572a8e1175bSopenharmony_ci     to achieve the security strength defined by NIST SP 800-90A. You can
2573a8e1175bSopenharmony_ci     change it with mbedtls_ctr_drbg_set_nonce_len().
2574a8e1175bSopenharmony_ci   * Add ENUMERATED tag support to the ASN.1 module. Contributed by
2575a8e1175bSopenharmony_ci     msopiha-linaro in ARMmbed/mbed-crypto#307.
2576a8e1175bSopenharmony_ci
2577a8e1175bSopenharmony_ciAPI changes
2578a8e1175bSopenharmony_ci   * In the PSA API, forbid zero-length keys. To pass a zero-length input to a
2579a8e1175bSopenharmony_ci     key derivation function, use a buffer instead (this is now always
2580a8e1175bSopenharmony_ci     possible).
2581a8e1175bSopenharmony_ci   * Rename psa_asymmetric_sign() to psa_sign_hash() and
2582a8e1175bSopenharmony_ci     psa_asymmetric_verify() to psa_verify_hash().
2583a8e1175bSopenharmony_ci
2584a8e1175bSopenharmony_ciBugfix
2585a8e1175bSopenharmony_ci   * Fix an incorrect size in a debugging message. Reported and fix
2586a8e1175bSopenharmony_ci     submitted by irwir. Fixes #2717.
2587a8e1175bSopenharmony_ci   * Fix an unused variable warning when compiling without DTLS.
2588a8e1175bSopenharmony_ci     Reported and fix submitted by irwir. Fixes #2800.
2589a8e1175bSopenharmony_ci   * Remove a useless assignment. Reported and fix submitted by irwir.
2590a8e1175bSopenharmony_ci     Fixes #2801.
2591a8e1175bSopenharmony_ci   * Fix a buffer overflow in the PSA HMAC code when using a long key with an
2592a8e1175bSopenharmony_ci     unsupported algorithm. Fixes ARMmbed/mbed-crypto#254.
2593a8e1175bSopenharmony_ci   * Fix mbedtls_asn1_get_int to support any number of leading zeros. Credit
2594a8e1175bSopenharmony_ci     to OSS-Fuzz for finding a bug in an intermediate version of the fix.
2595a8e1175bSopenharmony_ci   * Fix mbedtls_asn1_get_bitstring_null to correctly parse bitstrings of at
2596a8e1175bSopenharmony_ci     most 2 bytes.
2597a8e1175bSopenharmony_ci   * mbedtls_ctr_drbg_set_entropy_len() and
2598a8e1175bSopenharmony_ci     mbedtls_hmac_drbg_set_entropy_len() now work if you call them before
2599a8e1175bSopenharmony_ci     mbedtls_ctr_drbg_seed() or mbedtls_hmac_drbg_seed().
2600a8e1175bSopenharmony_ci
2601a8e1175bSopenharmony_ciChanges
2602a8e1175bSopenharmony_ci   * Remove the technical possibility to define custom mbedtls_md_info
2603a8e1175bSopenharmony_ci     structures, which was exposed only in an internal header.
2604a8e1175bSopenharmony_ci   * psa_close_key(0) and psa_destroy_key(0) now succeed (doing nothing, as
2605a8e1175bSopenharmony_ci     before).
2606a8e1175bSopenharmony_ci   * Variables containing error codes are now initialized to an error code
2607a8e1175bSopenharmony_ci     rather than success, so that coding mistakes or memory corruption tends to
2608a8e1175bSopenharmony_ci     cause functions to return this error code rather than a success. There are
2609a8e1175bSopenharmony_ci     no known instances where this changes the behavior of the library: this is
2610a8e1175bSopenharmony_ci     merely a robustness improvement. ARMmbed/mbed-crypto#323
2611a8e1175bSopenharmony_ci   * Remove a useless call to mbedtls_ecp_group_free(). Contributed by
2612a8e1175bSopenharmony_ci     Alexander Krizhanovsky in ARMmbed/mbed-crypto#210.
2613a8e1175bSopenharmony_ci   * Speed up PBKDF2 by caching the digest calculation. Contributed by Jack
2614a8e1175bSopenharmony_ci     Lloyd and Fortanix Inc in ARMmbed/mbed-crypto#277.
2615a8e1175bSopenharmony_ci   * Small performance improvement of mbedtls_mpi_div_mpi(). Contributed by
2616a8e1175bSopenharmony_ci     Alexander Krizhanovsky in ARMmbed/mbed-crypto#308.
2617a8e1175bSopenharmony_ci
2618a8e1175bSopenharmony_ci= mbed TLS 2.19.1 branch released 2019-09-16
2619a8e1175bSopenharmony_ci
2620a8e1175bSopenharmony_ciFeatures
2621a8e1175bSopenharmony_ci   * Declare include headers as PUBLIC to propagate to CMake project consumers
2622a8e1175bSopenharmony_ci     Contributed by Zachary J. Fields in PR #2949.
2623a8e1175bSopenharmony_ci   * Add nss_keylog to ssl_client2 and ssl_server2, enabling easier analysis of
2624a8e1175bSopenharmony_ci     TLS sessions with tools like Wireshark.
2625a8e1175bSopenharmony_ci
2626a8e1175bSopenharmony_ciAPI Changes
2627a8e1175bSopenharmony_ci   * Make client_random and server_random const in
2628a8e1175bSopenharmony_ci     mbedtls_ssl_export_keys_ext_t, so that the key exporter is discouraged
2629a8e1175bSopenharmony_ci     from modifying the client/server hello.
2630a8e1175bSopenharmony_ci
2631a8e1175bSopenharmony_ciBugfix
2632a8e1175bSopenharmony_ci   * Fix some false-positive uninitialized variable warnings in crypto. Fix
2633a8e1175bSopenharmony_ci     contributed by apple-ihack-geek in #2663.
2634a8e1175bSopenharmony_ci
2635a8e1175bSopenharmony_ci= mbed TLS 2.19.0 branch released 2019-09-06
2636a8e1175bSopenharmony_ci
2637a8e1175bSopenharmony_ciSecurity
2638a8e1175bSopenharmony_ci   * Fix a missing error detection in ECJPAKE. This could have caused a
2639a8e1175bSopenharmony_ci     predictable shared secret if a hardware accelerator failed and the other
2640a8e1175bSopenharmony_ci     side of the key exchange had a similar bug.
2641a8e1175bSopenharmony_ci   * When writing a private EC key, use a constant size for the private
2642a8e1175bSopenharmony_ci     value, as specified in RFC 5915. Previously, the value was written
2643a8e1175bSopenharmony_ci     as an ASN.1 INTEGER, which caused the size of the key to leak
2644a8e1175bSopenharmony_ci     about 1 bit of information on average and could cause the value to be
2645a8e1175bSopenharmony_ci     1 byte too large for the output buffer.
2646a8e1175bSopenharmony_ci   * The deterministic ECDSA calculation reused the scheme's HMAC-DRBG to
2647a8e1175bSopenharmony_ci     implement blinding. Because of this for the same key and message the same
2648a8e1175bSopenharmony_ci     blinding value was generated. This reduced the effectiveness of the
2649a8e1175bSopenharmony_ci     countermeasure and leaked information about the private key through side
2650a8e1175bSopenharmony_ci     channels. Reported by Jack Lloyd.
2651a8e1175bSopenharmony_ci
2652a8e1175bSopenharmony_ciFeatures
2653a8e1175bSopenharmony_ci   * Add new API functions mbedtls_ssl_session_save() and
2654a8e1175bSopenharmony_ci     mbedtls_ssl_session_load() to allow serializing a session, for example to
2655a8e1175bSopenharmony_ci     store it in non-volatile storage, and later using it for TLS session
2656a8e1175bSopenharmony_ci     resumption.
2657a8e1175bSopenharmony_ci   * Add a new API function mbedtls_ssl_check_record() to allow checking that
2658a8e1175bSopenharmony_ci     an incoming record is valid, authentic and has not been seen before. This
2659a8e1175bSopenharmony_ci     feature can be used alongside Connection ID and SSL context serialisation.
2660a8e1175bSopenharmony_ci     The feature is enabled at compile-time by MBEDTLS_SSL_RECORD_CHECKING
2661a8e1175bSopenharmony_ci     option.
2662a8e1175bSopenharmony_ci   * New implementation of X25519 (ECDH using Curve25519) from Project Everest
2663a8e1175bSopenharmony_ci     (https://project-everest.github.io/). It can be enabled at compile time
2664a8e1175bSopenharmony_ci     with MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED. This implementation is formally
2665a8e1175bSopenharmony_ci     verified and significantly faster, but is only supported on x86 platforms
2666a8e1175bSopenharmony_ci     (32-bit and 64-bit) using GCC, Clang or Visual Studio. Contributed by
2667a8e1175bSopenharmony_ci     Christoph Wintersteiger from Microsoft Research.
2668a8e1175bSopenharmony_ci   * Add mbedtls_net_close(), enabling the building of forking servers where
2669a8e1175bSopenharmony_ci     the parent process closes the client socket and continue accepting, and
2670a8e1175bSopenharmony_ci     the child process closes the listening socket and handles the client
2671a8e1175bSopenharmony_ci     socket. Contributed by Robert Larsen in #2803.
2672a8e1175bSopenharmony_ci
2673a8e1175bSopenharmony_ciAPI Changes
2674a8e1175bSopenharmony_ci   * Add DER-encoded test CRTs to library/certs.c, allowing
2675a8e1175bSopenharmony_ci     the example programs ssl_server2 and ssl_client2 to be run
2676a8e1175bSopenharmony_ci     if MBEDTLS_FS_IO and MBEDTLS_PEM_PARSE_C are unset. Fixes #2254.
2677a8e1175bSopenharmony_ci   * The HAVEGE state type now uses uint32_t elements instead of int.
2678a8e1175bSopenharmony_ci   * The functions mbedtls_ecp_curve_list() and mbedtls_ecp_grp_id_list() now
2679a8e1175bSopenharmony_ci     list all curves for which at least one of ECDH or ECDSA is supported, not
2680a8e1175bSopenharmony_ci     just curves for which both are supported. Call mbedtls_ecdsa_can_do() or
2681a8e1175bSopenharmony_ci     mbedtls_ecdh_can_do() on each result to check whether each algorithm is
2682a8e1175bSopenharmony_ci     supported.
2683a8e1175bSopenharmony_ci   * The new function mbedtls_ecdsa_sign_det_ext() is similar to
2684a8e1175bSopenharmony_ci     mbedtls_ecdsa_sign_det() but allows passing an external RNG for the
2685a8e1175bSopenharmony_ci     purpose of blinding.
2686a8e1175bSopenharmony_ci
2687a8e1175bSopenharmony_ciNew deprecations
2688a8e1175bSopenharmony_ci   * Deprecate mbedtls_ecdsa_sign_det() in favor of a functions that can take an
2689a8e1175bSopenharmony_ci     RNG function as an input.
2690a8e1175bSopenharmony_ci   * Calling mbedtls_ecdsa_write_signature() with NULL as the f_rng argument
2691a8e1175bSopenharmony_ci     is now deprecated.
2692a8e1175bSopenharmony_ci
2693a8e1175bSopenharmony_ciBugfix
2694a8e1175bSopenharmony_ci   * Fix missing bounds checks in X.509 parsing functions that could
2695a8e1175bSopenharmony_ci     lead to successful parsing of ill-formed X.509 CRTs. Fixes #2437.
2696a8e1175bSopenharmony_ci   * Fix multiple X.509 functions previously returning ASN.1 low-level error
2697a8e1175bSopenharmony_ci     codes to always wrap these codes into X.509 high level error codes before
2698a8e1175bSopenharmony_ci     returning. Fixes #2431.
2699a8e1175bSopenharmony_ci   * Fix to allow building test suites with any warning that detects unused
2700a8e1175bSopenharmony_ci     functions. Fixes #1628.
2701a8e1175bSopenharmony_ci   * Fix typo in net_would_block(). Fixes #528 reported by github-monoculture.
2702a8e1175bSopenharmony_ci   * Remove redundant include file in timing.c. Fixes #2640 reported by irwir.
2703a8e1175bSopenharmony_ci   * Fix build failure when building with mingw on Windows by including
2704a8e1175bSopenharmony_ci     stdarg.h where needed. Fixes #2656.
2705a8e1175bSopenharmony_ci   * Fix Visual Studio Release x64 build configuration by inheriting
2706a8e1175bSopenharmony_ci     PlatformToolset from the project configuration. Fixes #1430 reported by
2707a8e1175bSopenharmony_ci     irwir.
2708a8e1175bSopenharmony_ci   * Enable Suite B with subset of ECP curves. Make sure the code compiles even
2709a8e1175bSopenharmony_ci     if some curves are not defined. Fixes #1591 reported by dbedev.
2710a8e1175bSopenharmony_ci   * Fix misuse of signed arithmetic in the HAVEGE module. #2598
2711a8e1175bSopenharmony_ci   * Avoid use of statically sized stack buffers for certificate writing.
2712a8e1175bSopenharmony_ci     This previously limited the maximum size of DER encoded certificates
2713a8e1175bSopenharmony_ci     in mbedtls_x509write_crt_der() to 2Kb. Reported by soccerGB in #2631.
2714a8e1175bSopenharmony_ci   * Fix partial zeroing in x509_get_other_name. Found and fixed by ekse, #2716.
2715a8e1175bSopenharmony_ci   * Update test certificates that were about to expire. Reported by
2716a8e1175bSopenharmony_ci     Bernhard M. Wiedemann in #2357.
2717a8e1175bSopenharmony_ci   * Fix the build on ARMv5TE in ARM mode to not use assembly instructions
2718a8e1175bSopenharmony_ci     that are only available in Thumb mode. Fix contributed by Aurelien Jarno
2719a8e1175bSopenharmony_ci     in #2169.
2720a8e1175bSopenharmony_ci   * Fix propagation of restart contexts in restartable EC operations.
2721a8e1175bSopenharmony_ci     This could previously lead to segmentation faults in builds using an
2722a8e1175bSopenharmony_ci     address-sanitizer and enabling but not using MBEDTLS_ECP_RESTARTABLE.
2723a8e1175bSopenharmony_ci   * Fix memory leak in in mpi_miller_rabin(). Contributed by
2724a8e1175bSopenharmony_ci     Jens Wiklander <jens.wiklander@linaro.org> in #2363
2725a8e1175bSopenharmony_ci   * Improve code clarity in x509_crt module, removing false-positive
2726a8e1175bSopenharmony_ci     uninitialized variable warnings on some recent toolchains (GCC8, etc).
2727a8e1175bSopenharmony_ci     Discovered and fixed by Andy Gross (Linaro), #2392.
2728a8e1175bSopenharmony_ci   * Fix bug in endianness conversion in bignum module. This lead to
2729a8e1175bSopenharmony_ci     functionally incorrect code on bigendian systems which don't have
2730a8e1175bSopenharmony_ci     __BYTE_ORDER__ defined. Reported by Brendan Shanks. Fixes #2622.
2731a8e1175bSopenharmony_ci
2732a8e1175bSopenharmony_ciChanges
2733a8e1175bSopenharmony_ci   * Replace multiple uses of MD2 by SHA-256 in X.509 test suite. Fixes #821.
2734a8e1175bSopenharmony_ci   * Make it easier to define MBEDTLS_PARAM_FAILED as assert (which config.h
2735a8e1175bSopenharmony_ci     suggests). #2671
2736a8e1175bSopenharmony_ci   * Make `make clean` clean all programs always. Fixes #1862.
2737a8e1175bSopenharmony_ci   * Add a Dockerfile and helper scripts (all-in-docker.sh, basic-in-docker.sh,
2738a8e1175bSopenharmony_ci     docker-env.sh) to simplify running test suites on a Linux host. Contributed
2739a8e1175bSopenharmony_ci     by Peter Kolbus (Garmin).
2740a8e1175bSopenharmony_ci   * Add `reproducible` option to `ssl_client2` and `ssl_server2` to enable
2741a8e1175bSopenharmony_ci     test runs without variability. Contributed by Philippe Antoine (Catena
2742a8e1175bSopenharmony_ci     cyber) in #2681.
2743a8e1175bSopenharmony_ci   * Extended .gitignore to ignore Visual Studio artifacts. Fixed by ConfusedSushi.
2744a8e1175bSopenharmony_ci   * Adds fuzz targets, especially for continuous fuzzing with OSS-Fuzz.
2745a8e1175bSopenharmony_ci     Contributed by Philippe Antoine (Catena cyber).
2746a8e1175bSopenharmony_ci   * Remove the crypto part of the library from Mbed TLS. The crypto
2747a8e1175bSopenharmony_ci     code and tests are now only available via Mbed Crypto, which
2748a8e1175bSopenharmony_ci     Mbed TLS references as a Git submodule.
2749a8e1175bSopenharmony_ci
2750a8e1175bSopenharmony_ci= mbed TLS 2.18.1 branch released 2019-07-12
2751a8e1175bSopenharmony_ci
2752a8e1175bSopenharmony_ciBugfix
2753a8e1175bSopenharmony_ci   * Fix build failure when building with mingw on Windows by including
2754a8e1175bSopenharmony_ci     stdarg.h where needed. Fixes #2656.
2755a8e1175bSopenharmony_ci
2756a8e1175bSopenharmony_ciChanges
2757a8e1175bSopenharmony_ci   * Enable building of Mbed TLS as a CMake subproject. Suggested and fixed by
2758a8e1175bSopenharmony_ci     Ashley Duncan in #2609.
2759a8e1175bSopenharmony_ci
2760a8e1175bSopenharmony_ci= mbed TLS 2.18.0 branch released 2019-06-11
2761a8e1175bSopenharmony_ci
2762a8e1175bSopenharmony_ciFeatures
2763a8e1175bSopenharmony_ci   * Add the Any Policy certificate policy oid, as defined in
2764a8e1175bSopenharmony_ci     rfc 5280 section 4.2.1.4.
2765a8e1175bSopenharmony_ci   * It is now possible to use NIST key wrap mode via the mbedtls_cipher API.
2766a8e1175bSopenharmony_ci     Contributed by Jack Lloyd and Fortanix Inc.
2767a8e1175bSopenharmony_ci   * Add the Wi-SUN Field Area Network (FAN) device extended key usage.
2768a8e1175bSopenharmony_ci   * Add the oid certificate policy x509 extension.
2769a8e1175bSopenharmony_ci   * It is now possible to perform RSA PKCS v1.5 signatures with RIPEMD-160 digest.
2770a8e1175bSopenharmony_ci     Contributed by Jack Lloyd and Fortanix Inc.
2771a8e1175bSopenharmony_ci   * Extend the MBEDTLS_SSL_EXPORT_KEYS to export the handshake randbytes,
2772a8e1175bSopenharmony_ci     and the used tls-prf.
2773a8e1175bSopenharmony_ci   * Add public API for tls-prf function, according to requested enum.
2774a8e1175bSopenharmony_ci   * Add support for parsing otherName entries in the Subject Alternative Name
2775a8e1175bSopenharmony_ci     X.509 certificate extension, specifically type hardware module name,
2776a8e1175bSopenharmony_ci     as defined in RFC 4108 section 5.
2777a8e1175bSopenharmony_ci   * Add support for parsing certificate policies extension, as defined in
2778a8e1175bSopenharmony_ci     RFC 5280 section 4.2.1.4. Currently, only the "Any Policy" policy is
2779a8e1175bSopenharmony_ci     supported.
2780a8e1175bSopenharmony_ci   * List all SAN types in the subject_alt_names field of the certificate.
2781a8e1175bSopenharmony_ci     Resolves #459.
2782a8e1175bSopenharmony_ci   * Add support for draft-05 of the Connection ID extension, as specified
2783a8e1175bSopenharmony_ci     in https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05.
2784a8e1175bSopenharmony_ci     The Connection ID extension allows to keep DTLS connections beyond the
2785a8e1175bSopenharmony_ci     lifetime of the underlying transport by adding a connection identifier
2786a8e1175bSopenharmony_ci     to the DTLS record header. This identifier can be used to associated an
2787a8e1175bSopenharmony_ci     incoming record with the correct connection data even after the peer has
2788a8e1175bSopenharmony_ci     changed its IP or port. The feature is enabled at compile-time by setting
2789a8e1175bSopenharmony_ci     MBEDTLS_SSL_DTLS_CONNECTION_ID (disabled by default), and at run-time
2790a8e1175bSopenharmony_ci     through the new APIs mbedtls_ssl_conf_cid() and mbedtls_ssl_set_cid().
2791a8e1175bSopenharmony_ci
2792a8e1175bSopenharmony_ci
2793a8e1175bSopenharmony_ciAPI Changes
2794a8e1175bSopenharmony_ci   * Extend the MBEDTLS_SSL_EXPORT_KEYS to export the handshake randbytes,
2795a8e1175bSopenharmony_ci     and the used tls-prf.
2796a8e1175bSopenharmony_ci   * Add public API for tls-prf function, according to requested enum.
2797a8e1175bSopenharmony_ci
2798a8e1175bSopenharmony_ciBugfix
2799a8e1175bSopenharmony_ci   * Fix private key DER output in the key_app_writer example. File contents
2800a8e1175bSopenharmony_ci     were shifted by one byte, creating an invalid ASN.1 tag. Fixed by
2801a8e1175bSopenharmony_ci     Christian Walther in #2239.
2802a8e1175bSopenharmony_ci   * Fix potential memory leak in X.509 self test. Found and fixed by
2803a8e1175bSopenharmony_ci     Junhwan Park, #2106.
2804a8e1175bSopenharmony_ci   * Reduce stack usage of hkdf tests. Fixes #2195.
2805a8e1175bSopenharmony_ci   * Fix 1-byte buffer overflow in mbedtls_mpi_write_string() when
2806a8e1175bSopenharmony_ci     used with negative inputs. Found by Guido Vranken in #2404. Credit to
2807a8e1175bSopenharmony_ci     OSS-Fuzz.
2808a8e1175bSopenharmony_ci   * Fix bugs in the AEAD test suite which would be exposed by ciphers which
2809a8e1175bSopenharmony_ci     either used both encrypt and decrypt key schedules, or which perform padding.
2810a8e1175bSopenharmony_ci     GCM and CCM were not affected. Fixed by Jack Lloyd.
2811a8e1175bSopenharmony_ci   * Fix incorrect default port number in ssl_mail_client example's usage.
2812a8e1175bSopenharmony_ci     Found and fixed by irwir. #2337
2813a8e1175bSopenharmony_ci   * Add psa_util.h to test/cpp_dummy_build to fix build_default_make_gcc_and_cxx.
2814a8e1175bSopenharmony_ci     Fixed by Peter Kolbus (Garmin). #2579
2815a8e1175bSopenharmony_ci   * Add missing parentheses around parameters in the definition of the
2816a8e1175bSopenharmony_ci     public macro MBEDTLS_X509_ID_FLAG. This could lead to invalid evaluation
2817a8e1175bSopenharmony_ci     in case operators binding less strongly than subtraction were used
2818a8e1175bSopenharmony_ci     for the parameter.
2819a8e1175bSopenharmony_ci   * Add a check for MBEDTLS_X509_CRL_PARSE_C in ssl_server2, guarding the crl
2820a8e1175bSopenharmony_ci     sni entry parameter. Reported by inestlerode in #560.
2821a8e1175bSopenharmony_ci   * Set the next sequence of the subject_alt_name to NULL when deleting
2822a8e1175bSopenharmony_ci     sequence on failure. Found and fix suggested by Philippe Antoine.
2823a8e1175bSopenharmony_ci     Credit to OSS-Fuzz.
2824a8e1175bSopenharmony_ci
2825a8e1175bSopenharmony_ciChanges
2826a8e1175bSopenharmony_ci   * Server's RSA certificate in certs.c was SHA-1 signed. In the default
2827a8e1175bSopenharmony_ci     mbedTLS configuration only SHA-2 signed certificates are accepted.
2828a8e1175bSopenharmony_ci     This certificate is used in the demo server programs, which lead the
2829a8e1175bSopenharmony_ci     client programs to fail at the peer's certificate verification
2830a8e1175bSopenharmony_ci     due to an unacceptable hash signature. The certificate has been
2831a8e1175bSopenharmony_ci     updated to one that is SHA-256 signed. Fix contributed by
2832a8e1175bSopenharmony_ci     Illya Gerasymchuk.
2833a8e1175bSopenharmony_ci   * Return from various debugging routines immediately if the
2834a8e1175bSopenharmony_ci     provided SSL context is unset.
2835a8e1175bSopenharmony_ci   * Remove dead code from bignum.c in the default configuration.
2836a8e1175bSopenharmony_ci     Found by Coverity, reported and fixed by Peter Kolbus (Garmin). Fixes #2309.
2837a8e1175bSopenharmony_ci   * Add test for minimal value of MBEDTLS_MPI_WINDOW_SIZE to all.sh.
2838a8e1175bSopenharmony_ci     Contributed by Peter Kolbus (Garmin).
2839a8e1175bSopenharmony_ci   * Change wording in the `mbedtls_ssl_conf_max_frag_len()`'s documentation to
2840a8e1175bSopenharmony_ci     improve clarity. Fixes #2258.
2841a8e1175bSopenharmony_ci
2842a8e1175bSopenharmony_ci= mbed TLS 2.17.0 branch released 2019-03-19
2843a8e1175bSopenharmony_ci
2844a8e1175bSopenharmony_ciFeatures
2845a8e1175bSopenharmony_ci   * Add a new X.509 API call `mbedtls_x509_parse_der_nocopy()`
2846a8e1175bSopenharmony_ci     which allows copy-less parsing of DER encoded X.509 CRTs,
2847a8e1175bSopenharmony_ci     at the cost of additional lifetime constraints on the input
2848a8e1175bSopenharmony_ci     buffer, but at the benefit of reduced RAM consumption.
2849a8e1175bSopenharmony_ci   * Add a new function mbedtls_asn1_write_named_bitstring() to write ASN.1
2850a8e1175bSopenharmony_ci     named bitstring in DER as required by RFC 5280 Appendix B.
2851a8e1175bSopenharmony_ci   * Add MBEDTLS_REMOVE_3DES_CIPHERSUITES to allow removing 3DES ciphersuites
2852a8e1175bSopenharmony_ci     from the default list (enabled by default). See
2853a8e1175bSopenharmony_ci     https://sweet32.info/SWEET32_CCS16.pdf.
2854a8e1175bSopenharmony_ci
2855a8e1175bSopenharmony_ciAPI Changes
2856a8e1175bSopenharmony_ci   * Add a new X.509 API call `mbedtls_x509_parse_der_nocopy()`.
2857a8e1175bSopenharmony_ci     See the Features section for more information.
2858a8e1175bSopenharmony_ci   * Allow to opt in to the removal the API mbedtls_ssl_get_peer_cert()
2859a8e1175bSopenharmony_ci     for the benefit of saving RAM, by disabling the new compile-time
2860a8e1175bSopenharmony_ci     option MBEDTLS_SSL_KEEP_PEER_CERTIFICATE (enabled by default for
2861a8e1175bSopenharmony_ci     API stability). Disabling this option makes mbedtls_ssl_get_peer_cert()
2862a8e1175bSopenharmony_ci     always return NULL, and removes the peer_cert field from the
2863a8e1175bSopenharmony_ci     mbedtls_ssl_session structure which otherwise stores the peer's
2864a8e1175bSopenharmony_ci     certificate.
2865a8e1175bSopenharmony_ci
2866a8e1175bSopenharmony_ciSecurity
2867a8e1175bSopenharmony_ci   * Make mbedtls_ecdh_get_params return an error if the second key
2868a8e1175bSopenharmony_ci     belongs to a different group from the first. Before, if an application
2869a8e1175bSopenharmony_ci     passed keys that belonged to different group, the first key's data was
2870a8e1175bSopenharmony_ci     interpreted according to the second group, which could lead to either
2871a8e1175bSopenharmony_ci     an error or a meaningless output from mbedtls_ecdh_get_params. In the
2872a8e1175bSopenharmony_ci     latter case, this could expose at most 5 bits of the private key.
2873a8e1175bSopenharmony_ci
2874a8e1175bSopenharmony_ciBugfix
2875a8e1175bSopenharmony_ci   * Fix a compilation issue with mbedtls_ecp_restart_ctx not being defined
2876a8e1175bSopenharmony_ci     when MBEDTLS_ECP_ALT is defined. Reported by jwhui. Fixes #2242.
2877a8e1175bSopenharmony_ci   * Run the AD too long test only if MBEDTLS_CCM_ALT is not defined.
2878a8e1175bSopenharmony_ci     Raised as a comment in #1996.
2879a8e1175bSopenharmony_ci   * Reduce the stack consumption of mbedtls_mpi_fill_random() which could
2880a8e1175bSopenharmony_ci     previously lead to a stack overflow on constrained targets.
2881a8e1175bSopenharmony_ci   * Add `MBEDTLS_SELF_TEST` for the mbedtls_self_test functions
2882a8e1175bSopenharmony_ci     in the header files, which missed the precompilation check. #971
2883a8e1175bSopenharmony_ci   * Fix returning the value 1 when mbedtls_ecdsa_genkey failed.
2884a8e1175bSopenharmony_ci   * Remove a duplicate #include in a sample program. Fixed by Masashi Honma #2326.
2885a8e1175bSopenharmony_ci   * Remove the mbedtls namespacing from the header file, to fix a "file not found"
2886a8e1175bSopenharmony_ci     build error. Fixed by Haijun Gu #2319.
2887a8e1175bSopenharmony_ci   * Fix signed-to-unsigned integer conversion warning
2888a8e1175bSopenharmony_ci     in X.509 module. Fixes #2212.
2889a8e1175bSopenharmony_ci   * Reduce stack usage of `mpi_write_hlp()` by eliminating recursion.
2890a8e1175bSopenharmony_ci     Fixes #2190.
2891a8e1175bSopenharmony_ci   * Fix false failure in all.sh when backup files exist in include/mbedtls
2892a8e1175bSopenharmony_ci     (e.g. config.h.bak). Fixed by Peter Kolbus (Garmin) #2407.
2893a8e1175bSopenharmony_ci   * Ensure that unused bits are zero when writing ASN.1 bitstrings when using
2894a8e1175bSopenharmony_ci     mbedtls_asn1_write_bitstring().
2895a8e1175bSopenharmony_ci   * Fix issue when writing the named bitstrings in KeyUsage and NsCertType
2896a8e1175bSopenharmony_ci     extensions in CSRs and CRTs that caused these bitstrings to not be encoded
2897a8e1175bSopenharmony_ci     correctly as trailing zeroes were not accounted for as unused bits in the
2898a8e1175bSopenharmony_ci     leading content octet. Fixes #1610.
2899a8e1175bSopenharmony_ci
2900a8e1175bSopenharmony_ciChanges
2901a8e1175bSopenharmony_ci   * Reduce RAM consumption during session renegotiation by not storing
2902a8e1175bSopenharmony_ci     the peer CRT chain and session ticket twice.
2903a8e1175bSopenharmony_ci   * Include configuration file in all header files that use configuration,
2904a8e1175bSopenharmony_ci     instead of relying on other header files that they include.
2905a8e1175bSopenharmony_ci     Inserted as an enhancement for #1371
2906a8e1175bSopenharmony_ci   * Add support for alternative CSR headers, as used by Microsoft and defined
2907a8e1175bSopenharmony_ci     in RFC 7468. Found by Michael Ernst. Fixes #767.
2908a8e1175bSopenharmony_ci   * Correct many misspellings. Fixed by MisterDA #2371.
2909a8e1175bSopenharmony_ci   * Provide an abstraction of vsnprintf to allow alternative implementations
2910a8e1175bSopenharmony_ci     for platforms that don't provide it. Based on contributions by Joris Aerts
2911a8e1175bSopenharmony_ci     and Nathaniel Wesley Filardo.
2912a8e1175bSopenharmony_ci   * Fix clobber list in MIPS assembly for large integer multiplication.
2913a8e1175bSopenharmony_ci     Previously, this could lead to functionally incorrect assembly being
2914a8e1175bSopenharmony_ci     produced by some optimizing compilers, showing up as failures in
2915a8e1175bSopenharmony_ci     e.g. RSA or ECC signature operations. Reported in #1722, fix suggested
2916a8e1175bSopenharmony_ci     by Aurelien Jarno and submitted by Jeffrey Martin.
2917a8e1175bSopenharmony_ci   * Reduce the complexity of the timing tests. They were assuming more than the
2918a8e1175bSopenharmony_ci     underlying OS actually guarantees.
2919a8e1175bSopenharmony_ci   * Fix configuration queries in ssl-opt.h. #2030
2920a8e1175bSopenharmony_ci   * Ensure that ssl-opt.h can be run in OS X. #2029
2921a8e1175bSopenharmony_ci   * Re-enable certain interoperability tests in ssl-opt.sh which had previously
2922a8e1175bSopenharmony_ci     been disabled for lack of a sufficiently recent version of GnuTLS on the CI.
2923a8e1175bSopenharmony_ci   * Ciphersuites based on 3DES now have the lowest priority by default when
2924a8e1175bSopenharmony_ci     they are enabled.
2925a8e1175bSopenharmony_ci
2926a8e1175bSopenharmony_ci= mbed TLS 2.16.0 branch released 2018-12-21
2927a8e1175bSopenharmony_ci
2928a8e1175bSopenharmony_ciFeatures
2929a8e1175bSopenharmony_ci   * Add a new config.h option of MBEDTLS_CHECK_PARAMS that enables validation
2930a8e1175bSopenharmony_ci     of parameters in the API. This allows detection of obvious misuses of the
2931a8e1175bSopenharmony_ci     API, such as passing NULL pointers. The API of existing functions hasn't
2932a8e1175bSopenharmony_ci     changed, but requirements on parameters have been made more explicit in
2933a8e1175bSopenharmony_ci     the documentation. See the corresponding API documentation for each
2934a8e1175bSopenharmony_ci     function to see for which parameter values it is defined. This feature is
2935a8e1175bSopenharmony_ci     disabled by default. See its API documentation in config.h for additional
2936a8e1175bSopenharmony_ci     steps you have to take when enabling it.
2937a8e1175bSopenharmony_ci
2938a8e1175bSopenharmony_ciAPI Changes
2939a8e1175bSopenharmony_ci   * The following functions in the random generator modules have been
2940a8e1175bSopenharmony_ci     deprecated and replaced as shown below. The new functions change
2941a8e1175bSopenharmony_ci     the return type from void to int to allow returning error codes when
2942a8e1175bSopenharmony_ci     using MBEDTLS_<MODULE>_ALT for the underlying AES or message digest
2943a8e1175bSopenharmony_ci     primitive. Fixes #1798.
2944a8e1175bSopenharmony_ci     mbedtls_ctr_drbg_update() -> mbedtls_ctr_drbg_update_ret()
2945a8e1175bSopenharmony_ci     mbedtls_hmac_drbg_update() -> mbedtls_hmac_drbg_update_ret()
2946a8e1175bSopenharmony_ci   * Extend ECDH interface to enable alternative implementations.
2947a8e1175bSopenharmony_ci   * Deprecate error codes of the form MBEDTLS_ERR_xxx_INVALID_KEY_LENGTH for
2948a8e1175bSopenharmony_ci     ARIA, CAMELLIA and Blowfish. These error codes will be replaced by
2949a8e1175bSopenharmony_ci     the more generic per-module error codes MBEDTLS_ERR_xxx_BAD_INPUT_DATA.
2950a8e1175bSopenharmony_ci   * Additional parameter validation checks have been added for the following
2951a8e1175bSopenharmony_ci     modules - AES, ARIA, Blowfish, CAMELLIA, CCM, GCM, DHM, ECP, ECDSA, ECDH,
2952a8e1175bSopenharmony_ci     ECJPAKE, SHA, Chacha20 and Poly1305, cipher, pk, RSA, and MPI.
2953a8e1175bSopenharmony_ci     Where modules have had parameter validation added, existing parameter
2954a8e1175bSopenharmony_ci     checks may have changed. Some modules, such as Chacha20 had existing
2955a8e1175bSopenharmony_ci     parameter validation whereas other modules had little. This has now been
2956a8e1175bSopenharmony_ci     changed so that the same level of validation is present in all modules, and
2957a8e1175bSopenharmony_ci     that it is now optional with the MBEDTLS_CHECK_PARAMS flag which by default
2958a8e1175bSopenharmony_ci     is off. That means that checks which were previously present by default
2959a8e1175bSopenharmony_ci     will no longer be.
2960a8e1175bSopenharmony_ci
2961a8e1175bSopenharmony_ciNew deprecations
2962a8e1175bSopenharmony_ci   * Deprecate mbedtls_ctr_drbg_update and mbedtls_hmac_drbg_update
2963a8e1175bSopenharmony_ci     in favor of functions that can return an error code.
2964a8e1175bSopenharmony_ci
2965a8e1175bSopenharmony_ciBugfix
2966a8e1175bSopenharmony_ci   * Fix for Clang, which was reporting a warning for the bignum.c inline
2967a8e1175bSopenharmony_ci     assembly for AMD64 targets creating string literals greater than those
2968a8e1175bSopenharmony_ci     permitted by the ISO C99 standard. Found by Aaron Jones. Fixes #482.
2969a8e1175bSopenharmony_ci   * Fix runtime error in `mbedtls_platform_entropy_poll()` when run
2970a8e1175bSopenharmony_ci     through qemu user emulation. Reported and fix suggested by randombit
2971a8e1175bSopenharmony_ci     in #1212. Fixes #1212.
2972a8e1175bSopenharmony_ci   * Fix an unsafe bounds check when restoring an SSL session from a ticket.
2973a8e1175bSopenharmony_ci     This could lead to a buffer overflow, but only in case ticket authentication
2974a8e1175bSopenharmony_ci     was broken. Reported and fix suggested by Guido Vranken in #659.
2975a8e1175bSopenharmony_ci   * Add explicit integer to enumeration type casts to example program
2976a8e1175bSopenharmony_ci     programs/pkey/gen_key which previously led to compilation failure
2977a8e1175bSopenharmony_ci     on some toolchains. Reported by phoenixmcallister. Fixes #2170.
2978a8e1175bSopenharmony_ci   * Fix double initialization of ECC hardware that made some accelerators
2979a8e1175bSopenharmony_ci     hang.
2980a8e1175bSopenharmony_ci   * Clarify documentation of mbedtls_ssl_set_own_cert() regarding the absence
2981a8e1175bSopenharmony_ci     of check for certificate/key matching. Reported by Attila Molnar, #507.
2982a8e1175bSopenharmony_ci
2983a8e1175bSopenharmony_ci = mbed TLS 2.15.1 branch released 2018-11-30
2984a8e1175bSopenharmony_ci
2985a8e1175bSopenharmony_ci Changes
2986a8e1175bSopenharmony_ci    * Update the Mbed Crypto submodule to version 0.1.0b2.
2987a8e1175bSopenharmony_ci
2988a8e1175bSopenharmony_ci = mbed TLS 2.15.0 branch released 2018-11-23
2989a8e1175bSopenharmony_ci
2990a8e1175bSopenharmony_ci Features
2991a8e1175bSopenharmony_ci    * Add an experimental build option, USE_CRYPTO_SUBMODULE, to enable use of
2992a8e1175bSopenharmony_ci      Mbed Crypto as the source of the cryptography implementation.
2993a8e1175bSopenharmony_ci    * Add an experimental configuration option, MBEDTLS_PSA_CRYPTO_C, to enable
2994a8e1175bSopenharmony_ci      the PSA Crypto API from Mbed Crypto when additionally used with the
2995a8e1175bSopenharmony_ci      USE_CRYPTO_SUBMODULE build option.
2996a8e1175bSopenharmony_ci
2997a8e1175bSopenharmony_ci Changes
2998a8e1175bSopenharmony_ci    * Add unit tests for AES-GCM when called through mbedtls_cipher_auth_xxx()
2999a8e1175bSopenharmony_ci      from the cipher abstraction layer. Fixes #2198.
3000a8e1175bSopenharmony_ci
3001a8e1175bSopenharmony_ci= mbed TLS 2.14.1 branch released 2018-11-30
3002a8e1175bSopenharmony_ci
3003a8e1175bSopenharmony_ciSecurity
3004a8e1175bSopenharmony_ci   * Fix timing variations and memory access variations in RSA PKCS#1 v1.5
3005a8e1175bSopenharmony_ci     decryption that could lead to a Bleichenbacher-style padding oracle
3006a8e1175bSopenharmony_ci     attack. In TLS, this affects servers that accept ciphersuites based on
3007a8e1175bSopenharmony_ci     RSA decryption (i.e. ciphersuites whose name contains RSA but not
3008a8e1175bSopenharmony_ci     (EC)DH(E)). Discovered by Eyal Ronen (Weizmann Institute),  Robert Gillham
3009a8e1175bSopenharmony_ci     (University of Adelaide), Daniel Genkin (University of Michigan),
3010a8e1175bSopenharmony_ci     Adi Shamir (Weizmann Institute), David Wong (NCC Group), and Yuval Yarom
3011a8e1175bSopenharmony_ci     (University of Adelaide, Data61). The attack is described in more detail
3012a8e1175bSopenharmony_ci     in the paper available here: http://cat.eyalro.net/cat.pdf  CVE-2018-19608
3013a8e1175bSopenharmony_ci   * In mbedtls_mpi_write_binary(), don't leak the exact size of the number
3014a8e1175bSopenharmony_ci     via branching and memory access patterns. An attacker who could submit
3015a8e1175bSopenharmony_ci     a plaintext for RSA PKCS#1 v1.5 decryption but only observe the timing
3016a8e1175bSopenharmony_ci     of the decryption and not its result could nonetheless decrypt RSA
3017a8e1175bSopenharmony_ci     plaintexts and forge RSA signatures. Other asymmetric algorithms may
3018a8e1175bSopenharmony_ci     have been similarly vulnerable. Reported by Eyal Ronen, Robert Gillham,
3019a8e1175bSopenharmony_ci     Daniel Genkin, Adi Shamir, David Wong and Yuval Yarom.
3020a8e1175bSopenharmony_ci   * Wipe sensitive buffers on the stack in the CTR_DRBG and HMAC_DRBG
3021a8e1175bSopenharmony_ci     modules.
3022a8e1175bSopenharmony_ci
3023a8e1175bSopenharmony_ciAPI Changes
3024a8e1175bSopenharmony_ci   * The new functions mbedtls_ctr_drbg_update_ret() and
3025a8e1175bSopenharmony_ci     mbedtls_hmac_drbg_update_ret() are similar to mbedtls_ctr_drbg_update()
3026a8e1175bSopenharmony_ci     and mbedtls_hmac_drbg_update() respectively, but the new functions
3027a8e1175bSopenharmony_ci     report errors whereas the old functions return void. We recommend that
3028a8e1175bSopenharmony_ci     applications use the new functions.
3029a8e1175bSopenharmony_ci
3030a8e1175bSopenharmony_ci= mbed TLS 2.14.0 branch released 2018-11-19
3031a8e1175bSopenharmony_ci
3032a8e1175bSopenharmony_ciSecurity
3033a8e1175bSopenharmony_ci   * Fix overly strict DN comparison when looking for CRLs belonging to a
3034a8e1175bSopenharmony_ci     particular CA. This previously led to ignoring CRLs when the CRL's issuer
3035a8e1175bSopenharmony_ci     name and the CA's subject name differed in their string encoding (e.g.,
3036a8e1175bSopenharmony_ci     one using PrintableString and the other UTF8String) or in the choice of
3037a8e1175bSopenharmony_ci     upper and lower case. Reported by Henrik Andersson of Bosch GmbH in issue
3038a8e1175bSopenharmony_ci     #1784.
3039a8e1175bSopenharmony_ci   * Fix a flawed bounds check in server PSK hint parsing. In case the
3040a8e1175bSopenharmony_ci     incoming message buffer was placed within the first 64KiB of address
3041a8e1175bSopenharmony_ci     space and a PSK-(EC)DHE ciphersuite was used, this allowed an attacker
3042a8e1175bSopenharmony_ci     to trigger a memory access up to 64KiB beyond the incoming message buffer,
3043a8e1175bSopenharmony_ci     potentially leading to an application crash or information disclosure.
3044a8e1175bSopenharmony_ci   * Fix mbedtls_mpi_is_prime() to use more rounds of probabilistic testing. The
3045a8e1175bSopenharmony_ci     previous settings for the number of rounds made it practical for an
3046a8e1175bSopenharmony_ci     adversary to construct non-primes that would be erroneously accepted as
3047a8e1175bSopenharmony_ci     primes with high probability. This does not have an impact on the
3048a8e1175bSopenharmony_ci     security of TLS, but can matter in other contexts with numbers chosen
3049a8e1175bSopenharmony_ci     potentially by an adversary that should be prime and can be validated.
3050a8e1175bSopenharmony_ci     For example, the number of rounds was enough to securely generate RSA key
3051a8e1175bSopenharmony_ci     pairs or Diffie-Hellman parameters, but was insufficient to validate
3052a8e1175bSopenharmony_ci     Diffie-Hellman parameters properly.
3053a8e1175bSopenharmony_ci     See "Prime and Prejudice" by by Martin R. Albrecht and Jake Massimo and
3054a8e1175bSopenharmony_ci     Kenneth G. Paterson and Juraj Somorovsky.
3055a8e1175bSopenharmony_ci
3056a8e1175bSopenharmony_ciFeatures
3057a8e1175bSopenharmony_ci   * Add support for temporarily suspending expensive ECC computations after
3058a8e1175bSopenharmony_ci     some configurable amount of operations. This is intended to be used in
3059a8e1175bSopenharmony_ci     constrained, single-threaded systems where ECC is time consuming and can
3060a8e1175bSopenharmony_ci     block other operations until they complete. This is disabled by default,
3061a8e1175bSopenharmony_ci     but can be enabled by MBEDTLS_ECP_RESTARTABLE at compile time and
3062a8e1175bSopenharmony_ci     configured by mbedtls_ecp_set_max_ops() at runtime. It applies to the new
3063a8e1175bSopenharmony_ci     xxx_restartable functions in ECP, ECDSA, PK and X.509 (CRL not supported
3064a8e1175bSopenharmony_ci     yet), and to existing functions in ECDH and SSL (currently only
3065a8e1175bSopenharmony_ci     implemented client-side, for ECDHE-ECDSA ciphersuites in TLS 1.2,
3066a8e1175bSopenharmony_ci     including client authentication).
3067a8e1175bSopenharmony_ci   * Add support for Arm CPU DSP extensions to accelerate asymmetric key
3068a8e1175bSopenharmony_ci     operations. On CPUs where the extensions are available, they can accelerate
3069a8e1175bSopenharmony_ci     MPI multiplications used in ECC and RSA cryptography. Contributed by
3070a8e1175bSopenharmony_ci     Aurelien Jarno.
3071a8e1175bSopenharmony_ci   * Extend RSASSA-PSS signature to allow a smaller salt size. Previously, PSS
3072a8e1175bSopenharmony_ci     signature always used a salt with the same length as the hash, and returned
3073a8e1175bSopenharmony_ci     an error if this was not possible. Now the salt size may be up to two bytes
3074a8e1175bSopenharmony_ci     shorter. This allows the library to support all hash and signature sizes
3075a8e1175bSopenharmony_ci     that comply with FIPS 186-4, including SHA-512 with a 1024-bit key.
3076a8e1175bSopenharmony_ci   * Add support for 128-bit keys in CTR_DRBG. Note that using keys shorter
3077a8e1175bSopenharmony_ci     than 256 bits limits the security of generated material to 128 bits.
3078a8e1175bSopenharmony_ci
3079a8e1175bSopenharmony_ciAPI Changes
3080a8e1175bSopenharmony_ci   * Add a common error code of `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` for
3081a8e1175bSopenharmony_ci     a feature that is not supported by underlying alternative
3082a8e1175bSopenharmony_ci     implementations implementing cryptographic primitives. This is useful for
3083a8e1175bSopenharmony_ci     hardware accelerators that don't implement all options or features.
3084a8e1175bSopenharmony_ci
3085a8e1175bSopenharmony_ciNew deprecations
3086a8e1175bSopenharmony_ci   * All module specific errors following the form
3087a8e1175bSopenharmony_ci     MBEDTLS_ERR_XXX_FEATURE_UNAVAILABLE that indicate a feature is not
3088a8e1175bSopenharmony_ci     supported are deprecated and are now replaced by the new equivalent
3089a8e1175bSopenharmony_ci     platform error.
3090a8e1175bSopenharmony_ci   * All module specific generic hardware acceleration errors following the
3091a8e1175bSopenharmony_ci     form MBEDTLS_ERR_XXX_HW_ACCEL_FAILED that are deprecated and are replaced
3092a8e1175bSopenharmony_ci     by the equivalent plaform error.
3093a8e1175bSopenharmony_ci   * Deprecate the function mbedtls_mpi_is_prime() in favor of
3094a8e1175bSopenharmony_ci     mbedtls_mpi_is_prime_ext() which allows specifying the number of
3095a8e1175bSopenharmony_ci     Miller-Rabin rounds.
3096a8e1175bSopenharmony_ci
3097a8e1175bSopenharmony_ciBugfix
3098a8e1175bSopenharmony_ci   * Fix wrong order of freeing in programs/ssl/ssl_server2 example
3099a8e1175bSopenharmony_ci     application leading to a memory leak in case both
3100a8e1175bSopenharmony_ci     MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE are set.
3101a8e1175bSopenharmony_ci     Fixes #2069.
3102a8e1175bSopenharmony_ci   * Fix a bug in the update function for SSL ticket keys which previously
3103a8e1175bSopenharmony_ci     invalidated keys of a lifetime of less than a 1s. Fixes #1968.
3104a8e1175bSopenharmony_ci   * Fix failure in hmac_drbg in the benchmark sample application, when
3105a8e1175bSopenharmony_ci     MBEDTLS_THREADING_C is defined. Found by TrinityTonic, #1095
3106a8e1175bSopenharmony_ci   * Fix a bug in the record decryption routine ssl_decrypt_buf()
3107a8e1175bSopenharmony_ci     which lead to accepting properly authenticated but improperly
3108a8e1175bSopenharmony_ci     padded records in case of CBC ciphersuites using Encrypt-then-MAC.
3109a8e1175bSopenharmony_ci   * Fix memory leak and freeing without initialization in the example
3110a8e1175bSopenharmony_ci     program programs/x509/cert_write. Fixes #1422.
3111a8e1175bSopenharmony_ci   * Ignore IV in mbedtls_cipher_set_iv() when the cipher mode is
3112a8e1175bSopenharmony_ci     MBEDTLS_MODE_ECB. Found by ezdevelop. Fixes #1091.
3113a8e1175bSopenharmony_ci   * Zeroize memory used for buffering or reassembling handshake messages
3114a8e1175bSopenharmony_ci     after use.
3115a8e1175bSopenharmony_ci   * Use `mbedtls_platform_zeroize()` instead of `memset()` for zeroization
3116a8e1175bSopenharmony_ci     of sensitive data in the example programs aescrypt2 and crypt_and_hash.
3117a8e1175bSopenharmony_ci   * Change the default string format used for various X.509 DN attributes to
3118a8e1175bSopenharmony_ci     UTF8String. Previously, the use of the PrintableString format led to
3119a8e1175bSopenharmony_ci     wildcards and non-ASCII characters being unusable in some DN attributes.
3120a8e1175bSopenharmony_ci     Reported by raprepo in #1860 and by kevinpt in #468. Fix contributed by
3121a8e1175bSopenharmony_ci     Thomas-Dee.
3122a8e1175bSopenharmony_ci   * Fix compilation failure for configurations which use compile time
3123a8e1175bSopenharmony_ci     replacements of standard calloc/free functions through the macros
3124a8e1175bSopenharmony_ci     MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_FREE_MACRO.
3125a8e1175bSopenharmony_ci     Reported by ole-de and ddhome2006. Fixes #882, #1642 and #1706.
3126a8e1175bSopenharmony_ci
3127a8e1175bSopenharmony_ciChanges
3128a8e1175bSopenharmony_ci   * Removed support for Yotta as a build tool.
3129a8e1175bSopenharmony_ci   * Add tests for session resumption in DTLS.
3130a8e1175bSopenharmony_ci   * Close a test gap in (D)TLS between the client side and the server side:
3131a8e1175bSopenharmony_ci     test the handling of large packets and small packets on the client side
3132a8e1175bSopenharmony_ci     in the same way as on the server side.
3133a8e1175bSopenharmony_ci   * Change the dtls_client and dtls_server samples to work by default over
3134a8e1175bSopenharmony_ci     IPv6 and optionally by a build option over IPv4.
3135a8e1175bSopenharmony_ci   * Change the use of Windows threading to use Microsoft Visual C++ runtime
3136a8e1175bSopenharmony_ci     calls, rather than Win32 API calls directly. This is necessary to avoid
3137a8e1175bSopenharmony_ci     conflict with C runtime usage. Found and fixed by irwir.
3138a8e1175bSopenharmony_ci   * Remember the string format of X.509 DN attributes when replicating
3139a8e1175bSopenharmony_ci     X.509 DNs. Previously, DN attributes were always written in their default
3140a8e1175bSopenharmony_ci     string format (mostly PrintableString), which could lead to CRTs being
3141a8e1175bSopenharmony_ci     created which used PrintableStrings in the issuer field even though the
3142a8e1175bSopenharmony_ci     signing CA used UTF8Strings in its subject field; while X.509 compliant,
3143a8e1175bSopenharmony_ci     such CRTs were rejected in some applications, e.g. some versions of
3144a8e1175bSopenharmony_ci     Firefox, curl and GnuTLS. Reported in #1033 by Moschn. Fix contributed by
3145a8e1175bSopenharmony_ci     Thomas-Dee.
3146a8e1175bSopenharmony_ci   * Improve documentation of mbedtls_ssl_get_verify_result().
3147a8e1175bSopenharmony_ci     Fixes #517 reported by github-monoculture.
3148a8e1175bSopenharmony_ci   * Add MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR flag to mbedtls_mpi_gen_prime() and
3149a8e1175bSopenharmony_ci     use it to reduce error probability in RSA key generation to levels mandated
3150a8e1175bSopenharmony_ci     by FIPS-186-4.
3151a8e1175bSopenharmony_ci
3152a8e1175bSopenharmony_ci= mbed TLS 2.13.1 branch released 2018-09-06
3153a8e1175bSopenharmony_ci
3154a8e1175bSopenharmony_ciAPI Changes
3155a8e1175bSopenharmony_ci   * Extend the platform module with an abstraction mbedtls_platform_gmtime_r()
3156a8e1175bSopenharmony_ci     whose implementation should behave as a thread-safe version of gmtime().
3157a8e1175bSopenharmony_ci     This allows users to configure such an implementation at compile time when
3158a8e1175bSopenharmony_ci     the target system cannot be deduced automatically, by setting the option
3159a8e1175bSopenharmony_ci     MBEDTLS_PLATFORM_GMTIME_R_ALT. At this stage Mbed TLS is only able to
3160a8e1175bSopenharmony_ci     automatically select implementations for Windows and POSIX C libraries.
3161a8e1175bSopenharmony_ci
3162a8e1175bSopenharmony_ciBugfix
3163a8e1175bSopenharmony_ci   * Fix build failures on platforms where only gmtime() is available but
3164a8e1175bSopenharmony_ci     neither gmtime_r() nor gmtime_s() are present. Fixes #1907.
3165a8e1175bSopenharmony_ci
3166a8e1175bSopenharmony_ci= mbed TLS 2.13.0 branch released 2018-08-31
3167a8e1175bSopenharmony_ci
3168a8e1175bSopenharmony_ciSecurity
3169a8e1175bSopenharmony_ci   * Fix an issue in the X.509 module which could lead to a buffer overread
3170a8e1175bSopenharmony_ci     during certificate extensions parsing. In case of receiving malformed
3171a8e1175bSopenharmony_ci     input (extensions length field equal to 0), an illegal read of one byte
3172a8e1175bSopenharmony_ci     beyond the input buffer is made. Found and analyzed by Nathan Crandall.
3173a8e1175bSopenharmony_ci
3174a8e1175bSopenharmony_ciFeatures
3175a8e1175bSopenharmony_ci   * Add support for fragmentation of outgoing DTLS handshake messages. This
3176a8e1175bSopenharmony_ci     is controlled by the maximum fragment length as set locally or negotiated
3177a8e1175bSopenharmony_ci     with the peer, as well as by a new per-connection MTU option, set using
3178a8e1175bSopenharmony_ci     mbedtls_ssl_set_mtu().
3179a8e1175bSopenharmony_ci   * Add support for auto-adjustment of MTU to a safe value during the
3180a8e1175bSopenharmony_ci     handshake when flights do not get through (RFC 6347, section 4.1.1.1,
3181a8e1175bSopenharmony_ci     last paragraph).
3182a8e1175bSopenharmony_ci   * Add support for packing multiple records within a single datagram,
3183a8e1175bSopenharmony_ci     enabled by default.
3184a8e1175bSopenharmony_ci   * Add support for buffering out-of-order handshake messages in DTLS.
3185a8e1175bSopenharmony_ci     The maximum amount of RAM used for this can be controlled by the
3186a8e1175bSopenharmony_ci     compile-time constant MBEDTLS_SSL_DTLS_MAX_BUFFERING defined
3187a8e1175bSopenharmony_ci     in mbedtls/config.h.
3188a8e1175bSopenharmony_ci
3189a8e1175bSopenharmony_ciAPI Changes
3190a8e1175bSopenharmony_ci   * Add function mbedtls_ssl_set_datagram_packing() to configure
3191a8e1175bSopenharmony_ci     the use of datagram packing (enabled by default).
3192a8e1175bSopenharmony_ci
3193a8e1175bSopenharmony_ciBugfix
3194a8e1175bSopenharmony_ci   * Fix a potential memory leak in mbedtls_ssl_setup() function. An allocation
3195a8e1175bSopenharmony_ci     failure in the function could lead to other buffers being leaked.
3196a8e1175bSopenharmony_ci   * Fixes an issue with MBEDTLS_CHACHAPOLY_C which would not compile if
3197a8e1175bSopenharmony_ci     MBEDTLS_ARC4_C and MBEDTLS_CIPHER_NULL_CIPHER weren't also defined. #1890
3198a8e1175bSopenharmony_ci   * Fix a memory leak in ecp_mul_comb() if ecp_precompute_comb() fails.
3199a8e1175bSopenharmony_ci     Fix contributed by Espressif Systems.
3200a8e1175bSopenharmony_ci   * Add ecc extensions only if an ecc based ciphersuite is used.
3201a8e1175bSopenharmony_ci     This improves compliance to RFC 4492, and as a result, solves
3202a8e1175bSopenharmony_ci     interoperability issues with BouncyCastle. Raised by milenamil in #1157.
3203a8e1175bSopenharmony_ci   * Replace printf with mbedtls_printf in the ARIA module. Found by
3204a8e1175bSopenharmony_ci     TrinityTonic in #1908.
3205a8e1175bSopenharmony_ci   * Fix potential use-after-free in mbedtls_ssl_get_max_frag_len()
3206a8e1175bSopenharmony_ci     and mbedtls_ssl_get_record_expansion() after a session reset. Fixes #1941.
3207a8e1175bSopenharmony_ci   * Fix a bug that caused SSL/TLS clients to incorrectly abort the handshake
3208a8e1175bSopenharmony_ci     with TLS versions 1.1 and earlier when the server requested authentication
3209a8e1175bSopenharmony_ci     without providing a list of CAs. This was due to an overly strict bounds
3210a8e1175bSopenharmony_ci     check in parsing the CertificateRequest message,
3211a8e1175bSopenharmony_ci     introduced in Mbed TLS 2.12.0. Fixes #1954.
3212a8e1175bSopenharmony_ci   * Fix a miscalculation of the maximum record expansion in
3213a8e1175bSopenharmony_ci     mbedtls_ssl_get_record_expansion() in case of ChachaPoly ciphersuites,
3214a8e1175bSopenharmony_ci     or CBC ciphersuites in (D)TLS versions 1.1 or higher. Fixes #1913, #1914.
3215a8e1175bSopenharmony_ci   * Fix undefined shifts with negative values in certificates parsing
3216a8e1175bSopenharmony_ci     (found by Catena cyber using oss-fuzz)
3217a8e1175bSopenharmony_ci   * Fix memory leak and free without initialization in pk_encrypt
3218a8e1175bSopenharmony_ci     and pk_decrypt example programs. Reported by Brace Stout. Fixes #1128.
3219a8e1175bSopenharmony_ci   * Remove redundant else statement. Raised by irwir. Fixes #1776.
3220a8e1175bSopenharmony_ci
3221a8e1175bSopenharmony_ciChanges
3222a8e1175bSopenharmony_ci   * Copy headers preserving timestamps when doing a "make install".
3223a8e1175bSopenharmony_ci     Contributed by xueruini.
3224a8e1175bSopenharmony_ci   * Allow the forward declaration of public structs. Contributed by Dawid
3225a8e1175bSopenharmony_ci     Drozd. Fixes #1215 raised by randombit.
3226a8e1175bSopenharmony_ci   * Improve compatibility with some alternative CCM implementations by using
3227a8e1175bSopenharmony_ci     CCM test vectors from RAM.
3228a8e1175bSopenharmony_ci   * Add support for buffering of out-of-order handshake messages.
3229a8e1175bSopenharmony_ci   * Add warnings to the documentation of the HKDF module to reduce the risk
3230a8e1175bSopenharmony_ci     of misusing the mbedtls_hkdf_extract() and mbedtls_hkdf_expand()
3231a8e1175bSopenharmony_ci     functions. Fixes #1775. Reported by Brian J. Murray.
3232a8e1175bSopenharmony_ci
3233a8e1175bSopenharmony_ci= mbed TLS 2.12.0 branch released 2018-07-25
3234a8e1175bSopenharmony_ci
3235a8e1175bSopenharmony_ciSecurity
3236a8e1175bSopenharmony_ci   * Fix a vulnerability in TLS ciphersuites based on CBC and using SHA-384,
3237a8e1175bSopenharmony_ci     in (D)TLS 1.0 to 1.2, that allowed an active network attacker to
3238a8e1175bSopenharmony_ci     partially recover the plaintext of messages under some conditions by
3239a8e1175bSopenharmony_ci     exploiting timing measurements. With DTLS, the attacker could perform
3240a8e1175bSopenharmony_ci     this recovery by sending many messages in the same connection. With TLS
3241a8e1175bSopenharmony_ci     or if mbedtls_ssl_conf_dtls_badmac_limit() was used, the attack only
3242a8e1175bSopenharmony_ci     worked if the same secret (for example a HTTP Cookie) has been repeatedly
3243a8e1175bSopenharmony_ci     sent over connections manipulated by the attacker. Connections using GCM
3244a8e1175bSopenharmony_ci     or CCM instead of CBC, using hash sizes other than SHA-384, or using
3245a8e1175bSopenharmony_ci     Encrypt-then-Mac (RFC 7366) were not affected. The vulnerability was
3246a8e1175bSopenharmony_ci     caused by a miscalculation (for SHA-384) in a countermeasure to the
3247a8e1175bSopenharmony_ci     original Lucky 13 attack. Found by Kenny Paterson, Eyal Ronen and Adi
3248a8e1175bSopenharmony_ci     Shamir.
3249a8e1175bSopenharmony_ci   * Fix a vulnerability in TLS ciphersuites based on CBC, in (D)TLS 1.0 to
3250a8e1175bSopenharmony_ci     1.2, that allowed a local attacker, able to execute code on the local
3251a8e1175bSopenharmony_ci     machine as well as manipulate network packets, to partially recover the
3252a8e1175bSopenharmony_ci     plaintext of messages under some conditions by using a cache attack
3253a8e1175bSopenharmony_ci     targeting an internal MD/SHA buffer. With TLS or if
3254a8e1175bSopenharmony_ci     mbedtls_ssl_conf_dtls_badmac_limit() was used, the attack only worked if
3255a8e1175bSopenharmony_ci     the same secret (for example a HTTP Cookie) has been repeatedly sent over
3256a8e1175bSopenharmony_ci     connections manipulated by the attacker. Connections using GCM or CCM
3257a8e1175bSopenharmony_ci     instead of CBC or using Encrypt-then-Mac (RFC 7366) were not affected.
3258a8e1175bSopenharmony_ci     Found by Kenny Paterson, Eyal Ronen and Adi Shamir.
3259a8e1175bSopenharmony_ci   * Add a counter-measure against a vulnerability in TLS ciphersuites based
3260a8e1175bSopenharmony_ci     on CBC, in (D)TLS 1.0 to 1.2, that allowed a local attacker, able to
3261a8e1175bSopenharmony_ci     execute code on the local machine as well as manipulate network packets,
3262a8e1175bSopenharmony_ci     to partially recover the plaintext of messages under some conditions (see
3263a8e1175bSopenharmony_ci     previous entry) by using a cache attack targeting the SSL input record
3264a8e1175bSopenharmony_ci     buffer. Connections using GCM or CCM instead of CBC or using
3265a8e1175bSopenharmony_ci     Encrypt-then-Mac (RFC 7366) were not affected. Found by Kenny Paterson,
3266a8e1175bSopenharmony_ci     Eyal Ronen and Adi Shamir.
3267a8e1175bSopenharmony_ci
3268a8e1175bSopenharmony_ciFeatures
3269a8e1175bSopenharmony_ci   * Add new crypto primitives from RFC 7539: stream cipher Chacha20, one-time
3270a8e1175bSopenharmony_ci     authenticator Poly1305 and AEAD construct Chacha20-Poly1305. Contributed
3271a8e1175bSopenharmony_ci     by Daniel King.
3272a8e1175bSopenharmony_ci   * Add support for CHACHA20-POLY1305 ciphersuites from RFC 7905.
3273a8e1175bSopenharmony_ci   * Add platform support for the Haiku OS. (https://www.haiku-os.org).
3274a8e1175bSopenharmony_ci     Contributed by Augustin Cavalier.
3275a8e1175bSopenharmony_ci   * Make the receive and transmit buffers independent sizes, for situations
3276a8e1175bSopenharmony_ci     where the outgoing buffer can be fixed at a smaller size than the incoming
3277a8e1175bSopenharmony_ci     buffer, which can save some RAM. If buffer lengths are kept equal, there
3278a8e1175bSopenharmony_ci     is no functional difference. Contributed by Angus Gratton, and also
3279a8e1175bSopenharmony_ci     independently contributed again by Paul Sokolovsky.
3280a8e1175bSopenharmony_ci   * Add support for key wrapping modes based on AES as defined by
3281a8e1175bSopenharmony_ci     NIST SP 800-38F algorithms KW and KWP and by RFC 3394 and RFC 5649.
3282a8e1175bSopenharmony_ci
3283a8e1175bSopenharmony_ciBugfix
3284a8e1175bSopenharmony_ci   * Fix the key_app_writer example which was writing a leading zero byte which
3285a8e1175bSopenharmony_ci     was creating an invalid ASN.1 tag. Found by Aryeh R. Fixes #1257.
3286a8e1175bSopenharmony_ci   * Fix compilation error on C++, because of a variable named new.
3287a8e1175bSopenharmony_ci     Found and fixed by Hirotaka Niisato in #1783.
3288a8e1175bSopenharmony_ci   * Fix "no symbols" warning issued by ranlib when building on Mac OS X. Fix
3289a8e1175bSopenharmony_ci     contributed by tabascoeye.
3290a8e1175bSopenharmony_ci   * Clarify documentation for mbedtls_ssl_write() to include 0 as a valid
3291a8e1175bSopenharmony_ci     return value. Found by @davidwu2000. #839
3292a8e1175bSopenharmony_ci   * Fix a memory leak in mbedtls_x509_csr_parse(), found by catenacyber,
3293a8e1175bSopenharmony_ci     Philippe Antoine. Fixes #1623.
3294a8e1175bSopenharmony_ci   * Remove unused headers included in x509.c. Found by Chris Hanson and fixed
3295a8e1175bSopenharmony_ci     by Brendan Shanks. Part of a fix for #992.
3296a8e1175bSopenharmony_ci   * Fix compilation error when MBEDTLS_ARC4_C is disabled and
3297a8e1175bSopenharmony_ci     MBEDTLS_CIPHER_NULL_CIPHER is enabled. Found by TrinityTonic in #1719.
3298a8e1175bSopenharmony_ci   * Added length checks to some TLS parsing functions. Found and fixed by
3299a8e1175bSopenharmony_ci     Philippe Antoine from Catena cyber. #1663.
3300a8e1175bSopenharmony_ci   * Fix the inline assembly for the MPI multiply helper function for i386 and
3301a8e1175bSopenharmony_ci     i386 with SSE2. Found by László Langó. Fixes #1550
3302a8e1175bSopenharmony_ci   * Fix namespacing in header files. Remove the `mbedtls` namespacing in
3303a8e1175bSopenharmony_ci     the `#include` in the header files. Resolves #857
3304a8e1175bSopenharmony_ci   * Fix compiler warning of 'use before initialisation' in
3305a8e1175bSopenharmony_ci     mbedtls_pk_parse_key(). Found by Martin Boye Petersen and fixed by Dawid
3306a8e1175bSopenharmony_ci     Drozd. #1098
3307a8e1175bSopenharmony_ci   * Fix decryption for zero length messages (which contain all padding) when a
3308a8e1175bSopenharmony_ci     CBC based ciphersuite is used together with Encrypt-then-MAC. Previously,
3309a8e1175bSopenharmony_ci     such a message was wrongly reported as an invalid record and therefore lead
3310a8e1175bSopenharmony_ci     to the connection being terminated. Seen most often with OpenSSL using
3311a8e1175bSopenharmony_ci     TLS 1.0. Reported by @kFYatek and by Conor Murphy on the forum. Fix
3312a8e1175bSopenharmony_ci     contributed by Espressif Systems. Fixes #1632
3313a8e1175bSopenharmony_ci   * Fix ssl_client2 example to send application data with 0-length content
3314a8e1175bSopenharmony_ci     when the request_size argument is set to 0 as stated in the documentation.
3315a8e1175bSopenharmony_ci     Fixes #1833.
3316a8e1175bSopenharmony_ci   * Correct the documentation for `mbedtls_ssl_get_session()`. This API has
3317a8e1175bSopenharmony_ci     deep copy of the session, and the peer certificate is not lost. Fixes #926.
3318a8e1175bSopenharmony_ci   * Fix build using -std=c99. Fixed by Nick Wilson.
3319a8e1175bSopenharmony_ci
3320a8e1175bSopenharmony_ciChanges
3321a8e1175bSopenharmony_ci   * Fail when receiving a TLS alert message with an invalid length, or invalid
3322a8e1175bSopenharmony_ci     zero-length messages when using TLS 1.2. Contributed by Espressif Systems.
3323a8e1175bSopenharmony_ci   * Change the default behaviour of mbedtls_hkdf_extract() to return an error
3324a8e1175bSopenharmony_ci     when calling with a NULL salt and non-zero salt_len. Contributed by
3325a8e1175bSopenharmony_ci     Brian J Murray
3326a8e1175bSopenharmony_ci   * Change the shebang line in Perl scripts to look up perl in the PATH.
3327a8e1175bSopenharmony_ci     Contributed by fbrosson.
3328a8e1175bSopenharmony_ci   * Allow overriding the time on Windows via the platform-time abstraction.
3329a8e1175bSopenharmony_ci     Fixed by Nick Wilson.
3330a8e1175bSopenharmony_ci   * Use gmtime_r/gmtime_s for thread-safety. Fixed by Nick Wilson.
3331a8e1175bSopenharmony_ci
3332a8e1175bSopenharmony_ci= mbed TLS 2.11.0 branch released 2018-06-18
3333a8e1175bSopenharmony_ci
3334a8e1175bSopenharmony_ciFeatures
3335a8e1175bSopenharmony_ci   * Add additional block mode, OFB (Output Feedback), to the AES module and
3336a8e1175bSopenharmony_ci     cipher abstraction module.
3337a8e1175bSopenharmony_ci   * Implement the HMAC-based extract-and-expand key derivation function
3338a8e1175bSopenharmony_ci     (HKDF) per RFC 5869. Contributed by Thomas Fossati.
3339a8e1175bSopenharmony_ci   * Add support for the CCM* block cipher mode as defined in IEEE Std. 802.15.4.
3340a8e1175bSopenharmony_ci   * Add support for the XTS block cipher mode with AES (AES-XTS).
3341a8e1175bSopenharmony_ci     Contributed by Aorimn in pull request #414.
3342a8e1175bSopenharmony_ci   * In TLS servers, support offloading private key operations to an external
3343a8e1175bSopenharmony_ci     cryptoprocessor. Private key operations can be asynchronous to allow
3344a8e1175bSopenharmony_ci     non-blocking operation of the TLS server stack.
3345a8e1175bSopenharmony_ci
3346a8e1175bSopenharmony_ciBugfix
3347a8e1175bSopenharmony_ci   * Fix the cert_write example to handle certificates signed with elliptic
3348a8e1175bSopenharmony_ci     curves as well as RSA. Fixes #777 found by dbedev.
3349a8e1175bSopenharmony_ci   * Fix for redefinition of _WIN32_WINNT to avoid overriding a definition
3350a8e1175bSopenharmony_ci     used by user applications. Found and fixed by Fabio Alessandrelli.
3351a8e1175bSopenharmony_ci   * Fix compilation warnings with IAR toolchain, on 32 bit platform.
3352a8e1175bSopenharmony_ci     Reported by rahmanih in #683
3353a8e1175bSopenharmony_ci   * Fix braces in mbedtls_memory_buffer_alloc_status(). Found by sbranden, #552.
3354a8e1175bSopenharmony_ci
3355a8e1175bSopenharmony_ciChanges
3356a8e1175bSopenharmony_ci   * Changed CMake defaults for IAR to treat all compiler warnings as errors.
3357a8e1175bSopenharmony_ci   * Changed the Clang parameters used in the CMake build files to work for
3358a8e1175bSopenharmony_ci     versions later than 3.6. Versions of Clang earlier than this may no longer
3359a8e1175bSopenharmony_ci     work. Fixes #1072
3360a8e1175bSopenharmony_ci
3361a8e1175bSopenharmony_ci= mbed TLS 2.10.0 branch released 2018-06-06
3362a8e1175bSopenharmony_ci
3363a8e1175bSopenharmony_ciFeatures
3364a8e1175bSopenharmony_ci   * Add support for ARIA cipher (RFC 5794) and associated TLS ciphersuites
3365a8e1175bSopenharmony_ci     (RFC 6209). Disabled by default, see MBEDTLS_ARIA_C in config.h
3366a8e1175bSopenharmony_ci
3367a8e1175bSopenharmony_ciAPI Changes
3368a8e1175bSopenharmony_ci   * Extend the platform module with a util component that contains
3369a8e1175bSopenharmony_ci     functionality shared by multiple Mbed TLS modules. At this stage
3370a8e1175bSopenharmony_ci     platform_util.h (and its associated platform_util.c) only contain
3371a8e1175bSopenharmony_ci     mbedtls_platform_zeroize(), which is a critical function from a security
3372a8e1175bSopenharmony_ci     point of view. mbedtls_platform_zeroize() needs to be regularly tested
3373a8e1175bSopenharmony_ci     against compilers to ensure that calls to it are not removed from the
3374a8e1175bSopenharmony_ci     output binary as part of redundant code elimination optimizations.
3375a8e1175bSopenharmony_ci     Therefore, mbedtls_platform_zeroize() is moved to the platform module to
3376a8e1175bSopenharmony_ci     facilitate testing and maintenance.
3377a8e1175bSopenharmony_ci
3378a8e1175bSopenharmony_ciBugfix
3379a8e1175bSopenharmony_ci   * Fix an issue with MicroBlaze support in bn_mul.h which was causing the
3380a8e1175bSopenharmony_ci     build to fail. Found by zv-io. Fixes #1651.
3381a8e1175bSopenharmony_ci
3382a8e1175bSopenharmony_ciChanges
3383a8e1175bSopenharmony_ci   * Support TLS testing in out-of-source builds using cmake. Fixes #1193.
3384a8e1175bSopenharmony_ci   * Fix redundant declaration of mbedtls_ssl_list_ciphersuites. Raised by
3385a8e1175bSopenharmony_ci     TrinityTonic. #1359.
3386a8e1175bSopenharmony_ci
3387a8e1175bSopenharmony_ci= mbed TLS 2.9.0 branch released 2018-04-30
3388a8e1175bSopenharmony_ci
3389a8e1175bSopenharmony_ciSecurity
3390a8e1175bSopenharmony_ci   * Fix an issue in the X.509 module which could lead to a buffer overread
3391a8e1175bSopenharmony_ci     during certificate validation. Additionally, the issue could also lead to
3392a8e1175bSopenharmony_ci     unnecessary callback checks being made or to some validation checks to be
3393a8e1175bSopenharmony_ci     omitted. The overread could be triggered remotely, while the other issues
3394a8e1175bSopenharmony_ci     would require a non DER-compliant certificate to be correctly signed by a
3395a8e1175bSopenharmony_ci     trusted CA, or a trusted CA with a non DER-compliant certificate. Found by
3396a8e1175bSopenharmony_ci     luocm. Fixes #825.
3397a8e1175bSopenharmony_ci   * Fix the buffer length assertion in the ssl_parse_certificate_request()
3398a8e1175bSopenharmony_ci     function which led to an arbitrary overread of the message buffer. The
3399a8e1175bSopenharmony_ci     overreads could be caused by receiving a malformed message at the point
3400a8e1175bSopenharmony_ci     where an optional signature algorithms list is expected when the signature
3401a8e1175bSopenharmony_ci     algorithms section is too short. In builds with debug output, the overread
3402a8e1175bSopenharmony_ci     data is output with the debug data.
3403a8e1175bSopenharmony_ci   * Fix a client-side bug in the validation of the server's ciphersuite choice
3404a8e1175bSopenharmony_ci     which could potentially lead to the client accepting a ciphersuite it didn't
3405a8e1175bSopenharmony_ci     offer or a ciphersuite that cannot be used with the TLS or DTLS version
3406a8e1175bSopenharmony_ci     chosen by the server. This could lead to corruption of internal data
3407a8e1175bSopenharmony_ci     structures for some configurations.
3408a8e1175bSopenharmony_ci
3409a8e1175bSopenharmony_ciFeatures
3410a8e1175bSopenharmony_ci   * Add an option, MBEDTLS_AES_FEWER_TABLES, to dynamically compute smaller AES
3411a8e1175bSopenharmony_ci     tables during runtime, thereby reducing the RAM/ROM footprint by ~6KiB.
3412a8e1175bSopenharmony_ci     Suggested and contributed by jkivilin in pull request #394.
3413a8e1175bSopenharmony_ci   * Add initial support for Curve448 (RFC 7748). Only mbedtls_ecp_mul() and
3414a8e1175bSopenharmony_ci     ECDH primitive functions (mbedtls_ecdh_gen_public(),
3415a8e1175bSopenharmony_ci     mbedtls_ecdh_compute_shared()) are supported for now. Contributed by
3416a8e1175bSopenharmony_ci     Nicholas Wilson in pull request #348.
3417a8e1175bSopenharmony_ci
3418a8e1175bSopenharmony_ciAPI Changes
3419a8e1175bSopenharmony_ci   * Extend the public API with the function of mbedtls_net_poll() to allow user
3420a8e1175bSopenharmony_ci     applications to wait for a network context to become ready before reading
3421a8e1175bSopenharmony_ci     or writing.
3422a8e1175bSopenharmony_ci   * Add function mbedtls_ssl_check_pending() to the public API to allow
3423a8e1175bSopenharmony_ci     a check for whether more more data is pending to be processed in the
3424a8e1175bSopenharmony_ci     internal message buffers.
3425a8e1175bSopenharmony_ci     This function is necessary to determine when it is safe to idle on the
3426a8e1175bSopenharmony_ci     underlying transport in case event-driven IO is used.
3427a8e1175bSopenharmony_ci
3428a8e1175bSopenharmony_ciBugfix
3429a8e1175bSopenharmony_ci   * Fix a spurious uninitialized variable warning in cmac.c. Fix independently
3430a8e1175bSopenharmony_ci     contributed by Brian J Murray and David Brown.
3431a8e1175bSopenharmony_ci   * Add missing dependencies in test suites that led to build failures
3432a8e1175bSopenharmony_ci     in configurations that omit certain hashes or public-key algorithms.
3433a8e1175bSopenharmony_ci     Fixes #1040.
3434a8e1175bSopenharmony_ci   * Fix C89 incompatibility in benchmark.c. Contributed by Brendan Shanks.
3435a8e1175bSopenharmony_ci     #1353
3436a8e1175bSopenharmony_ci   * Add missing dependencies for MBEDTLS_HAVE_TIME_DATE and
3437a8e1175bSopenharmony_ci     MBEDTLS_VERSION_FEATURES in some test suites. Contributed by
3438a8e1175bSopenharmony_ci     Deomid Ryabkov. Fixes #1299, #1475.
3439a8e1175bSopenharmony_ci   * Fix the Makefile build process for building shared libraries on Mac OS X.
3440a8e1175bSopenharmony_ci     Fixed by mnacamura.
3441a8e1175bSopenharmony_ci   * Fix parsing of PKCS#8 encoded Elliptic Curve keys. Previously Mbed TLS was
3442a8e1175bSopenharmony_ci     unable to parse keys which had only the optional parameters field of the
3443a8e1175bSopenharmony_ci     ECPrivateKey structure. Found by Jethro Beekman, fixed in #1379.
3444a8e1175bSopenharmony_ci   * Return the plaintext data more quickly on unpadded CBC decryption, as
3445a8e1175bSopenharmony_ci     stated in the mbedtls_cipher_update() documentation. Contributed by
3446a8e1175bSopenharmony_ci     Andy Leiserson.
3447a8e1175bSopenharmony_ci   * Fix overriding and ignoring return values when parsing and writing to
3448a8e1175bSopenharmony_ci     a file in pk_sign program. Found by kevlut in #1142.
3449a8e1175bSopenharmony_ci   * Restrict usage of error code MBEDTLS_ERR_SSL_WANT_READ to situations
3450a8e1175bSopenharmony_ci     where data needs to be fetched from the underlying transport in order
3451a8e1175bSopenharmony_ci     to make progress. Previously, this error code was also occasionally
3452a8e1175bSopenharmony_ci     returned when unexpected messages were being discarded, ignoring that
3453a8e1175bSopenharmony_ci     further messages could potentially already be pending to be processed
3454a8e1175bSopenharmony_ci     in the internal buffers; these cases led to deadlocks when event-driven
3455a8e1175bSopenharmony_ci     I/O was used. Found and reported by Hubert Mis in #772.
3456a8e1175bSopenharmony_ci   * Fix buffer length assertions in the ssl_parse_certificate_request()
3457a8e1175bSopenharmony_ci     function which leads to a potential one byte overread of the message
3458a8e1175bSopenharmony_ci     buffer.
3459a8e1175bSopenharmony_ci   * Fix invalid buffer sizes passed to zlib during record compression and
3460a8e1175bSopenharmony_ci     decompression.
3461a8e1175bSopenharmony_ci   * Fix the soversion of libmbedcrypto to match the soversion of the
3462a8e1175bSopenharmony_ci     maintained 2.7 branch. The soversion was increased in Mbed TLS
3463a8e1175bSopenharmony_ci     version 2.7.1 to reflect breaking changes in that release, but the
3464a8e1175bSopenharmony_ci     increment was missed in 2.8.0 and later releases outside of the 2.7 branch.
3465a8e1175bSopenharmony_ci
3466a8e1175bSopenharmony_ciChanges
3467a8e1175bSopenharmony_ci   * Remove some redundant code in bignum.c. Contributed by Alexey Skalozub.
3468a8e1175bSopenharmony_ci   * Support cmake builds where Mbed TLS is a subproject. Fix contributed
3469a8e1175bSopenharmony_ci     independently by Matthieu Volat and Arne Schwabe.
3470a8e1175bSopenharmony_ci   * Improve testing in configurations that omit certain hashes or
3471a8e1175bSopenharmony_ci     public-key algorithms. Includes contributions by Gert van Dijk.
3472a8e1175bSopenharmony_ci   * Improve negative testing of X.509 parsing.
3473a8e1175bSopenharmony_ci   * Do not define global mutexes around readdir() and gmtime() in
3474a8e1175bSopenharmony_ci     configurations where the feature is disabled. Found and fixed by Gergely
3475a8e1175bSopenharmony_ci     Budai.
3476a8e1175bSopenharmony_ci   * Harden the function mbedtls_ssl_config_free() against misuse, so that it
3477a8e1175bSopenharmony_ci     doesn't leak memory if the user doesn't use mbedtls_ssl_conf_psk() and
3478a8e1175bSopenharmony_ci     instead incorrectly manipulates the configuration structure directly.
3479a8e1175bSopenharmony_ci     Found and fix submitted by junyeonLEE in #1220.
3480a8e1175bSopenharmony_ci   * Provide an empty implementation of mbedtls_pkcs5_pbes2() when
3481a8e1175bSopenharmony_ci     MBEDTLS_ASN1_PARSE_C is not enabled. This allows the use of PBKDF2
3482a8e1175bSopenharmony_ci     without PBES2. Fixed by Marcos Del Sol Vives.
3483a8e1175bSopenharmony_ci   * Add the order of the base point as N in the mbedtls_ecp_group structure
3484a8e1175bSopenharmony_ci     for Curve25519 (other curves had it already). Contributed by Nicholas
3485a8e1175bSopenharmony_ci     Wilson #481
3486a8e1175bSopenharmony_ci   * Improve the documentation of mbedtls_net_accept(). Contributed by Ivan
3487a8e1175bSopenharmony_ci     Krylov.
3488a8e1175bSopenharmony_ci   * Improve the documentation of mbedtls_ssl_write(). Suggested by
3489a8e1175bSopenharmony_ci     Paul Sokolovsky in #1356.
3490a8e1175bSopenharmony_ci   * Add an option in the Makefile to support ar utilities where the operation
3491a8e1175bSopenharmony_ci     letter must not be prefixed by '-', such as LLVM. Found and fixed by
3492a8e1175bSopenharmony_ci     Alex Hixon.
3493a8e1175bSopenharmony_ci   * Allow configuring the shared library extension by setting the DLEXT
3494a8e1175bSopenharmony_ci     environment variable when using the project makefiles.
3495a8e1175bSopenharmony_ci   * Optimize unnecessary zeroing in mbedtls_mpi_copy. Based on a contribution
3496a8e1175bSopenharmony_ci     by Alexey Skalozub in #405.
3497a8e1175bSopenharmony_ci   * In the SSL module, when f_send, f_recv or f_recv_timeout report
3498a8e1175bSopenharmony_ci     transmitting more than the required length, return an error. Raised by
3499a8e1175bSopenharmony_ci     Sam O'Connor in #1245.
3500a8e1175bSopenharmony_ci   * Improve robustness of mbedtls_ssl_derive_keys against the use of
3501a8e1175bSopenharmony_ci     HMAC functions with non-HMAC ciphersuites. Independently contributed
3502a8e1175bSopenharmony_ci     by Jiayuan Chen in #1377. Fixes #1437.
3503a8e1175bSopenharmony_ci   * Improve security of RSA key generation by including criteria from
3504a8e1175bSopenharmony_ci     FIPS 186-4. Contributed by Jethro Beekman. #1380
3505a8e1175bSopenharmony_ci   * Declare functions in header files even when an alternative implementation
3506a8e1175bSopenharmony_ci     of the corresponding module is activated by defining the corresponding
3507a8e1175bSopenharmony_ci     MBEDTLS_XXX_ALT macro. This means that alternative implementations do
3508a8e1175bSopenharmony_ci     not need to copy the declarations, and ensures that they will have the
3509a8e1175bSopenharmony_ci     same API.
3510a8e1175bSopenharmony_ci   * Add platform setup and teardown calls in test suites.
3511a8e1175bSopenharmony_ci
3512a8e1175bSopenharmony_ci= mbed TLS 2.8.0 branch released 2018-03-16
3513a8e1175bSopenharmony_ci
3514a8e1175bSopenharmony_ciDefault behavior changes
3515a8e1175bSopenharmony_ci   * The truncated HMAC extension now conforms to RFC 6066. This means
3516a8e1175bSopenharmony_ci     that when both sides of a TLS connection negotiate the truncated
3517a8e1175bSopenharmony_ci     HMAC extension, Mbed TLS can now interoperate with other
3518a8e1175bSopenharmony_ci     compliant implementations, but this breaks interoperability with
3519a8e1175bSopenharmony_ci     prior versions of Mbed TLS. To restore the old behavior, enable
3520a8e1175bSopenharmony_ci     the (deprecated) option MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT in
3521a8e1175bSopenharmony_ci     config.h. Found by Andreas Walz (ivESK, Offenburg University of
3522a8e1175bSopenharmony_ci     Applied Sciences).
3523a8e1175bSopenharmony_ci
3524a8e1175bSopenharmony_ciSecurity
3525a8e1175bSopenharmony_ci   * Fix implementation of the truncated HMAC extension. The previous
3526a8e1175bSopenharmony_ci     implementation allowed an offline 2^80 brute force attack on the
3527a8e1175bSopenharmony_ci     HMAC key of a single, uninterrupted connection (with no
3528a8e1175bSopenharmony_ci     resumption of the session).
3529a8e1175bSopenharmony_ci   * Verify results of RSA private key operations to defend
3530a8e1175bSopenharmony_ci     against Bellcore glitch attack.
3531a8e1175bSopenharmony_ci   * Fix a buffer overread in ssl_parse_server_key_exchange() that could cause
3532a8e1175bSopenharmony_ci     a crash on invalid input.
3533a8e1175bSopenharmony_ci   * Fix a buffer overread in ssl_parse_server_psk_hint() that could cause a
3534a8e1175bSopenharmony_ci     crash on invalid input.
3535a8e1175bSopenharmony_ci   * Fix CRL parsing to reject CRLs containing unsupported critical
3536a8e1175bSopenharmony_ci     extensions. Found by Falko Strenzke and Evangelos Karatsiolis.
3537a8e1175bSopenharmony_ci
3538a8e1175bSopenharmony_ciFeatures
3539a8e1175bSopenharmony_ci   * Extend PKCS#8 interface by introducing support for the entire SHA
3540a8e1175bSopenharmony_ci     algorithms family when encrypting private keys using PKCS#5 v2.0.
3541a8e1175bSopenharmony_ci     This allows reading encrypted PEM files produced by software that
3542a8e1175bSopenharmony_ci     uses PBKDF2-SHA2, such as OpenSSL 1.1. Submitted by Antonio Quartulli,
3543a8e1175bSopenharmony_ci     OpenVPN Inc. Fixes #1339
3544a8e1175bSopenharmony_ci   * Add support for public keys encoded in PKCS#1 format. #1122
3545a8e1175bSopenharmony_ci
3546a8e1175bSopenharmony_ciNew deprecations
3547a8e1175bSopenharmony_ci   * Deprecate support for record compression (configuration option
3548a8e1175bSopenharmony_ci     MBEDTLS_ZLIB_SUPPORT).
3549a8e1175bSopenharmony_ci
3550a8e1175bSopenharmony_ciBugfix
3551a8e1175bSopenharmony_ci   * Fix the name of a DHE parameter that was accidentally changed in 2.7.0.
3552a8e1175bSopenharmony_ci     Fixes #1358.
3553a8e1175bSopenharmony_ci   * Fix test_suite_pk to work on 64-bit ILP32 systems. #849
3554a8e1175bSopenharmony_ci   * Fix mbedtls_x509_crt_profile_suiteb, which used to reject all certificates
3555a8e1175bSopenharmony_ci     with flag MBEDTLS_X509_BADCERT_BAD_PK even when the key type was correct.
3556a8e1175bSopenharmony_ci     In the context of SSL, this resulted in handshake failure. Reported by
3557a8e1175bSopenharmony_ci     daniel in the Mbed TLS forum. #1351
3558a8e1175bSopenharmony_ci   * Fix Windows x64 builds with the included mbedTLS.sln file. #1347
3559a8e1175bSopenharmony_ci   * Fix setting version TLSv1 as minimal version, even if TLS 1
3560a8e1175bSopenharmony_ci     is not enabled. Set MBEDTLS_SSL_MIN_MAJOR_VERSION
3561a8e1175bSopenharmony_ci     and MBEDTLS_SSL_MIN_MINOR_VERSION instead of
3562a8e1175bSopenharmony_ci     MBEDTLS_SSL_MAJOR_VERSION_3 and MBEDTLS_SSL_MINOR_VERSION_1. #664
3563a8e1175bSopenharmony_ci   * Fix compilation error on Mingw32 when _TRUNCATE is defined. Use _TRUNCATE
3564a8e1175bSopenharmony_ci     only if __MINGW32__ not defined. Fix suggested by Thomas Glanzmann and
3565a8e1175bSopenharmony_ci     Nick Wilson on issue #355
3566a8e1175bSopenharmony_ci   * In test_suite_pk, pass valid parameters when testing for hash length
3567a8e1175bSopenharmony_ci     overflow. #1179
3568a8e1175bSopenharmony_ci   * Fix memory allocation corner cases in memory_buffer_alloc.c module. Found
3569a8e1175bSopenharmony_ci     by Guido Vranken. #639
3570a8e1175bSopenharmony_ci   * Log correct number of ciphersuites used in Client Hello message. #918
3571a8e1175bSopenharmony_ci   * Fix X509 CRT parsing that would potentially accept an invalid tag when
3572a8e1175bSopenharmony_ci     parsing the subject alternative names.
3573a8e1175bSopenharmony_ci   * Fix a possible arithmetic overflow in ssl_parse_server_key_exchange()
3574a8e1175bSopenharmony_ci     that could cause a key exchange to fail on valid data.
3575a8e1175bSopenharmony_ci   * Fix a possible arithmetic overflow in ssl_parse_server_psk_hint() that
3576a8e1175bSopenharmony_ci     could cause a key exchange to fail on valid data.
3577a8e1175bSopenharmony_ci   * Don't define mbedtls_aes_decrypt and mbedtls_aes_encrypt under
3578a8e1175bSopenharmony_ci     MBEDTLS_DEPRECATED_REMOVED. #1388
3579a8e1175bSopenharmony_ci   * Fix a 1-byte heap buffer overflow (read-only) during private key parsing.
3580a8e1175bSopenharmony_ci     Found through fuzz testing.
3581a8e1175bSopenharmony_ci
3582a8e1175bSopenharmony_ciChanges
3583a8e1175bSopenharmony_ci   * Fix tag lengths and value ranges in the documentation of CCM encryption.
3584a8e1175bSopenharmony_ci     Contributed by Mathieu Briand.
3585a8e1175bSopenharmony_ci   * Fix typo in a comment ctr_drbg.c. Contributed by Paul Sokolovsky.
3586a8e1175bSopenharmony_ci   * Remove support for the library reference configuration for picocoin.
3587a8e1175bSopenharmony_ci   * MD functions deprecated in 2.7.0 are no longer inline, to provide
3588a8e1175bSopenharmony_ci     a migration path for those depending on the library's ABI.
3589a8e1175bSopenharmony_ci   * Clarify the documentation of mbedtls_ssl_setup.
3590a8e1175bSopenharmony_ci   * Use (void) when defining functions with no parameters. Contributed by
3591a8e1175bSopenharmony_ci     Joris Aerts. #678
3592a8e1175bSopenharmony_ci
3593a8e1175bSopenharmony_ci= mbed TLS 2.7.0 branch released 2018-02-03
3594a8e1175bSopenharmony_ci
3595a8e1175bSopenharmony_ciSecurity
3596a8e1175bSopenharmony_ci   * Fix a heap corruption issue in the implementation of the truncated HMAC
3597a8e1175bSopenharmony_ci     extension. When the truncated HMAC extension is enabled and CBC is used,
3598a8e1175bSopenharmony_ci     sending a malicious application packet could be used to selectively corrupt
3599a8e1175bSopenharmony_ci     6 bytes on the peer's heap, which could potentially lead to crash or remote
3600a8e1175bSopenharmony_ci     code execution. The issue could be triggered remotely from either side in
3601a8e1175bSopenharmony_ci     both TLS and DTLS. CVE-2018-0488
3602a8e1175bSopenharmony_ci   * Fix a buffer overflow in RSA-PSS verification when the hash was too large
3603a8e1175bSopenharmony_ci     for the key size, which could potentially lead to crash or remote code
3604a8e1175bSopenharmony_ci     execution. Found by Seth Terashima, Qualcomm Product Security Initiative,
3605a8e1175bSopenharmony_ci     Qualcomm Technologies Inc. CVE-2018-0487
3606a8e1175bSopenharmony_ci   * Fix buffer overflow in RSA-PSS verification when the unmasked data is all
3607a8e1175bSopenharmony_ci     zeros.
3608a8e1175bSopenharmony_ci   * Fix an unsafe bounds check in ssl_parse_client_psk_identity() when adding
3609a8e1175bSopenharmony_ci     64 KiB to the address of the SSL buffer and causing a wrap around.
3610a8e1175bSopenharmony_ci   * Fix a potential heap buffer overflow in mbedtls_ssl_write(). When the (by
3611a8e1175bSopenharmony_ci     default enabled) maximum fragment length extension is disabled in the
3612a8e1175bSopenharmony_ci     config and the application data buffer passed to mbedtls_ssl_write
3613a8e1175bSopenharmony_ci     is larger than the internal message buffer (16384 bytes by default), the
3614a8e1175bSopenharmony_ci     latter overflows. The exploitability of this issue depends on whether the
3615a8e1175bSopenharmony_ci     application layer can be forced into sending such large packets. The issue
3616a8e1175bSopenharmony_ci     was independently reported by Tim Nordell via e-mail and by Florin Petriuc
3617a8e1175bSopenharmony_ci     and sjorsdewit on GitHub. Fix proposed by Florin Petriuc in #1022.
3618a8e1175bSopenharmony_ci     Fixes #707.
3619a8e1175bSopenharmony_ci   * Add a provision to prevent compiler optimizations breaking the time
3620a8e1175bSopenharmony_ci     constancy of mbedtls_ssl_safer_memcmp().
3621a8e1175bSopenharmony_ci   * Ensure that buffers are cleared after use if they contain sensitive data.
3622a8e1175bSopenharmony_ci     Changes were introduced in multiple places in the library.
3623a8e1175bSopenharmony_ci   * Set PEM buffer to zero before freeing it, to avoid decoded private keys
3624a8e1175bSopenharmony_ci     being leaked to memory after release.
3625a8e1175bSopenharmony_ci   * Fix dhm_check_range() failing to detect trivial subgroups and potentially
3626a8e1175bSopenharmony_ci     leaking 1 bit of the private key. Reported by prashantkspatil.
3627a8e1175bSopenharmony_ci   * Make mbedtls_mpi_read_binary() constant-time with respect to the input
3628a8e1175bSopenharmony_ci     data. Previously, trailing zero bytes were detected and omitted for the
3629a8e1175bSopenharmony_ci     sake of saving memory, but potentially leading to slight timing
3630a8e1175bSopenharmony_ci     differences. Reported by Marco Macchetti, Kudelski Group.
3631a8e1175bSopenharmony_ci   * Wipe stack buffer temporarily holding EC private exponent
3632a8e1175bSopenharmony_ci     after keypair generation.
3633a8e1175bSopenharmony_ci   * Fix a potential heap buffer over-read in ALPN extension parsing
3634a8e1175bSopenharmony_ci     (server-side). Could result in application crash, but only if an ALPN
3635a8e1175bSopenharmony_ci     name larger than 16 bytes had been configured on the server.
3636a8e1175bSopenharmony_ci   * Change default choice of DHE parameters from untrustworthy RFC 5114
3637a8e1175bSopenharmony_ci     to RFC 3526 containing parameters generated in a nothing-up-my-sleeve
3638a8e1175bSopenharmony_ci     manner.
3639a8e1175bSopenharmony_ci
3640a8e1175bSopenharmony_ciFeatures
3641a8e1175bSopenharmony_ci   * Allow comments in test data files.
3642a8e1175bSopenharmony_ci   * The selftest program can execute a subset of the tests based on command
3643a8e1175bSopenharmony_ci     line arguments.
3644a8e1175bSopenharmony_ci   * New unit tests for timing. Improve the self-test to be more robust
3645a8e1175bSopenharmony_ci     when run on a heavily-loaded machine.
3646a8e1175bSopenharmony_ci   * Add alternative implementation support for CCM and CMAC (MBEDTLS_CCM_ALT,
3647a8e1175bSopenharmony_ci     MBEDTLS_CMAC_ALT). Submitted by Steven Cooreman, Silicon Labs.
3648a8e1175bSopenharmony_ci   * Add support for alternative implementations of GCM, selected by the
3649a8e1175bSopenharmony_ci     configuration flag MBEDTLS_GCM_ALT.
3650a8e1175bSopenharmony_ci   * Add support for alternative implementations for ECDSA, controlled by new
3651a8e1175bSopenharmony_ci     configuration flags MBEDTLS_ECDSA_SIGN_ALT, MBEDTLS_ECDSA_VERIFY_ALT and
3652a8e1175bSopenharmony_ci     MBEDTLS_ECDSDA_GENKEY_AT in config.h.
3653a8e1175bSopenharmony_ci     The following functions from the ECDSA module can be replaced
3654a8e1175bSopenharmony_ci     with alternative implementation:
3655a8e1175bSopenharmony_ci     mbedtls_ecdsa_sign(), mbedtls_ecdsa_verify() and mbedtls_ecdsa_genkey().
3656a8e1175bSopenharmony_ci   * Add support for alternative implementation of ECDH, controlled by the
3657a8e1175bSopenharmony_ci     new configuration flags MBEDTLS_ECDH_COMPUTE_SHARED_ALT and
3658a8e1175bSopenharmony_ci     MBEDTLS_ECDH_GEN_PUBLIC_ALT in config.h.
3659a8e1175bSopenharmony_ci     The following functions from the ECDH module can be replaced
3660a8e1175bSopenharmony_ci     with an alternative implementation:
3661a8e1175bSopenharmony_ci     mbedtls_ecdh_gen_public() and mbedtls_ecdh_compute_shared().
3662a8e1175bSopenharmony_ci   * Add support for alternative implementation of ECJPAKE, controlled by
3663a8e1175bSopenharmony_ci     the new configuration flag MBEDTLS_ECJPAKE_ALT.
3664a8e1175bSopenharmony_ci   * Add mechanism to provide alternative implementation of the DHM module.
3665a8e1175bSopenharmony_ci
3666a8e1175bSopenharmony_ciAPI Changes
3667a8e1175bSopenharmony_ci   * Extend RSA interface by multiple functions allowing structure-
3668a8e1175bSopenharmony_ci     independent setup and export of RSA contexts. Most notably,
3669a8e1175bSopenharmony_ci     mbedtls_rsa_import() and mbedtls_rsa_complete() are introduced for setting
3670a8e1175bSopenharmony_ci     up RSA contexts from partial key material and having them completed to the
3671a8e1175bSopenharmony_ci     needs of the implementation automatically. This allows to setup private RSA
3672a8e1175bSopenharmony_ci     contexts from keys consisting of N,D,E only, even if P,Q are needed for the
3673a8e1175bSopenharmony_ci     purpose or CRT and/or blinding.
3674a8e1175bSopenharmony_ci   * The configuration option MBEDTLS_RSA_ALT can be used to define alternative
3675a8e1175bSopenharmony_ci     implementations of the RSA interface declared in rsa.h.
3676a8e1175bSopenharmony_ci   * The following functions in the message digest modules (MD2, MD4, MD5,
3677a8e1175bSopenharmony_ci     SHA1, SHA256, SHA512) have been deprecated and replaced as shown below.
3678a8e1175bSopenharmony_ci     The new functions change the return type from void to int to allow
3679a8e1175bSopenharmony_ci     returning error codes when using MBEDTLS_<MODULE>_ALT.
3680a8e1175bSopenharmony_ci     mbedtls_<MODULE>_starts() -> mbedtls_<MODULE>_starts_ret()
3681a8e1175bSopenharmony_ci     mbedtls_<MODULE>_update() -> mbedtls_<MODULE>_update_ret()
3682a8e1175bSopenharmony_ci     mbedtls_<MODULE>_finish() -> mbedtls_<MODULE>_finish_ret()
3683a8e1175bSopenharmony_ci     mbedtls_<MODULE>_process() -> mbedtls_internal_<MODULE>_process()
3684a8e1175bSopenharmony_ci
3685a8e1175bSopenharmony_ciNew deprecations
3686a8e1175bSopenharmony_ci   * Deprecate usage of RSA primitives with non-matching key-type
3687a8e1175bSopenharmony_ci     (e.g. signing with a public key).
3688a8e1175bSopenharmony_ci   * Direct manipulation of structure fields of RSA contexts is deprecated.
3689a8e1175bSopenharmony_ci     Users are advised to use the extended RSA API instead.
3690a8e1175bSopenharmony_ci   * Deprecate usage of message digest functions that return void
3691a8e1175bSopenharmony_ci     (mbedtls_<MODULE>_starts, mbedtls_<MODULE>_update,
3692a8e1175bSopenharmony_ci     mbedtls_<MODULE>_finish and mbedtls_<MODULE>_process where <MODULE> is
3693a8e1175bSopenharmony_ci     any of MD2, MD4, MD5, SHA1, SHA256, SHA512) in favor of functions
3694a8e1175bSopenharmony_ci     that can return an error code.
3695a8e1175bSopenharmony_ci   * Deprecate untrustworthy DHE parameters from RFC 5114. Superseded by
3696a8e1175bSopenharmony_ci     parameters from RFC 3526 or the newly added parameters from RFC 7919.
3697a8e1175bSopenharmony_ci   * Deprecate hex string DHE constants MBEDTLS_DHM_RFC3526_MODP_2048_P etc.
3698a8e1175bSopenharmony_ci     Supserseded by binary encoded constants MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN
3699a8e1175bSopenharmony_ci     etc.
3700a8e1175bSopenharmony_ci   * Deprecate mbedtls_ssl_conf_dh_param() for setting default DHE parameters
3701a8e1175bSopenharmony_ci     from hex strings. Superseded by mbedtls_ssl_conf_dh_param_bin()
3702a8e1175bSopenharmony_ci     accepting DHM parameters in binary form, matching the new constants.
3703a8e1175bSopenharmony_ci
3704a8e1175bSopenharmony_ciBugfix
3705a8e1175bSopenharmony_ci   * Fix ssl_parse_record_header() to silently discard invalid DTLS records
3706a8e1175bSopenharmony_ci     as recommended in RFC 6347 Section 4.1.2.7.
3707a8e1175bSopenharmony_ci   * Fix memory leak in mbedtls_ssl_set_hostname() when called multiple times.
3708a8e1175bSopenharmony_ci     Found by projectgus and Jethro Beekman, #836.
3709a8e1175bSopenharmony_ci   * Fix usage help in ssl_server2 example. Found and fixed by Bei Lin.
3710a8e1175bSopenharmony_ci   * Parse signature algorithm extension when renegotiating. Previously,
3711a8e1175bSopenharmony_ci     renegotiated handshakes would only accept signatures using SHA-1
3712a8e1175bSopenharmony_ci     regardless of the peer's preferences, or fail if SHA-1 was disabled.
3713a8e1175bSopenharmony_ci   * Fix leap year calculation in x509_date_is_valid() to ensure that invalid
3714a8e1175bSopenharmony_ci     dates on leap years with 100 and 400 intervals are handled correctly. Found
3715a8e1175bSopenharmony_ci     by Nicholas Wilson. #694
3716a8e1175bSopenharmony_ci   * Fix some invalid RSA-PSS signatures with keys of size 8N+1 that were
3717a8e1175bSopenharmony_ci     accepted. Generating these signatures required the private key.
3718a8e1175bSopenharmony_ci   * Fix out-of-memory problem when parsing 4096-bit PKCS8-encrypted RSA keys.
3719a8e1175bSopenharmony_ci     Found independently by Florian in the mbed TLS forum and by Mishamax.
3720a8e1175bSopenharmony_ci     #878, #1019.
3721a8e1175bSopenharmony_ci   * Fix variable used before assignment compilation warnings with IAR
3722a8e1175bSopenharmony_ci     toolchain. Found by gkerrien38.
3723a8e1175bSopenharmony_ci   * Fix unchecked return codes from AES, DES and 3DES functions in
3724a8e1175bSopenharmony_ci     pem_aes_decrypt(), pem_des_decrypt() and pem_des3_decrypt() respectively.
3725a8e1175bSopenharmony_ci     If a call to one of the functions of the cryptographic primitive modules
3726a8e1175bSopenharmony_ci     failed, the error may not be noticed by the function
3727a8e1175bSopenharmony_ci     mbedtls_pem_read_buffer() causing it to return invalid values. Found by
3728a8e1175bSopenharmony_ci     Guido Vranken. #756
3729a8e1175bSopenharmony_ci   * Include configuration file in md.h, to fix compilation warnings.
3730a8e1175bSopenharmony_ci     Reported by aaronmdjones in #1001
3731a8e1175bSopenharmony_ci   * Correct extraction of signature-type from PK instance in X.509 CRT and CSR
3732a8e1175bSopenharmony_ci     writing routines that prevented these functions to work with alternative
3733a8e1175bSopenharmony_ci     RSA implementations. Raised by J.B. in the Mbed TLS forum. Fixes #1011.
3734a8e1175bSopenharmony_ci   * Don't print X.509 version tag for v1 CRT's, and omit extensions for
3735a8e1175bSopenharmony_ci     non-v3 CRT's.
3736a8e1175bSopenharmony_ci   * Fix bugs in RSA test suite under MBEDTLS_NO_PLATFORM_ENTROPY. #1023 #1024
3737a8e1175bSopenharmony_ci   * Fix net_would_block() to avoid modification by errno through fcntl() call.
3738a8e1175bSopenharmony_ci     Found by nkolban. Fixes #845.
3739a8e1175bSopenharmony_ci   * Fix handling of handshake messages in mbedtls_ssl_read() in case
3740a8e1175bSopenharmony_ci     MBEDTLS_SSL_RENEGOTIATION is disabled. Found by erja-gp.
3741a8e1175bSopenharmony_ci   * Add a check for invalid private parameters in mbedtls_ecdsa_sign().
3742a8e1175bSopenharmony_ci     Reported by Yolan Romailler.
3743a8e1175bSopenharmony_ci   * Fix word size check in in pk.c to not depend on MBEDTLS_HAVE_INT64.
3744a8e1175bSopenharmony_ci   * Fix incorrect unit in benchmark output. #850
3745a8e1175bSopenharmony_ci   * Add size-checks for record and handshake message content, securing
3746a8e1175bSopenharmony_ci     fragile yet non-exploitable code-paths.
3747a8e1175bSopenharmony_ci   * Fix crash when calling mbedtls_ssl_cache_free() twice. Found by
3748a8e1175bSopenharmony_ci     MilenkoMitrovic, #1104
3749a8e1175bSopenharmony_ci   * Fix mbedtls_timing_alarm(0) on Unix and MinGW.
3750a8e1175bSopenharmony_ci   * Fix use of uninitialized memory in mbedtls_timing_get_timer() when reset=1.
3751a8e1175bSopenharmony_ci   * Fix possible memory leaks in mbedtls_gcm_self_test().
3752a8e1175bSopenharmony_ci   * Added missing return code checks in mbedtls_aes_self_test().
3753a8e1175bSopenharmony_ci   * Fix issues in RSA key generation program programs/x509/rsa_genkey and the
3754a8e1175bSopenharmony_ci     RSA test suite where the failure of CTR DRBG initialization lead to
3755a8e1175bSopenharmony_ci     freeing an RSA context and several MPI's without proper initialization
3756a8e1175bSopenharmony_ci     beforehand.
3757a8e1175bSopenharmony_ci   * Fix error message in programs/pkey/gen_key.c. Found and fixed by Chris Xue.
3758a8e1175bSopenharmony_ci   * Fix programs/pkey/dh_server.c so that it actually works with dh_client.c.
3759a8e1175bSopenharmony_ci     Found and fixed by Martijn de Milliano.
3760a8e1175bSopenharmony_ci   * Fix an issue in the cipher decryption with the mode
3761a8e1175bSopenharmony_ci     MBEDTLS_PADDING_ONE_AND_ZEROS that sometimes accepted invalid padding.
3762a8e1175bSopenharmony_ci     Note, this padding mode is not used by the TLS protocol. Found and fixed by
3763a8e1175bSopenharmony_ci     Micha Kraus.
3764a8e1175bSopenharmony_ci   * Fix the entropy.c module to not call mbedtls_sha256_starts() or
3765a8e1175bSopenharmony_ci     mbedtls_sha512_starts() in the mbedtls_entropy_init() function.
3766a8e1175bSopenharmony_ci   * Fix the entropy.c module to ensure that mbedtls_sha256_init() or
3767a8e1175bSopenharmony_ci     mbedtls_sha512_init() is called before operating on the relevant context
3768a8e1175bSopenharmony_ci     structure. Do not assume that zeroizing a context is a correct way to
3769a8e1175bSopenharmony_ci     reset it. Found independently by ccli8 on Github.
3770a8e1175bSopenharmony_ci   * In mbedtls_entropy_free(), properly free the message digest context.
3771a8e1175bSopenharmony_ci   * Fix status handshake status message in programs/ssl/dtls_client.c. Found
3772a8e1175bSopenharmony_ci     and fixed by muddog.
3773a8e1175bSopenharmony_ci
3774a8e1175bSopenharmony_ciChanges
3775a8e1175bSopenharmony_ci   * Extend cert_write example program by options to set the certificate version
3776a8e1175bSopenharmony_ci     and the message digest. Further, allow enabling/disabling of authority
3777a8e1175bSopenharmony_ci     identifier, subject identifier and basic constraints extensions.
3778a8e1175bSopenharmony_ci   * Only check for necessary RSA structure fields in `mbedtls_rsa_private`. In
3779a8e1175bSopenharmony_ci     particular, don't require P,Q if neither CRT nor blinding are
3780a8e1175bSopenharmony_ci     used. Reported and fix proposed independently by satur9nine and sliai
3781a8e1175bSopenharmony_ci     on GitHub.
3782a8e1175bSopenharmony_ci   * Only run AES-192 self-test if AES-192 is available. Fixes #963.
3783a8e1175bSopenharmony_ci   * Tighten the RSA PKCS#1 v1.5 signature verification code and remove the
3784a8e1175bSopenharmony_ci     undeclared dependency of the RSA module on the ASN.1 module.
3785a8e1175bSopenharmony_ci   * Update all internal usage of deprecated message digest functions to the
3786a8e1175bSopenharmony_ci     new ones with return codes. In particular, this modifies the
3787a8e1175bSopenharmony_ci     mbedtls_md_info_t structure. Propagate errors from these functions
3788a8e1175bSopenharmony_ci     everywhere except some locations in the ssl_tls.c module.
3789a8e1175bSopenharmony_ci   * Improve CTR_DRBG error handling by propagating underlying AES errors.
3790a8e1175bSopenharmony_ci   * Add MBEDTLS_ERR_XXX_HW_ACCEL_FAILED error codes for all cryptography
3791a8e1175bSopenharmony_ci     modules where the software implementation can be replaced by a hardware
3792a8e1175bSopenharmony_ci     implementation.
3793a8e1175bSopenharmony_ci   * Add explicit warnings for the use of MD2, MD4, MD5, SHA-1, DES and ARC4
3794a8e1175bSopenharmony_ci     throughout the library.
3795a8e1175bSopenharmony_ci
3796a8e1175bSopenharmony_ci= mbed TLS 2.6.0 branch released 2017-08-10
3797a8e1175bSopenharmony_ci
3798a8e1175bSopenharmony_ciSecurity
3799a8e1175bSopenharmony_ci   * Fix authentication bypass in SSL/TLS: when authmode is set to optional,
3800a8e1175bSopenharmony_ci     mbedtls_ssl_get_verify_result() would incorrectly return 0 when the peer's
3801a8e1175bSopenharmony_ci     X.509 certificate chain had more than MBEDTLS_X509_MAX_INTERMEDIATE_CA
3802a8e1175bSopenharmony_ci     (default: 8) intermediates, even when it was not trusted. This could be
3803a8e1175bSopenharmony_ci     triggered remotely from either side. (With authmode set to 'required'
3804a8e1175bSopenharmony_ci     (the default), the handshake was correctly aborted).
3805a8e1175bSopenharmony_ci   * Reliably wipe sensitive data after use in the AES example applications
3806a8e1175bSopenharmony_ci     programs/aes/aescrypt2 and programs/aes/crypt_and_hash.
3807a8e1175bSopenharmony_ci     Found by Laurent Simon.
3808a8e1175bSopenharmony_ci
3809a8e1175bSopenharmony_ciFeatures
3810a8e1175bSopenharmony_ci   * Add the functions mbedtls_platform_setup() and mbedtls_platform_teardown()
3811a8e1175bSopenharmony_ci     and the context struct mbedtls_platform_context to perform
3812a8e1175bSopenharmony_ci     platform-specific setup and teardown operations. The macro
3813a8e1175bSopenharmony_ci     MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT allows the functions to be overridden
3814a8e1175bSopenharmony_ci     by the user in a platform_alt.h file. These new functions are required in
3815a8e1175bSopenharmony_ci     some embedded environments to provide a means of initialising underlying
3816a8e1175bSopenharmony_ci     cryptographic acceleration hardware.
3817a8e1175bSopenharmony_ci
3818a8e1175bSopenharmony_ciAPI Changes
3819a8e1175bSopenharmony_ci   * Reverted API/ABI breaking changes introduced in mbed TLS 2.5.1, to make the
3820a8e1175bSopenharmony_ci     API consistent with mbed TLS 2.5.0. Specifically removed the inline
3821a8e1175bSopenharmony_ci     qualifier from the functions mbedtls_aes_decrypt, mbedtls_aes_encrypt,
3822a8e1175bSopenharmony_ci     mbedtls_ssl_ciphersuite_uses_ec and mbedtls_ssl_ciphersuite_uses_psk. Found
3823a8e1175bSopenharmony_ci     by James Cowgill. #978
3824a8e1175bSopenharmony_ci   * Certificate verification functions now set flags to -1 in case the full
3825a8e1175bSopenharmony_ci     chain was not verified due to an internal error (including in the verify
3826a8e1175bSopenharmony_ci     callback) or chain length limitations.
3827a8e1175bSopenharmony_ci   * With authmode set to optional, the TLS handshake is now aborted if the
3828a8e1175bSopenharmony_ci     verification of the peer's certificate failed due to an overlong chain or
3829a8e1175bSopenharmony_ci     a fatal error in the verify callback.
3830a8e1175bSopenharmony_ci
3831a8e1175bSopenharmony_ciBugfix
3832a8e1175bSopenharmony_ci   * Add a check if iv_len is zero in GCM, and return an error if it is zero.
3833a8e1175bSopenharmony_ci     Reported by roberto. #716
3834a8e1175bSopenharmony_ci   * Replace preprocessor condition from #if defined(MBEDTLS_THREADING_PTHREAD)
3835a8e1175bSopenharmony_ci     to #if defined(MBEDTLS_THREADING_C) as the library cannot assume they will
3836a8e1175bSopenharmony_ci     always be implemented by pthread support. #696
3837a8e1175bSopenharmony_ci   * Fix a resource leak on Windows platforms in mbedtls_x509_crt_parse_path(),
3838a8e1175bSopenharmony_ci     in the case of an error. Found by redplait. #590
3839a8e1175bSopenharmony_ci   * Add MBEDTLS_MPI_CHK to check for error value of mbedtls_mpi_fill_random.
3840a8e1175bSopenharmony_ci     Reported and fix suggested by guidovranken. #740
3841a8e1175bSopenharmony_ci   * Fix conditional preprocessor directives in bignum.h to enable 64-bit
3842a8e1175bSopenharmony_ci     compilation when using ARM Compiler 6.
3843a8e1175bSopenharmony_ci   * Fix a potential integer overflow in the version verification for DER
3844a8e1175bSopenharmony_ci     encoded X.509 CRLs. The overflow could enable maliciously constructed CRLs
3845a8e1175bSopenharmony_ci     to bypass the version verification check. Found by Peng Li/Yueh-Hsun Lin,
3846a8e1175bSopenharmony_ci     KNOX Security, Samsung Research America
3847a8e1175bSopenharmony_ci   * Fix potential integer overflow in the version verification for DER
3848a8e1175bSopenharmony_ci     encoded X.509 CSRs. The overflow could enable maliciously constructed CSRs
3849a8e1175bSopenharmony_ci     to bypass the version verification check. Found by Peng Li/Yueh-Hsun Lin,
3850a8e1175bSopenharmony_ci     KNOX Security, Samsung Research America
3851a8e1175bSopenharmony_ci   * Fix a potential integer overflow in the version verification for DER
3852a8e1175bSopenharmony_ci     encoded X.509 certificates. The overflow could enable maliciously
3853a8e1175bSopenharmony_ci     constructed certificates to bypass the certificate verification check.
3854a8e1175bSopenharmony_ci   * Fix a call to the libc function time() to call the platform abstraction
3855a8e1175bSopenharmony_ci     function mbedtls_time() instead. Found by wairua. #666
3856a8e1175bSopenharmony_ci   * Avoid shadowing of time and index functions through mbed TLS function
3857a8e1175bSopenharmony_ci     arguments. Found by inestlerode. #557.
3858a8e1175bSopenharmony_ci
3859a8e1175bSopenharmony_ciChanges
3860a8e1175bSopenharmony_ci   * Added config.h option MBEDTLS_NO_UDBL_DIVISION, to prevent the use of
3861a8e1175bSopenharmony_ci     64-bit division. This is useful on embedded platforms where 64-bit division
3862a8e1175bSopenharmony_ci     created a dependency on external libraries. #708
3863a8e1175bSopenharmony_ci   * Removed mutexes from ECP hardware accelerator code. Now all hardware
3864a8e1175bSopenharmony_ci     accelerator code in the library leaves concurrency handling to the
3865a8e1175bSopenharmony_ci     platform. Reported by Steven Cooreman. #863
3866a8e1175bSopenharmony_ci   * Define the macro MBEDTLS_AES_ROM_TABLES in the configuration file
3867a8e1175bSopenharmony_ci     config-no-entropy.h to reduce the RAM footprint.
3868a8e1175bSopenharmony_ci   * Added a test script that can be hooked into git that verifies commits
3869a8e1175bSopenharmony_ci     before they are pushed.
3870a8e1175bSopenharmony_ci   * Improve documentation of PKCS1 decryption functions.
3871a8e1175bSopenharmony_ci
3872a8e1175bSopenharmony_ci= mbed TLS 2.5.1 released 2017-06-21
3873a8e1175bSopenharmony_ci
3874a8e1175bSopenharmony_ciSecurity
3875a8e1175bSopenharmony_ci   * Fixed unlimited overread of heap-based buffer in mbedtls_ssl_read().
3876a8e1175bSopenharmony_ci     The issue could only happen client-side with renegotiation enabled.
3877a8e1175bSopenharmony_ci     Could result in DoS (application crash) or information leak
3878a8e1175bSopenharmony_ci     (if the application layer sent data read from mbedtls_ssl_read()
3879a8e1175bSopenharmony_ci     back to the server or to a third party). Can be triggered remotely.
3880a8e1175bSopenharmony_ci   * Removed SHA-1 and RIPEMD-160 from the default hash algorithms for
3881a8e1175bSopenharmony_ci     certificate verification. SHA-1 can be turned back on with a compile-time
3882a8e1175bSopenharmony_ci     option if needed.
3883a8e1175bSopenharmony_ci   * Fixed offset in FALLBACK_SCSV parsing that caused TLS server to fail to
3884a8e1175bSopenharmony_ci     detect it sometimes. Reported by Hugo Leisink. #810
3885a8e1175bSopenharmony_ci   * Tighten parsing of RSA PKCS#1 v1.5 signatures, to avoid a
3886a8e1175bSopenharmony_ci     potential Bleichenbacher/BERserk-style attack.
3887a8e1175bSopenharmony_ci
3888a8e1175bSopenharmony_ciBugfix
3889a8e1175bSopenharmony_ci   * Remove size zero arrays from ECJPAKE test suite. Size zero arrays are not
3890a8e1175bSopenharmony_ci     valid C and they prevented the test from compiling in Visual Studio 2015
3891a8e1175bSopenharmony_ci     and with GCC using the -Wpedantic compilation option.
3892a8e1175bSopenharmony_ci   * Fix insufficient support for signature-hash-algorithm extension,
3893a8e1175bSopenharmony_ci     resulting in compatibility problems with Chrome. Found by hfloyrd. #823
3894a8e1175bSopenharmony_ci   * Fix behaviour that hid the original cause of fatal alerts in some cases
3895a8e1175bSopenharmony_ci     when sending the alert failed. The fix makes sure not to hide the error
3896a8e1175bSopenharmony_ci     that triggered the alert.
3897a8e1175bSopenharmony_ci   * Fix SSLv3 renegotiation behaviour and stop processing data received from
3898a8e1175bSopenharmony_ci     peer after sending a fatal alert to refuse a renegotiation attempt.
3899a8e1175bSopenharmony_ci     Previous behaviour was to keep processing data even after the alert has
3900a8e1175bSopenharmony_ci     been sent.
3901a8e1175bSopenharmony_ci   * Accept empty trusted CA chain in authentication mode
3902a8e1175bSopenharmony_ci     MBEDTLS_SSL_VERIFY_OPTIONAL. Found by Jethro Beekman. #864
3903a8e1175bSopenharmony_ci   * Fix implementation of mbedtls_ssl_parse_certificate() to not annihilate
3904a8e1175bSopenharmony_ci     fatal errors in authentication mode MBEDTLS_SSL_VERIFY_OPTIONAL and to
3905a8e1175bSopenharmony_ci     reflect bad EC curves within verification result.
3906a8e1175bSopenharmony_ci   * Fix bug that caused the modular inversion function to accept the invalid
3907a8e1175bSopenharmony_ci     modulus 1 and therefore to hang. Found by blaufish. #641.
3908a8e1175bSopenharmony_ci   * Fix incorrect sign computation in modular exponentiation when the base is
3909a8e1175bSopenharmony_ci     a negative MPI. Previously the result was always negative. Found by Guido
3910a8e1175bSopenharmony_ci     Vranken.
3911a8e1175bSopenharmony_ci   * Fix a numerical underflow leading to stack overflow in mpi_read_file()
3912a8e1175bSopenharmony_ci     that was triggered uppon reading an empty line. Found by Guido Vranken.
3913a8e1175bSopenharmony_ci
3914a8e1175bSopenharmony_ciChanges
3915a8e1175bSopenharmony_ci   * Send fatal alerts in more cases. The previous behaviour was to skip
3916a8e1175bSopenharmony_ci     sending the fatal alert and just drop the connection.
3917a8e1175bSopenharmony_ci   * Clarify ECDSA documentation and improve the sample code to avoid
3918a8e1175bSopenharmony_ci     misunderstanding and potentially dangerous use of the API. Pointed out
3919a8e1175bSopenharmony_ci     by Jean-Philippe Aumasson.
3920a8e1175bSopenharmony_ci
3921a8e1175bSopenharmony_ci= mbed TLS 2.5.0 branch released 2017-05-17
3922a8e1175bSopenharmony_ci
3923a8e1175bSopenharmony_ciSecurity
3924a8e1175bSopenharmony_ci   * Wipe stack buffers in RSA private key operations
3925a8e1175bSopenharmony_ci     (rsa_rsaes_pkcs1_v15_decrypt(), rsa_rsaes_oaep_decrypt). Found by Laurent
3926a8e1175bSopenharmony_ci     Simon.
3927a8e1175bSopenharmony_ci   * Add exponent blinding to RSA private operations as a countermeasure
3928a8e1175bSopenharmony_ci     against side-channel attacks like the cache attack described in
3929a8e1175bSopenharmony_ci     https://arxiv.org/abs/1702.08719v2.
3930a8e1175bSopenharmony_ci     Found and fix proposed by Michael Schwarz, Samuel Weiser, Daniel Gruss,
3931a8e1175bSopenharmony_ci     Clémentine Maurice and Stefan Mangard.
3932a8e1175bSopenharmony_ci
3933a8e1175bSopenharmony_ciFeatures
3934a8e1175bSopenharmony_ci   * Add hardware acceleration support for the Elliptic Curve Point module.
3935a8e1175bSopenharmony_ci     This involved exposing parts of the internal interface to enable
3936a8e1175bSopenharmony_ci     replacing the core functions and adding and alternative, module level
3937a8e1175bSopenharmony_ci     replacement support for enabling the extension of the interface.
3938a8e1175bSopenharmony_ci   * Add a new configuration option to 'mbedtls_ssl_config' to enable
3939a8e1175bSopenharmony_ci     suppressing the CA list in Certificate Request messages. The default
3940a8e1175bSopenharmony_ci     behaviour has not changed, namely every configured CAs name is included.
3941a8e1175bSopenharmony_ci
3942a8e1175bSopenharmony_ciAPI Changes
3943a8e1175bSopenharmony_ci   * The following functions in the AES module have been deprecated and replaced
3944a8e1175bSopenharmony_ci     by the functions shown below. The new functions change the return type from
3945a8e1175bSopenharmony_ci     void to int to allow returning error codes when using MBEDTLS_AES_ALT,
3946a8e1175bSopenharmony_ci     MBEDTLS_AES_DECRYPT_ALT or MBEDTLS_AES_ENCRYPT_ALT.
3947a8e1175bSopenharmony_ci     mbedtls_aes_decrypt() -> mbedtls_internal_aes_decrypt()
3948a8e1175bSopenharmony_ci     mbedtls_aes_encrypt() -> mbedtls_internal_aes_encrypt()
3949a8e1175bSopenharmony_ci
3950a8e1175bSopenharmony_ciBugfix
3951a8e1175bSopenharmony_ci   * Remove macros from compat-1.3.h that correspond to deleted items from most
3952a8e1175bSopenharmony_ci     recent versions of the library. Found by Kyle Keen.
3953a8e1175bSopenharmony_ci   * Fixed issue in the Threading module that prevented mutexes from
3954a8e1175bSopenharmony_ci     initialising. Found by sznaider. #667 #843
3955a8e1175bSopenharmony_ci   * Add checks in the PK module for the RSA functions on 64-bit systems.
3956a8e1175bSopenharmony_ci     The PK and RSA modules use different types for passing hash length and
3957a8e1175bSopenharmony_ci     without these checks the type cast could lead to data loss. Found by Guido
3958a8e1175bSopenharmony_ci     Vranken.
3959a8e1175bSopenharmony_ci
3960a8e1175bSopenharmony_ci= mbed TLS 2.4.2 branch released 2017-03-08
3961a8e1175bSopenharmony_ci
3962a8e1175bSopenharmony_ciSecurity
3963a8e1175bSopenharmony_ci   * Add checks to prevent signature forgeries for very large messages while
3964a8e1175bSopenharmony_ci     using RSA through the PK module in 64-bit systems. The issue was caused by
3965a8e1175bSopenharmony_ci     some data loss when casting a size_t to an unsigned int value in the
3966a8e1175bSopenharmony_ci     functions rsa_verify_wrap(), rsa_sign_wrap(), rsa_alt_sign_wrap() and
3967a8e1175bSopenharmony_ci     mbedtls_pk_sign(). Found by Jean-Philippe Aumasson.
3968a8e1175bSopenharmony_ci   * Fixed potential livelock during the parsing of a CRL in PEM format in
3969a8e1175bSopenharmony_ci     mbedtls_x509_crl_parse(). A string containing a CRL followed by trailing
3970a8e1175bSopenharmony_ci     characters after the footer could result in the execution of an infinite
3971a8e1175bSopenharmony_ci     loop. The issue can be triggered remotely. Found by Greg Zaverucha,
3972a8e1175bSopenharmony_ci     Microsoft.
3973a8e1175bSopenharmony_ci   * Removed MD5 from the allowed hash algorithms for CertificateRequest and
3974a8e1175bSopenharmony_ci     CertificateVerify messages, to prevent SLOTH attacks against TLS 1.2.
3975a8e1175bSopenharmony_ci     Introduced by interoperability fix for #513.
3976a8e1175bSopenharmony_ci   * Fixed a bug that caused freeing a buffer that was allocated on the stack,
3977a8e1175bSopenharmony_ci     when verifying the validity of a key on secp224k1. This could be
3978a8e1175bSopenharmony_ci     triggered remotely for example with a maliciously constructed certificate
3979a8e1175bSopenharmony_ci     and potentially could lead to remote code execution on some platforms.
3980a8e1175bSopenharmony_ci     Reported independently by rongsaws and Aleksandar Nikolic, Cisco Talos
3981a8e1175bSopenharmony_ci     team. #569 CVE-2017-2784
3982a8e1175bSopenharmony_ci
3983a8e1175bSopenharmony_ciBugfix
3984a8e1175bSopenharmony_ci   * Fix output certificate verification flags set by x509_crt_verify_top() when
3985a8e1175bSopenharmony_ci     traversing a chain of trusted CA. The issue would cause both flags,
3986a8e1175bSopenharmony_ci     MBEDTLS_X509_BADCERT_NOT_TRUSTED and MBEDTLS_X509_BADCERT_EXPIRED, to be
3987a8e1175bSopenharmony_ci     set when the verification conditions are not met regardless of the cause.
3988a8e1175bSopenharmony_ci     Found by Harm Verhagen and inestlerode. #665 #561
3989a8e1175bSopenharmony_ci   * Fix the redefinition of macro ssl_set_bio to an undefined symbol
3990a8e1175bSopenharmony_ci     mbedtls_ssl_set_bio_timeout in compat-1.3.h, by removing it.
3991a8e1175bSopenharmony_ci     Found by omlib-lin. #673
3992a8e1175bSopenharmony_ci   * Fix unused variable/function compilation warnings in pem.c, x509_crt.c and
3993a8e1175bSopenharmony_ci     x509_csr.c that are reported when building mbed TLS with a config.h that
3994a8e1175bSopenharmony_ci     does not define MBEDTLS_PEM_PARSE_C. Found by omnium21. #562
3995a8e1175bSopenharmony_ci   * Fix incorrect renegotiation condition in ssl_check_ctr_renegotiate() that
3996a8e1175bSopenharmony_ci     would compare 64 bits of the record counter instead of 48 bits as indicated
3997a8e1175bSopenharmony_ci     in RFC 6347 Section 4.3.1. This could cause the execution of the
3998a8e1175bSopenharmony_ci     renegotiation routines at unexpected times when the protocol is DTLS. Found
3999a8e1175bSopenharmony_ci     by wariua. #687
4000a8e1175bSopenharmony_ci   * Fixed multiple buffer overreads in mbedtls_pem_read_buffer() when parsing
4001a8e1175bSopenharmony_ci     the input string in PEM format to extract the different components. Found
4002a8e1175bSopenharmony_ci     by Eyal Itkin.
4003a8e1175bSopenharmony_ci   * Fixed potential arithmetic overflow in mbedtls_ctr_drbg_reseed() that could
4004a8e1175bSopenharmony_ci     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4005a8e1175bSopenharmony_ci   * Fixed potential arithmetic overflows in mbedtls_cipher_update() that could
4006a8e1175bSopenharmony_ci     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4007a8e1175bSopenharmony_ci   * Fixed potential arithmetic overflow in mbedtls_md2_update() that could
4008a8e1175bSopenharmony_ci     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4009a8e1175bSopenharmony_ci   * Fixed potential arithmetic overflow in mbedtls_base64_decode() that could
4010a8e1175bSopenharmony_ci     cause buffer bound checks to be bypassed. Found by Eyal Itkin.
4011a8e1175bSopenharmony_ci   * Fixed heap overreads in mbedtls_x509_get_time(). Found by Peng
4012a8e1175bSopenharmony_ci     Li/Yueh-Hsun Lin, KNOX Security, Samsung Research America.
4013a8e1175bSopenharmony_ci   * Fix potential memory leak in mbedtls_x509_crl_parse(). The leak was caused
4014a8e1175bSopenharmony_ci     by missing calls to mbedtls_pem_free() in cases when a
4015a8e1175bSopenharmony_ci     MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT error was encountered. Found and
4016a8e1175bSopenharmony_ci     fix proposed by Guido Vranken. #722
4017a8e1175bSopenharmony_ci   * Fixed the templates used to generate project and solution files for Visual
4018a8e1175bSopenharmony_ci     Studio 2015 as well as the files themselves, to remove a build warning
4019a8e1175bSopenharmony_ci     generated in Visual Studio 2015. Reported by Steve Valliere. #742
4020a8e1175bSopenharmony_ci   * Fix a resource leak in ssl_cookie, when using MBEDTLS_THREADING_C.
4021a8e1175bSopenharmony_ci     Raised and fix suggested by Alan Gillingham in the mbed TLS forum. #771
4022a8e1175bSopenharmony_ci   * Fix 1 byte buffer overflow in mbedtls_mpi_write_string() when the MPI
4023a8e1175bSopenharmony_ci     number to write in hexadecimal is negative and requires an odd number of
4024a8e1175bSopenharmony_ci     digits. Found and fixed by Guido Vranken.
4025a8e1175bSopenharmony_ci   * Fix unlisted DES configuration dependency in some pkparse test cases. Found
4026a8e1175bSopenharmony_ci     by inestlerode. #555
4027a8e1175bSopenharmony_ci
4028a8e1175bSopenharmony_ci= mbed TLS 2.4.1 branch released 2016-12-13
4029a8e1175bSopenharmony_ci
4030a8e1175bSopenharmony_ciChanges
4031a8e1175bSopenharmony_ci   * Update to CMAC test data, taken from - NIST Special Publication 800-38B -
4032a8e1175bSopenharmony_ci     Recommendation for Block Cipher Modes of Operation: The CMAC Mode for
4033a8e1175bSopenharmony_ci     Authentication – October  2016
4034a8e1175bSopenharmony_ci
4035a8e1175bSopenharmony_ci= mbed TLS 2.4.0 branch released 2016-10-17
4036a8e1175bSopenharmony_ci
4037a8e1175bSopenharmony_ciSecurity
4038a8e1175bSopenharmony_ci   * Removed the MBEDTLS_SSL_AEAD_RANDOM_IV option, because it was not compliant
4039a8e1175bSopenharmony_ci     with RFC-5116 and could lead to session key recovery in very long TLS
4040a8e1175bSopenharmony_ci     sessions. "Nonce-Disrespecting Adversaries Practical Forgery Attacks on GCM in
4041a8e1175bSopenharmony_ci     TLS" - H. Bock, A. Zauner, S. Devlin, J. Somorovsky, P. Jovanovic.
4042a8e1175bSopenharmony_ci     https://eprint.iacr.org/2016/475.pdf
4043a8e1175bSopenharmony_ci   * Fixed potential stack corruption in mbedtls_x509write_crt_der() and
4044a8e1175bSopenharmony_ci     mbedtls_x509write_csr_der() when the signature is copied to the buffer
4045a8e1175bSopenharmony_ci     without checking whether there is enough space in the destination. The
4046a8e1175bSopenharmony_ci     issue cannot be triggered remotely. Found by Jethro Beekman.
4047a8e1175bSopenharmony_ci
4048a8e1175bSopenharmony_ciFeatures
4049a8e1175bSopenharmony_ci   * Added support for CMAC for AES and 3DES and AES-CMAC-PRF-128, as defined by
4050a8e1175bSopenharmony_ci     NIST SP 800-38B, RFC-4493 and RFC-4615.
4051a8e1175bSopenharmony_ci   * Added hardware entropy selftest to verify that the hardware entropy source
4052a8e1175bSopenharmony_ci     is functioning correctly.
4053a8e1175bSopenharmony_ci   * Added a script to print build environment info for diagnostic use in test
4054a8e1175bSopenharmony_ci     scripts, which is also now called by all.sh.
4055a8e1175bSopenharmony_ci   * Added the macro MBEDTLS_X509_MAX_FILE_PATH_LEN that enables the user to
4056a8e1175bSopenharmony_ci     configure the maximum length of a file path that can be buffered when
4057a8e1175bSopenharmony_ci     calling mbedtls_x509_crt_parse_path().
4058a8e1175bSopenharmony_ci   * Added a configuration file config-no-entropy.h that configures the subset of
4059a8e1175bSopenharmony_ci     library features that do not require an entropy source.
4060a8e1175bSopenharmony_ci   * Added the macro MBEDTLS_ENTROPY_MIN_HARDWARE in config.h. This allows users
4061a8e1175bSopenharmony_ci     to configure the minimum number of bytes for entropy sources using the
4062a8e1175bSopenharmony_ci     mbedtls_hardware_poll() function.
4063a8e1175bSopenharmony_ci
4064a8e1175bSopenharmony_ciBugfix
4065a8e1175bSopenharmony_ci   * Fix for platform time abstraction to avoid dependency issues where a build
4066a8e1175bSopenharmony_ci     may need time but not the standard C library abstraction, and added
4067a8e1175bSopenharmony_ci     configuration consistency checks to check_config.h
4068a8e1175bSopenharmony_ci   * Fix dependency issue in Makefile to allow parallel builds.
4069a8e1175bSopenharmony_ci   * Fix incorrect handling of block lengths in crypt_and_hash.c sample program,
4070a8e1175bSopenharmony_ci     when GCM is used. Found by udf2457. #441
4071a8e1175bSopenharmony_ci   * Fix for key exchanges based on ECDH-RSA or ECDH-ECDSA which weren't
4072a8e1175bSopenharmony_ci     enabled unless others were also present. Found by David Fernandez. #428
4073a8e1175bSopenharmony_ci   * Fix for out-of-tree builds using CMake. Found by jwurzer, and fix based on
4074a8e1175bSopenharmony_ci     a contribution from Tobias Tangemann. #541
4075a8e1175bSopenharmony_ci   * Fixed cert_app.c sample program for debug output and for use when no root
4076a8e1175bSopenharmony_ci     certificates are provided.
4077a8e1175bSopenharmony_ci   * Fix conditional statement that would cause a 1 byte overread in
4078a8e1175bSopenharmony_ci     mbedtls_asn1_get_int(). Found and fixed by Guido Vranken. #599
4079a8e1175bSopenharmony_ci   * Fixed pthread implementation to avoid unintended double initialisations
4080a8e1175bSopenharmony_ci     and double frees. Found by Niklas Amnebratt.
4081a8e1175bSopenharmony_ci   * Fixed the sample applications gen_key.c, cert_req.c and cert_write.c for
4082a8e1175bSopenharmony_ci     builds where the configuration MBEDTLS_PEM_WRITE_C is not defined. Found
4083a8e1175bSopenharmony_ci     by inestlerode. #559.
4084a8e1175bSopenharmony_ci   * Fix mbedtls_x509_get_sig() to update the ASN1 type in the mbedtls_x509_buf
4085a8e1175bSopenharmony_ci     data structure until after error checks are successful. Found by
4086a8e1175bSopenharmony_ci     subramanyam-c. #622
4087a8e1175bSopenharmony_ci   * Fix documentation and implementation missmatch for function arguments of
4088a8e1175bSopenharmony_ci     mbedtls_gcm_finish(). Found by cmiatpaar. #602
4089a8e1175bSopenharmony_ci   * Guarantee that P>Q at RSA key generation. Found by inestlerode. #558
4090a8e1175bSopenharmony_ci   * Fix potential byte overread when verifying malformed SERVER_HELLO in
4091a8e1175bSopenharmony_ci     ssl_parse_hello_verify_request() for DTLS. Found by Guido Vranken.
4092a8e1175bSopenharmony_ci   * Fix check for validity of date when parsing in mbedtls_x509_get_time().
4093a8e1175bSopenharmony_ci     Found by subramanyam-c. #626
4094a8e1175bSopenharmony_ci   * Fix compatibility issue with Internet Explorer client authentication,
4095a8e1175bSopenharmony_ci     where the limited hash choices prevented the client from sending its
4096a8e1175bSopenharmony_ci     certificate. Found by teumas. #513
4097a8e1175bSopenharmony_ci   * Fix compilation without MBEDTLS_SELF_TEST enabled.
4098a8e1175bSopenharmony_ci
4099a8e1175bSopenharmony_ciChanges
4100a8e1175bSopenharmony_ci   * Extended test coverage of special cases, and added new timing test suite.
4101a8e1175bSopenharmony_ci   * Removed self-tests from the basic-built-test.sh script, and added all
4102a8e1175bSopenharmony_ci     missing self-tests to the test suites, to ensure self-tests are only
4103a8e1175bSopenharmony_ci     executed once.
4104a8e1175bSopenharmony_ci   * Added support for 3 and 4 byte lengths to mbedtls_asn1_write_len().
4105a8e1175bSopenharmony_ci   * Added support for a Yotta specific configuration file -
4106a8e1175bSopenharmony_ci     through the symbol YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE.
4107a8e1175bSopenharmony_ci   * Added optimization for code space for X.509/OID based on configured
4108a8e1175bSopenharmony_ci     features. Contributed by Aviv Palivoda.
4109a8e1175bSopenharmony_ci   * Renamed source file library/net.c to library/net_sockets.c to avoid
4110a8e1175bSopenharmony_ci     naming collision in projects which also have files with the common name
4111a8e1175bSopenharmony_ci     net.c. For consistency, the corresponding header file, net.h, is marked as
4112a8e1175bSopenharmony_ci     deprecated, and its contents moved to net_sockets.h.
4113a8e1175bSopenharmony_ci   * Changed the strategy for X.509 certificate parsing and validation, to no
4114a8e1175bSopenharmony_ci     longer disregard certificates with unrecognised fields.
4115a8e1175bSopenharmony_ci
4116a8e1175bSopenharmony_ci= mbed TLS 2.3.0 branch released 2016-06-28
4117a8e1175bSopenharmony_ci
4118a8e1175bSopenharmony_ciSecurity
4119a8e1175bSopenharmony_ci   * Fix missing padding length check in mbedtls_rsa_rsaes_pkcs1_v15_decrypt
4120a8e1175bSopenharmony_ci     required by PKCS1 v2.2
4121a8e1175bSopenharmony_ci   * Fix potential integer overflow to buffer overflow in
4122a8e1175bSopenharmony_ci     mbedtls_rsa_rsaes_pkcs1_v15_encrypt and mbedtls_rsa_rsaes_oaep_encrypt
4123a8e1175bSopenharmony_ci     (not triggerable remotely in (D)TLS).
4124a8e1175bSopenharmony_ci   * Fix a potential integer underflow to buffer overread in
4125a8e1175bSopenharmony_ci     mbedtls_rsa_rsaes_oaep_decrypt. It is not triggerable remotely in
4126a8e1175bSopenharmony_ci     SSL/TLS.
4127a8e1175bSopenharmony_ci
4128a8e1175bSopenharmony_ciFeatures
4129a8e1175bSopenharmony_ci   * Support for platform abstraction of the standard C library time()
4130a8e1175bSopenharmony_ci     function.
4131a8e1175bSopenharmony_ci
4132a8e1175bSopenharmony_ciBugfix
4133a8e1175bSopenharmony_ci   * Fix bug in mbedtls_mpi_add_mpi() that caused wrong results when the three
4134a8e1175bSopenharmony_ci     arguments where the same (in-place doubling). Found and fixed by Janos
4135a8e1175bSopenharmony_ci     Follath. #309
4136a8e1175bSopenharmony_ci   * Fix potential build failures related to the 'apidoc' target, introduced
4137a8e1175bSopenharmony_ci     in the previous patch release. Found by Robert Scheck. #390 #391
4138a8e1175bSopenharmony_ci   * Fix issue in Makefile that prevented building using armar. #386
4139a8e1175bSopenharmony_ci   * Fix memory leak that occurred only when ECJPAKE was enabled and ECDHE and
4140a8e1175bSopenharmony_ci     ECDSA was disabled in config.h . The leak didn't occur by default.
4141a8e1175bSopenharmony_ci   * Fix an issue that caused valid certificates to be rejected whenever an
4142a8e1175bSopenharmony_ci     expired or not yet valid certificate was parsed before a valid certificate
4143a8e1175bSopenharmony_ci     in the trusted certificate list.
4144a8e1175bSopenharmony_ci   * Fix bug in mbedtls_x509_crt_parse that caused trailing extra data in the
4145a8e1175bSopenharmony_ci     buffer after DER certificates to be included in the raw representation.
4146a8e1175bSopenharmony_ci   * Fix issue that caused a hang when generating RSA keys of odd bitlength
4147a8e1175bSopenharmony_ci   * Fix bug in mbedtls_rsa_rsaes_pkcs1_v15_encrypt that made null pointer
4148a8e1175bSopenharmony_ci     dereference possible.
4149a8e1175bSopenharmony_ci   * Fix issue that caused a crash if invalid curves were passed to
4150a8e1175bSopenharmony_ci     mbedtls_ssl_conf_curves. #373
4151a8e1175bSopenharmony_ci   * Fix issue in ssl_fork_server which was preventing it from functioning. #429
4152a8e1175bSopenharmony_ci   * Fix memory leaks in test framework
4153a8e1175bSopenharmony_ci   * Fix test in ssl-opt.sh that does not run properly with valgrind
4154a8e1175bSopenharmony_ci   * Fix unchecked calls to mmbedtls_md_setup(). Fix by Brian Murray. #502
4155a8e1175bSopenharmony_ci
4156a8e1175bSopenharmony_ciChanges
4157a8e1175bSopenharmony_ci   * On ARM platforms, when compiling with -O0 with GCC, Clang or armcc5,
4158a8e1175bSopenharmony_ci     don't use the optimized assembly for bignum multiplication. This removes
4159a8e1175bSopenharmony_ci     the need to pass -fomit-frame-pointer to avoid a build error with -O0.
4160a8e1175bSopenharmony_ci   * Disabled SSLv3 in the default configuration.
4161a8e1175bSopenharmony_ci   * Optimized mbedtls_mpi_zeroize() for MPI integer size. (Fix by Alexey
4162a8e1175bSopenharmony_ci     Skalozub).
4163a8e1175bSopenharmony_ci   * Fix non-compliance server extension handling. Extensions for SSLv3 are now
4164a8e1175bSopenharmony_ci     ignored, as required by RFC6101.
4165a8e1175bSopenharmony_ci
4166a8e1175bSopenharmony_ci= mbed TLS 2.2.1 released 2016-01-05
4167a8e1175bSopenharmony_ci
4168a8e1175bSopenharmony_ciSecurity
4169a8e1175bSopenharmony_ci   * Fix potential double free when mbedtls_asn1_store_named_data() fails to
4170a8e1175bSopenharmony_ci     allocate memory. Only used for certificate generation, not triggerable
4171a8e1175bSopenharmony_ci     remotely in SSL/TLS. Found by Rafał Przywara. #367
4172a8e1175bSopenharmony_ci   * Disable MD5 handshake signatures in TLS 1.2 by default to prevent the
4173a8e1175bSopenharmony_ci     SLOTH attack on TLS 1.2 server authentication (other attacks from the
4174a8e1175bSopenharmony_ci     SLOTH paper do not apply to any version of mbed TLS or PolarSSL).
4175a8e1175bSopenharmony_ci     https://www.mitls.org/pages/attacks/SLOTH
4176a8e1175bSopenharmony_ci
4177a8e1175bSopenharmony_ciBugfix
4178a8e1175bSopenharmony_ci   * Fix over-restrictive length limit in GCM. Found by Andreas-N. #362
4179a8e1175bSopenharmony_ci   * Fix bug in certificate validation that caused valid chains to be rejected
4180a8e1175bSopenharmony_ci     when the first intermediate certificate has pathLenConstraint=0. Found by
4181a8e1175bSopenharmony_ci     Nicholas Wilson. Introduced in mbed TLS 2.2.0. #280
4182a8e1175bSopenharmony_ci   * Removed potential leak in mbedtls_rsa_rsassa_pkcs1_v15_sign(), found by
4183a8e1175bSopenharmony_ci     JayaraghavendranK. #372
4184a8e1175bSopenharmony_ci   * Fix suboptimal handling of unexpected records that caused interop issues
4185a8e1175bSopenharmony_ci     with some peers over unreliable links. Avoid dropping an entire DTLS
4186a8e1175bSopenharmony_ci     datagram if a single record in a datagram is unexpected, instead only
4187a8e1175bSopenharmony_ci     drop the record and look at subsequent records (if any are present) in
4188a8e1175bSopenharmony_ci     the same datagram. Found by jeannotlapin. #345
4189a8e1175bSopenharmony_ci
4190a8e1175bSopenharmony_ci= mbed TLS 2.2.0 released 2015-11-04
4191a8e1175bSopenharmony_ci
4192a8e1175bSopenharmony_ciSecurity
4193a8e1175bSopenharmony_ci   * Fix potential double free if mbedtls_ssl_conf_psk() is called more than
4194a8e1175bSopenharmony_ci     once and some allocation fails. Cannot be forced remotely. Found by Guido
4195a8e1175bSopenharmony_ci     Vranken, Intelworks.
4196a8e1175bSopenharmony_ci   * Fix potential heap corruption on Windows when
4197a8e1175bSopenharmony_ci     mbedtls_x509_crt_parse_path() is passed a path longer than 2GB. Cannot be
4198a8e1175bSopenharmony_ci     triggered remotely. Found by Guido Vranken, Intelworks.
4199a8e1175bSopenharmony_ci   * Fix potential buffer overflow in some asn1_write_xxx() functions.
4200a8e1175bSopenharmony_ci     Cannot be triggered remotely unless you create X.509 certificates based
4201a8e1175bSopenharmony_ci     on untrusted input or write keys of untrusted origin. Found by Guido
4202a8e1175bSopenharmony_ci     Vranken, Intelworks.
4203a8e1175bSopenharmony_ci   * The X509 max_pathlen constraint was not enforced on intermediate
4204a8e1175bSopenharmony_ci     certificates. Found by Nicholas Wilson, fix and tests provided by
4205a8e1175bSopenharmony_ci     Janos Follath. #280 and #319
4206a8e1175bSopenharmony_ci
4207a8e1175bSopenharmony_ciFeatures
4208a8e1175bSopenharmony_ci   * Experimental support for EC J-PAKE as defined in Thread 1.0.0.
4209a8e1175bSopenharmony_ci     Disabled by default as the specification might still change.
4210a8e1175bSopenharmony_ci   * Added a key extraction callback to accees the master secret and key
4211a8e1175bSopenharmony_ci     block. (Potential uses include EAP-TLS and Thread.)
4212a8e1175bSopenharmony_ci
4213a8e1175bSopenharmony_ciBugfix
4214a8e1175bSopenharmony_ci   * Self-signed certificates were not excluded from pathlen counting,
4215a8e1175bSopenharmony_ci     resulting in some valid X.509 being incorrectly rejected. Found and fix
4216a8e1175bSopenharmony_ci     provided by Janos Follath. #319
4217a8e1175bSopenharmony_ci   * Fix build error with configurations where ECDHE-PSK is the only key
4218a8e1175bSopenharmony_ci     exchange. Found and fix provided by Chris Hammond. #270
4219a8e1175bSopenharmony_ci   * Fix build error with configurations where RSA, RSA-PSK, ECDH-RSA or
4220a8e1175bSopenharmony_ci     ECHD-ECDSA if the only key exchange. Multiple reports. #310
4221a8e1175bSopenharmony_ci   * Fixed a bug causing some handshakes to fail due to some non-fatal alerts
4222a8e1175bSopenharmony_ci     not being properly ignored. Found by mancha and Kasom Koht-arsa, #308
4223a8e1175bSopenharmony_ci   * mbedtls_x509_crt_verify(_with_profile)() now also checks the key type and
4224a8e1175bSopenharmony_ci     size/curve against the profile. Before that, there was no way to set a
4225a8e1175bSopenharmony_ci     minimum key size for end-entity certificates with RSA keys. Found by
4226a8e1175bSopenharmony_ci     Matthew Page of Scannex Electronics Ltd.
4227a8e1175bSopenharmony_ci   * Fix failures in MPI on Sparc(64) due to use of bad assembly code.
4228a8e1175bSopenharmony_ci     Found by Kurt Danielson. #292
4229a8e1175bSopenharmony_ci   * Fix typo in name of the extKeyUsage OID. Found by inestlerode, #314
4230a8e1175bSopenharmony_ci   * Fix bug in ASN.1 encoding of booleans that caused generated CA
4231a8e1175bSopenharmony_ci     certificates to be rejected by some applications, including OS X
4232a8e1175bSopenharmony_ci     Keychain. Found and fixed by Jonathan Leroy, Inikup.
4233a8e1175bSopenharmony_ci
4234a8e1175bSopenharmony_ciChanges
4235a8e1175bSopenharmony_ci   * Improved performance of mbedtls_ecp_muladd() when one of the scalars is 1
4236a8e1175bSopenharmony_ci     or -1.
4237a8e1175bSopenharmony_ci
4238a8e1175bSopenharmony_ci= mbed TLS 2.1.2 released 2015-10-06
4239a8e1175bSopenharmony_ci
4240a8e1175bSopenharmony_ciSecurity
4241a8e1175bSopenharmony_ci   * Added fix for CVE-2015-5291 to prevent heap corruption due to buffer
4242a8e1175bSopenharmony_ci     overflow of the hostname or session ticket. Found by Guido Vranken,
4243a8e1175bSopenharmony_ci     Intelworks.
4244a8e1175bSopenharmony_ci   * Fix potential double-free if mbedtls_ssl_set_hs_psk() is called more than
4245a8e1175bSopenharmony_ci     once in the same handhake and mbedtls_ssl_conf_psk() was used.
4246a8e1175bSopenharmony_ci     Found and patch provided by Guido Vranken, Intelworks. Cannot be forced
4247a8e1175bSopenharmony_ci     remotely.
4248a8e1175bSopenharmony_ci   * Fix stack buffer overflow in pkcs12 decryption (used by
4249a8e1175bSopenharmony_ci     mbedtls_pk_parse_key(file)() when the password is > 129 bytes.
4250a8e1175bSopenharmony_ci     Found by Guido Vranken, Intelworks. Not triggerable remotely.
4251a8e1175bSopenharmony_ci   * Fix potential buffer overflow in mbedtls_mpi_read_string().
4252a8e1175bSopenharmony_ci     Found by Guido Vranken, Intelworks. Not exploitable remotely in the context
4253a8e1175bSopenharmony_ci     of TLS, but might be in other uses. On 32 bit machines, requires reading a
4254a8e1175bSopenharmony_ci     string of close to or larger than 1GB to exploit; on 64 bit machines, would
4255a8e1175bSopenharmony_ci     require reading a string of close to or larger than 2^62 bytes.
4256a8e1175bSopenharmony_ci   * Fix potential random memory allocation in mbedtls_pem_read_buffer()
4257a8e1175bSopenharmony_ci     on crafted PEM input data. Found and fix provided by Guido Vranken,
4258a8e1175bSopenharmony_ci     Intelworks. Not triggerable remotely in TLS. Triggerable remotely if you
4259a8e1175bSopenharmony_ci     accept PEM data from an untrusted source.
4260a8e1175bSopenharmony_ci   * Fix possible heap buffer overflow in base64_encoded() when the input
4261a8e1175bSopenharmony_ci     buffer is 512MB or larger on 32-bit platforms. Found by Guido Vranken,
4262a8e1175bSopenharmony_ci     Intelworks. Not trigerrable remotely in TLS.
4263a8e1175bSopenharmony_ci   * Fix potential double-free if mbedtls_conf_psk() is called repeatedly on
4264a8e1175bSopenharmony_ci     the same mbedtls_ssl_config object and memory allocation fails. Found by
4265a8e1175bSopenharmony_ci     Guido Vranken, Intelworks. Cannot be forced remotely.
4266a8e1175bSopenharmony_ci   * Fix potential heap buffer overflow in servers that perform client
4267a8e1175bSopenharmony_ci     authentication against a crafted CA cert. Cannot be triggered remotely
4268a8e1175bSopenharmony_ci     unless you allow third parties to pick trust CAs for client auth.
4269a8e1175bSopenharmony_ci     Found by Guido Vranken, Intelworks.
4270a8e1175bSopenharmony_ci
4271a8e1175bSopenharmony_ciBugfix
4272a8e1175bSopenharmony_ci   * Fix compile error in net.c with musl libc. Found and patch provided by
4273a8e1175bSopenharmony_ci     zhasha (#278).
4274a8e1175bSopenharmony_ci   * Fix macroization of 'inline' keyword when building as C++. (#279)
4275a8e1175bSopenharmony_ci
4276a8e1175bSopenharmony_ciChanges
4277a8e1175bSopenharmony_ci   * Added checking of hostname length in mbedtls_ssl_set_hostname() to ensure
4278a8e1175bSopenharmony_ci     domain names are compliant with RFC 1035.
4279a8e1175bSopenharmony_ci   * Fixed paths for check_config.h in example config files. (Found by bachp)
4280a8e1175bSopenharmony_ci     (#291)
4281a8e1175bSopenharmony_ci
4282a8e1175bSopenharmony_ci= mbed TLS 2.1.1 released 2015-09-17
4283a8e1175bSopenharmony_ci
4284a8e1175bSopenharmony_ciSecurity
4285a8e1175bSopenharmony_ci   * Add countermeasure against Lenstra's RSA-CRT attack for PKCS#1 v1.5
4286a8e1175bSopenharmony_ci     signatures. (Found by Florian Weimer, Red Hat.)
4287a8e1175bSopenharmony_ci     https://securityblog.redhat.com/2015/09/02/factoring-rsa-keys-with-tls-perfect-forward-secrecy/
4288a8e1175bSopenharmony_ci   * Fix possible client-side NULL pointer dereference (read) when the client
4289a8e1175bSopenharmony_ci     tries to continue the handshake after it failed (a misuse of the API).
4290a8e1175bSopenharmony_ci     (Found and patch provided by Fabian Foerg, Gotham Digital Science using
4291a8e1175bSopenharmony_ci     afl-fuzz.)
4292a8e1175bSopenharmony_ci
4293a8e1175bSopenharmony_ciBugfix
4294a8e1175bSopenharmony_ci   * Fix warning when using a 64bit platform. (found by embedthis) (#275)
4295a8e1175bSopenharmony_ci   * Fix off-by-one error in parsing Supported Point Format extension that
4296a8e1175bSopenharmony_ci     caused some handshakes to fail.
4297a8e1175bSopenharmony_ci
4298a8e1175bSopenharmony_ciChanges
4299a8e1175bSopenharmony_ci   * Made X509 profile pointer const in mbedtls_ssl_conf_cert_profile() to allow
4300a8e1175bSopenharmony_ci     use of mbedtls_x509_crt_profile_next. (found by NWilson)
4301a8e1175bSopenharmony_ci   * When a client initiates a reconnect from the same port as a live
4302a8e1175bSopenharmony_ci     connection, if cookie verification is available
4303a8e1175bSopenharmony_ci     (MBEDTLS_SSL_DTLS_HELLO_VERIFY defined in config.h, and usable cookie
4304a8e1175bSopenharmony_ci     callbacks set with mbedtls_ssl_conf_dtls_cookies()), this will be
4305a8e1175bSopenharmony_ci     detected and mbedtls_ssl_read() will return
4306a8e1175bSopenharmony_ci     MBEDTLS_ERR_SSL_CLIENT_RECONNECT - it is then possible to start a new
4307a8e1175bSopenharmony_ci     handshake with the same context. (See RFC 6347 section 4.2.8.)
4308a8e1175bSopenharmony_ci
4309a8e1175bSopenharmony_ci= mbed TLS 2.1.0 released 2015-09-04
4310a8e1175bSopenharmony_ci
4311a8e1175bSopenharmony_ciFeatures
4312a8e1175bSopenharmony_ci   * Added support for yotta as a build system.
4313a8e1175bSopenharmony_ci   * Primary open source license changed to Apache 2.0 license.
4314a8e1175bSopenharmony_ci
4315a8e1175bSopenharmony_ciBugfix
4316a8e1175bSopenharmony_ci   * Fix segfault in the benchmark program when benchmarking DHM.
4317a8e1175bSopenharmony_ci   * Fix build error with CMake and pre-4.5 versions of GCC (found by Hugo
4318a8e1175bSopenharmony_ci     Leisink).
4319a8e1175bSopenharmony_ci   * Fix bug when parsing a ServerHello without extensions (found by David
4320a8e1175bSopenharmony_ci     Sears).
4321a8e1175bSopenharmony_ci   * Fix bug in CMake lists that caused libmbedcrypto.a not to be installed
4322a8e1175bSopenharmony_ci     (found by Benoit Lecocq).
4323a8e1175bSopenharmony_ci   * Fix bug in Makefile that caused libmbedcrypto and libmbedx509 not to be
4324a8e1175bSopenharmony_ci     installed (found by Rawi666).
4325a8e1175bSopenharmony_ci   * Fix compile error with armcc 5 with --gnu option.
4326a8e1175bSopenharmony_ci   * Fix bug in Makefile that caused programs not to be installed correctly
4327a8e1175bSopenharmony_ci     (found by robotanarchy) (#232).
4328a8e1175bSopenharmony_ci   * Fix bug in Makefile that prevented from installing without building the
4329a8e1175bSopenharmony_ci     tests (found by robotanarchy) (#232).
4330a8e1175bSopenharmony_ci   * Fix missing -static-libgcc when building shared libraries for Windows
4331a8e1175bSopenharmony_ci     with make.
4332a8e1175bSopenharmony_ci   * Fix link error when building shared libraries for Windows with make.
4333a8e1175bSopenharmony_ci   * Fix error when loading libmbedtls.so.
4334a8e1175bSopenharmony_ci   * Fix bug in mbedtls_ssl_conf_default() that caused the default preset to
4335a8e1175bSopenharmony_ci     be always used (found by dcb314) (#235)
4336a8e1175bSopenharmony_ci   * Fix bug in mbedtls_rsa_public() and mbedtls_rsa_private() that could
4337a8e1175bSopenharmony_ci     result trying to unlock an unlocked mutex on invalid input (found by
4338a8e1175bSopenharmony_ci     Fredrik Axelsson) (#257)
4339a8e1175bSopenharmony_ci   * Fix -Wshadow warnings (found by hnrkp) (#240)
4340a8e1175bSopenharmony_ci   * Fix memory corruption on client with overlong PSK identity, around
4341a8e1175bSopenharmony_ci     SSL_MAX_CONTENT_LEN or higher - not triggerrable remotely (found by
4342a8e1175bSopenharmony_ci     Aleksandrs Saveljevs) (#238)
4343a8e1175bSopenharmony_ci   * Fix unused function warning when using MBEDTLS_MDx_ALT or
4344a8e1175bSopenharmony_ci     MBEDTLS_SHAxxx_ALT (found by Henrik) (#239)
4345a8e1175bSopenharmony_ci   * Fix memory corruption in pkey programs (found by yankuncheng) (#210)
4346a8e1175bSopenharmony_ci
4347a8e1175bSopenharmony_ciChanges
4348a8e1175bSopenharmony_ci   * The PEM parser now accepts a trailing space at end of lines (#226).
4349a8e1175bSopenharmony_ci   * It is now possible to #include a user-provided configuration file at the
4350a8e1175bSopenharmony_ci     end of the default config.h by defining MBEDTLS_USER_CONFIG_FILE on the
4351a8e1175bSopenharmony_ci     compiler's command line.
4352a8e1175bSopenharmony_ci   * When verifying a certificate chain, if an intermediate certificate is
4353a8e1175bSopenharmony_ci     trusted, no later cert is checked. (suggested by hannes-landeholm)
4354a8e1175bSopenharmony_ci     (#220).
4355a8e1175bSopenharmony_ci   * Prepend a "thread identifier" to debug messages (issue pointed out by
4356a8e1175bSopenharmony_ci     Hugo Leisink) (#210).
4357a8e1175bSopenharmony_ci   * Add mbedtls_ssl_get_max_frag_len() to query the current maximum fragment
4358a8e1175bSopenharmony_ci     length.
4359a8e1175bSopenharmony_ci
4360a8e1175bSopenharmony_ci= mbed TLS 2.0.0 released 2015-07-13
4361a8e1175bSopenharmony_ci
4362a8e1175bSopenharmony_ciFeatures
4363a8e1175bSopenharmony_ci   * Support for DTLS 1.0 and 1.2 (RFC 6347).
4364a8e1175bSopenharmony_ci   * Ability to override core functions from MDx, SHAx, AES and DES modules
4365a8e1175bSopenharmony_ci     with custom implementation (eg hardware accelerated), complementing the
4366a8e1175bSopenharmony_ci     ability to override the whole module.
4367a8e1175bSopenharmony_ci   * New server-side implementation of session tickets that rotate keys to
4368a8e1175bSopenharmony_ci     preserve forward secrecy, and allows sharing across multiple contexts.
4369a8e1175bSopenharmony_ci   * Added a concept of X.509 cerificate verification profile that controls
4370a8e1175bSopenharmony_ci     which algorithms and key sizes (curves for ECDSA) are acceptable.
4371a8e1175bSopenharmony_ci   * Expanded configurability of security parameters in the SSL module with
4372a8e1175bSopenharmony_ci     mbedtls_ssl_conf_dhm_min_bitlen() and mbedtls_ssl_conf_sig_hashes().
4373a8e1175bSopenharmony_ci   * Introduced a concept of presets for SSL security-relevant configuration
4374a8e1175bSopenharmony_ci     parameters.
4375a8e1175bSopenharmony_ci
4376a8e1175bSopenharmony_ciAPI Changes
4377a8e1175bSopenharmony_ci   * The library has been split into libmbedcrypto, libmbedx509, libmbedtls.
4378a8e1175bSopenharmony_ci     You now need to link to all of them if you use TLS for example.
4379a8e1175bSopenharmony_ci   * All public identifiers moved to the mbedtls_* or MBEDTLS_* namespace.
4380a8e1175bSopenharmony_ci     Some names have been further changed to make them more consistent.
4381a8e1175bSopenharmony_ci     Migration helpers scripts/rename.pl and include/mbedtls/compat-1.3.h are
4382a8e1175bSopenharmony_ci     provided. Full list of renamings in scripts/data_files/rename-1.3-2.0.txt
4383a8e1175bSopenharmony_ci   * Renamings of fields inside structures, not covered by the previous list:
4384a8e1175bSopenharmony_ci     mbedtls_cipher_info_t.key_length -> key_bitlen
4385a8e1175bSopenharmony_ci     mbedtls_cipher_context_t.key_length -> key_bitlen
4386a8e1175bSopenharmony_ci     mbedtls_ecp_curve_info.size -> bit_size
4387a8e1175bSopenharmony_ci   * Headers are now found in the 'mbedtls' directory (previously 'polarssl').
4388a8e1175bSopenharmony_ci   * The following _init() functions that could return errors have
4389a8e1175bSopenharmony_ci     been split into an _init() that returns void and another function that
4390a8e1175bSopenharmony_ci     should generally be the first function called on this context after init:
4391a8e1175bSopenharmony_ci     mbedtls_ssl_init() -> mbedtls_ssl_setup()
4392a8e1175bSopenharmony_ci     mbedtls_ccm_init() -> mbedtls_ccm_setkey()
4393a8e1175bSopenharmony_ci     mbedtls_gcm_init() -> mbedtls_gcm_setkey()
4394a8e1175bSopenharmony_ci     mbedtls_hmac_drbg_init() -> mbedtls_hmac_drbg_seed(_buf)()
4395a8e1175bSopenharmony_ci     mbedtls_ctr_drbg_init()  -> mbedtls_ctr_drbg_seed()
4396a8e1175bSopenharmony_ci     Note that for mbedtls_ssl_setup(), you need to be done setting up the
4397a8e1175bSopenharmony_ci     ssl_config structure before calling it.
4398a8e1175bSopenharmony_ci   * Most ssl_set_xxx() functions (all except ssl_set_bio(), ssl_set_hostname(),
4399a8e1175bSopenharmony_ci     ssl_set_session() and ssl_set_client_transport_id(), plus
4400a8e1175bSopenharmony_ci     ssl_legacy_renegotiation()) have been renamed to mbedtls_ssl_conf_xxx()
4401a8e1175bSopenharmony_ci     (see rename.pl and compat-1.3.h above) and their first argument's type
4402a8e1175bSopenharmony_ci     changed from ssl_context to ssl_config.
4403a8e1175bSopenharmony_ci   * ssl_set_bio() changed signature (contexts merged, order switched, one
4404a8e1175bSopenharmony_ci     additional callback for read-with-timeout).
4405a8e1175bSopenharmony_ci   * The following functions have been introduced and must be used in callback
4406a8e1175bSopenharmony_ci     implementations (SNI, PSK) instead of their *conf counterparts:
4407a8e1175bSopenharmony_ci     mbedtls_ssl_set_hs_own_cert()
4408a8e1175bSopenharmony_ci     mbedtls_ssl_set_hs_ca_chain()
4409a8e1175bSopenharmony_ci     mbedtls_ssl_set_hs_psk()
4410a8e1175bSopenharmony_ci   * mbedtls_ssl_conf_ca_chain() lost its last argument (peer_cn), now set
4411a8e1175bSopenharmony_ci     using mbedtls_ssl_set_hostname().
4412a8e1175bSopenharmony_ci   * mbedtls_ssl_conf_session_cache() changed prototype (only one context
4413a8e1175bSopenharmony_ci     pointer, parameters reordered).
4414a8e1175bSopenharmony_ci   * On server, mbedtls_ssl_conf_session_tickets_cb() must now be used in
4415a8e1175bSopenharmony_ci     place of mbedtls_ssl_conf_session_tickets() to enable session tickets.
4416a8e1175bSopenharmony_ci   * The SSL debug callback gained two new arguments (file name, line number).
4417a8e1175bSopenharmony_ci   * Debug modes were removed.
4418a8e1175bSopenharmony_ci   * mbedtls_ssl_conf_truncated_hmac() now returns void.
4419a8e1175bSopenharmony_ci   * mbedtls_memory_buffer_alloc_init() now returns void.
4420a8e1175bSopenharmony_ci   * X.509 verification flags are now an uint32_t. Affect the signature of:
4421a8e1175bSopenharmony_ci     mbedtls_ssl_get_verify_result()
4422a8e1175bSopenharmony_ci     mbedtls_x509_ctr_verify_info()
4423a8e1175bSopenharmony_ci     mbedtls_x509_crt_verify() (flags, f_vrfy -> needs to be updated)
4424a8e1175bSopenharmony_ci     mbedtls_ssl_conf_verify() (f_vrfy -> needs to be updated)
4425a8e1175bSopenharmony_ci   * The following functions changed prototype to avoid an in-out length
4426a8e1175bSopenharmony_ci     parameter:
4427a8e1175bSopenharmony_ci     mbedtls_base64_encode()
4428a8e1175bSopenharmony_ci     mbedtls_base64_decode()
4429a8e1175bSopenharmony_ci     mbedtls_mpi_write_string()
4430a8e1175bSopenharmony_ci     mbedtls_dhm_calc_secret()
4431a8e1175bSopenharmony_ci   * In the NET module, all "int" and "int *" arguments for file descriptors
4432a8e1175bSopenharmony_ci     changed type to "mbedtls_net_context *".
4433a8e1175bSopenharmony_ci   * net_accept() gained new arguments for the size of the client_ip buffer.
4434a8e1175bSopenharmony_ci   * In the threading layer, mbedtls_mutex_init() and mbedtls_mutex_free() now
4435a8e1175bSopenharmony_ci     return void.
4436a8e1175bSopenharmony_ci   * ecdsa_write_signature() gained an additional md_alg argument and
4437a8e1175bSopenharmony_ci     ecdsa_write_signature_det() was deprecated.
4438a8e1175bSopenharmony_ci   * pk_sign() no longer accepts md_alg == POLARSSL_MD_NONE with ECDSA.
4439a8e1175bSopenharmony_ci   * Last argument of x509_crt_check_key_usage() and
4440a8e1175bSopenharmony_ci     mbedtls_x509write_crt_set_key_usage() changed from int to unsigned.
4441a8e1175bSopenharmony_ci   * test_ca_list (from certs.h) is renamed to test_cas_pem and is only
4442a8e1175bSopenharmony_ci     available if POLARSSL_PEM_PARSE_C is defined (it never worked without).
4443a8e1175bSopenharmony_ci   * Test certificates in certs.c are no longer guaranteed to be nul-terminated
4444a8e1175bSopenharmony_ci     strings; use the new *_len variables instead of strlen().
4445a8e1175bSopenharmony_ci   * Functions mbedtls_x509_xxx_parse(), mbedtls_pk_parse_key(),
4446a8e1175bSopenharmony_ci     mbedtls_pk_parse_public_key() and mbedtls_dhm_parse_dhm() now expect the
4447a8e1175bSopenharmony_ci     length parameter to include the terminating null byte for PEM input.
4448a8e1175bSopenharmony_ci   * Signature of mpi_mul_mpi() changed to make the last argument unsigned
4449a8e1175bSopenharmony_ci   * calloc() is now used instead of malloc() everywhere. API of platform
4450a8e1175bSopenharmony_ci     layer and the memory_buffer_alloc module changed accordingly.
4451a8e1175bSopenharmony_ci     (Thanks to Mansour Moufid for helping with the replacement.)
4452a8e1175bSopenharmony_ci   * Change SSL_DISABLE_RENEGOTIATION config.h flag to SSL_RENEGOTIATION
4453a8e1175bSopenharmony_ci     (support for renegotiation now needs explicit enabling in config.h).
4454a8e1175bSopenharmony_ci   * Split MBEDTLS_HAVE_TIME into MBEDTLS_HAVE_TIME and MBEDTLS_HAVE_TIME_DATE
4455a8e1175bSopenharmony_ci     in config.h
4456a8e1175bSopenharmony_ci   * net_connect() and net_bind() have a new 'proto' argument to choose
4457a8e1175bSopenharmony_ci     between TCP and UDP, using the macros NET_PROTO_TCP or NET_PROTO_UDP.
4458a8e1175bSopenharmony_ci     Their 'port' argument type is changed to a string.
4459a8e1175bSopenharmony_ci   * Some constness fixes
4460a8e1175bSopenharmony_ci
4461a8e1175bSopenharmony_ciRemovals
4462a8e1175bSopenharmony_ci   * Removed mbedtls_ecp_group_read_string(). Only named groups are supported.
4463a8e1175bSopenharmony_ci   * Removed mbedtls_ecp_sub() and mbedtls_ecp_add(), use
4464a8e1175bSopenharmony_ci     mbedtls_ecp_muladd().
4465a8e1175bSopenharmony_ci   * Removed individual mdX_hmac, shaX_hmac, mdX_file and shaX_file functions
4466a8e1175bSopenharmony_ci     (use generic functions from md.h)
4467a8e1175bSopenharmony_ci   * Removed mbedtls_timing_msleep(). Use mbedtls_net_usleep() or a custom
4468a8e1175bSopenharmony_ci     waiting function.
4469a8e1175bSopenharmony_ci   * Removed test DHM parameters from the test certs module.
4470a8e1175bSopenharmony_ci   * Removed the PBKDF2 module (use PKCS5).
4471a8e1175bSopenharmony_ci   * Removed POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()).
4472a8e1175bSopenharmony_ci   * Removed compat-1.2.h (helper for migrating from 1.2 to 1.3).
4473a8e1175bSopenharmony_ci   * Removed openssl.h (very partial OpenSSL compatibility layer).
4474a8e1175bSopenharmony_ci   * Configuration options POLARSSL_HAVE_LONGLONG was removed (now always on).
4475a8e1175bSopenharmony_ci   * Configuration options POLARSSL_HAVE_INT8 and POLARSSL_HAVE_INT16 have
4476a8e1175bSopenharmony_ci     been removed (compiler is required to support 32-bit operations).
4477a8e1175bSopenharmony_ci   * Configuration option POLARSSL_HAVE_IPV6 was removed (always enabled).
4478a8e1175bSopenharmony_ci   * Removed test program o_p_test, the script compat.sh does more.
4479a8e1175bSopenharmony_ci   * Removed test program ssl_test, superseded by ssl-opt.sh.
4480a8e1175bSopenharmony_ci   * Removed helper script active-config.pl
4481a8e1175bSopenharmony_ci
4482a8e1175bSopenharmony_ciNew deprecations
4483a8e1175bSopenharmony_ci   * md_init_ctx() is deprecated in favour of md_setup(), that adds a third
4484a8e1175bSopenharmony_ci     argument (allowing memory savings if HMAC is not used)
4485a8e1175bSopenharmony_ci
4486a8e1175bSopenharmony_ciSemi-API changes (technically public, morally private)
4487a8e1175bSopenharmony_ci   * Renamed a few headers to include _internal in the name. Those headers are
4488a8e1175bSopenharmony_ci     not supposed to be included by users.
4489a8e1175bSopenharmony_ci   * Changed md_info_t into an opaque structure (use md_get_xxx() accessors).
4490a8e1175bSopenharmony_ci   * Changed pk_info_t into an opaque structure.
4491a8e1175bSopenharmony_ci   * Changed cipher_base_t into an opaque structure.
4492a8e1175bSopenharmony_ci   * Removed sig_oid2 and rename sig_oid1 to sig_oid in x509_crt and x509_crl.
4493a8e1175bSopenharmony_ci   * x509_crt.key_usage changed from unsigned char to unsigned int.
4494a8e1175bSopenharmony_ci   * Removed r and s from ecdsa_context
4495a8e1175bSopenharmony_ci   * Removed mode from des_context and des3_context
4496a8e1175bSopenharmony_ci
4497a8e1175bSopenharmony_ciDefault behavior changes
4498a8e1175bSopenharmony_ci   * The default minimum TLS version is now TLS 1.0.
4499a8e1175bSopenharmony_ci   * RC4 is now blacklisted by default in the SSL/TLS layer, and excluded from the
4500a8e1175bSopenharmony_ci     default ciphersuite list returned by ssl_list_ciphersuites()
4501a8e1175bSopenharmony_ci   * Support for receiving SSLv2 ClientHello is now disabled by default at
4502a8e1175bSopenharmony_ci     compile time.
4503a8e1175bSopenharmony_ci   * The default authmode for SSL/TLS clients is now REQUIRED.
4504a8e1175bSopenharmony_ci   * Support for RSA_ALT contexts in the PK layer is now optional. Since is is
4505a8e1175bSopenharmony_ci     enabled in the default configuration, this is only noticeable if using a
4506a8e1175bSopenharmony_ci     custom config.h
4507a8e1175bSopenharmony_ci   * Default DHM parameters server-side upgraded from 1024 to 2048 bits.
4508a8e1175bSopenharmony_ci   * A minimum RSA key size of 2048 bits is now enforced during ceritificate
4509a8e1175bSopenharmony_ci     chain verification.
4510a8e1175bSopenharmony_ci   * Negotiation of truncated HMAC is now disabled by default on server too.
4511a8e1175bSopenharmony_ci   * The following functions are now case-sensitive:
4512a8e1175bSopenharmony_ci     mbedtls_cipher_info_from_string()
4513a8e1175bSopenharmony_ci     mbedtls_ecp_curve_info_from_name()
4514a8e1175bSopenharmony_ci     mbedtls_md_info_from_string()
4515a8e1175bSopenharmony_ci     mbedtls_ssl_ciphersuite_from_string()
4516a8e1175bSopenharmony_ci     mbedtls_version_check_feature()
4517a8e1175bSopenharmony_ci
4518a8e1175bSopenharmony_ciRequirement changes
4519a8e1175bSopenharmony_ci   * The minimum MSVC version required is now 2010 (better C99 support).
4520a8e1175bSopenharmony_ci   * The NET layer now unconditionnaly relies on getaddrinfo() and select().
4521a8e1175bSopenharmony_ci   * Compiler is required to support C99 types such as long long and uint32_t.
4522a8e1175bSopenharmony_ci
4523a8e1175bSopenharmony_ciAPI changes from the 1.4 preview branch
4524a8e1175bSopenharmony_ci   * ssl_set_bio_timeout() was removed, split into mbedtls_ssl_set_bio() with
4525a8e1175bSopenharmony_ci     new prototype, and mbedtls_ssl_set_read_timeout().
4526a8e1175bSopenharmony_ci   * The following functions now return void:
4527a8e1175bSopenharmony_ci     mbedtls_ssl_conf_transport()
4528a8e1175bSopenharmony_ci     mbedtls_ssl_conf_max_version()
4529a8e1175bSopenharmony_ci     mbedtls_ssl_conf_min_version()
4530a8e1175bSopenharmony_ci   * DTLS no longer hard-depends on TIMING_C, but uses a callback interface
4531a8e1175bSopenharmony_ci     instead, see mbedtls_ssl_set_timer_cb(), with the Timing module providing
4532a8e1175bSopenharmony_ci     an example implementation, see mbedtls_timing_delay_context and
4533a8e1175bSopenharmony_ci     mbedtls_timing_set/get_delay().
4534a8e1175bSopenharmony_ci   * With UDP sockets, it is no longer necessary to call net_bind() again
4535a8e1175bSopenharmony_ci     after a successful net_accept().
4536a8e1175bSopenharmony_ci
4537a8e1175bSopenharmony_ciChanges
4538a8e1175bSopenharmony_ci   * mbedtls_ctr_drbg_random() and mbedtls_hmac_drbg_random() are now
4539a8e1175bSopenharmony_ci     thread-safe if MBEDTLS_THREADING_C is enabled.
4540a8e1175bSopenharmony_ci   * Reduced ROM fooprint of SHA-256 and added an option to reduce it even
4541a8e1175bSopenharmony_ci     more (at the expense of performance) MBEDTLS_SHA256_SMALLER.
4542a8e1175bSopenharmony_ci
4543a8e1175bSopenharmony_ci= mbed TLS 1.3 branch
4544a8e1175bSopenharmony_ci
4545a8e1175bSopenharmony_ciSecurity
4546a8e1175bSopenharmony_ci   * With authmode set to SSL_VERIFY_OPTIONAL, verification of keyUsage and
4547a8e1175bSopenharmony_ci     extendedKeyUsage on the leaf certificate was lost (results not accessible
4548a8e1175bSopenharmony_ci     via ssl_get_verify_results()).
4549a8e1175bSopenharmony_ci   * Add countermeasure against "Lucky 13 strikes back" cache-based attack,
4550a8e1175bSopenharmony_ci     https://dl.acm.org/citation.cfm?id=2714625
4551a8e1175bSopenharmony_ci
4552a8e1175bSopenharmony_ciFeatures
4553a8e1175bSopenharmony_ci   * Improve ECC performance by using more efficient doubling formulas
4554a8e1175bSopenharmony_ci     (contributed by Peter Dettman).
4555a8e1175bSopenharmony_ci   * Add x509_crt_verify_info() to display certificate verification results.
4556a8e1175bSopenharmony_ci   * Add support for reading DH parameters with privateValueLength included
4557a8e1175bSopenharmony_ci     (contributed by Daniel Kahn Gillmor).
4558a8e1175bSopenharmony_ci   * Add support for bit strings in X.509 names (request by Fredrik Axelsson).
4559a8e1175bSopenharmony_ci   * Add support for id-at-uniqueIdentifier in X.509 names.
4560a8e1175bSopenharmony_ci   * Add support for overriding snprintf() (except on Windows) and exit() in
4561a8e1175bSopenharmony_ci     the platform layer.
4562a8e1175bSopenharmony_ci   * Add an option to use macros instead of function pointers in the platform
4563a8e1175bSopenharmony_ci     layer (helps get rid of unwanted references).
4564a8e1175bSopenharmony_ci   * Improved Makefiles for Windows targets by fixing library targets and making
4565a8e1175bSopenharmony_ci     cross-compilation easier (thanks to Alon Bar-Lev).
4566a8e1175bSopenharmony_ci   * The benchmark program also prints heap usage for public-key primitives
4567a8e1175bSopenharmony_ci     if POLARSSL_MEMORY_BUFFER_ALLOC_C and POLARSSL_MEMORY_DEBUG are defined.
4568a8e1175bSopenharmony_ci   * New script ecc-heap.sh helps measuring the impact of ECC parameters on
4569a8e1175bSopenharmony_ci     speed and RAM (heap only for now) usage.
4570a8e1175bSopenharmony_ci   * New script memory.sh helps measuring the ROM and RAM requirements of two
4571a8e1175bSopenharmony_ci     reduced configurations (PSK-CCM and NSA suite B).
4572a8e1175bSopenharmony_ci   * Add config flag POLARSSL_DEPRECATED_WARNING (off by default) to produce
4573a8e1175bSopenharmony_ci     warnings on use of deprecated functions (with GCC and Clang only).
4574a8e1175bSopenharmony_ci   * Add config flag POLARSSL_DEPRECATED_REMOVED (off by default) to produce
4575a8e1175bSopenharmony_ci     errors on use of deprecated functions.
4576a8e1175bSopenharmony_ci
4577a8e1175bSopenharmony_ciBugfix
4578a8e1175bSopenharmony_ci   * Fix compile errors with PLATFORM_NO_STD_FUNCTIONS.
4579a8e1175bSopenharmony_ci   * Fix compile error with PLATFORM_EXIT_ALT (thanks to Rafał Przywara).
4580a8e1175bSopenharmony_ci   * Fix bug in entropy.c when THREADING_C is also enabled that caused
4581a8e1175bSopenharmony_ci     entropy_free() to crash (thanks to Rafał Przywara).
4582a8e1175bSopenharmony_ci   * Fix memory leak when gcm_setkey() and ccm_setkey() are used more than
4583a8e1175bSopenharmony_ci     once on the same context.
4584a8e1175bSopenharmony_ci   * Fix bug in ssl_mail_client when password is longer that username (found
4585a8e1175bSopenharmony_ci     by Bruno Pape).
4586a8e1175bSopenharmony_ci   * Fix undefined behaviour (memcmp( NULL, NULL, 0 );) in X.509 modules
4587a8e1175bSopenharmony_ci     (detected by Clang's 3.6 UBSan).
4588a8e1175bSopenharmony_ci   * mpi_size() and mpi_msb() would segfault when called on an mpi that is
4589a8e1175bSopenharmony_ci     initialized but not set (found by pravic).
4590a8e1175bSopenharmony_ci   * Fix detection of support for getrandom() on Linux (reported by syzzer) by
4591a8e1175bSopenharmony_ci     doing it at runtime (using uname) rather that compile time.
4592a8e1175bSopenharmony_ci   * Fix handling of symlinks by "make install" (found by Gaël PORTAY).
4593a8e1175bSopenharmony_ci   * Fix potential NULL pointer dereference (not trigerrable remotely) when
4594a8e1175bSopenharmony_ci     ssl_write() is called before the handshake is finished (introduced in
4595a8e1175bSopenharmony_ci     1.3.10) (first reported by Martin Blumenstingl).
4596a8e1175bSopenharmony_ci   * Fix bug in pk_parse_key() that caused some valid private EC keys to be
4597a8e1175bSopenharmony_ci     rejected.
4598a8e1175bSopenharmony_ci   * Fix bug in Via Padlock support (found by Nikos Mavrogiannopoulos).
4599a8e1175bSopenharmony_ci   * Fix thread safety bug in RSA operations (found by Fredrik Axelsson).
4600a8e1175bSopenharmony_ci   * Fix hardclock() (only used in the benchmarking program) with some
4601a8e1175bSopenharmony_ci     versions of mingw64 (found by kxjhlele).
4602a8e1175bSopenharmony_ci   * Fix warnings from mingw64 in timing.c (found by kxjklele).
4603a8e1175bSopenharmony_ci   * Fix potential unintended sign extension in asn1_get_len() on 64-bit
4604a8e1175bSopenharmony_ci     platforms.
4605a8e1175bSopenharmony_ci   * Fix potential memory leak in ssl_set_psk() (found by Mansour Moufid).
4606a8e1175bSopenharmony_ci   * Fix compile error when POLARSSL_SSL_DISABLE_RENEGOTATION and
4607a8e1175bSopenharmony_ci     POLARSSL_SSL_SSESSION_TICKETS where both enabled in config.h (introduced
4608a8e1175bSopenharmony_ci     in 1.3.10).
4609a8e1175bSopenharmony_ci   * Add missing extern "C" guard in aesni.h (reported by amir zamani).
4610a8e1175bSopenharmony_ci   * Add missing dependency on SHA-256 in some x509 programs (reported by
4611a8e1175bSopenharmony_ci     Gergely Budai).
4612a8e1175bSopenharmony_ci   * Fix bug related to ssl_set_curves(): the client didn't check that the
4613a8e1175bSopenharmony_ci     curve picked by the server was actually allowed.
4614a8e1175bSopenharmony_ci
4615a8e1175bSopenharmony_ciChanges
4616a8e1175bSopenharmony_ci   * Remove bias in mpi_gen_prime (contributed by Pascal Junod).
4617a8e1175bSopenharmony_ci   * Remove potential sources of timing variations (some contributed by Pascal
4618a8e1175bSopenharmony_ci     Junod).
4619a8e1175bSopenharmony_ci   * Options POLARSSL_HAVE_INT8 and POLARSSL_HAVE_INT16 are deprecated.
4620a8e1175bSopenharmony_ci   * Enabling POLARSSL_NET_C without POLARSSL_HAVE_IPV6 is deprecated.
4621a8e1175bSopenharmony_ci   * compat-1.2.h and openssl.h are deprecated.
4622a8e1175bSopenharmony_ci   * Adjusting/overriding CFLAGS and LDFLAGS with the make build system is now
4623a8e1175bSopenharmony_ci     more flexible (warning: OFLAGS is not used any more) (see the README)
4624a8e1175bSopenharmony_ci     (contributed by Alon Bar-Lev).
4625a8e1175bSopenharmony_ci   * ssl_set_own_cert() no longer calls pk_check_pair() since the
4626a8e1175bSopenharmony_ci     performance impact was bad for some users (this was introduced in 1.3.10).
4627a8e1175bSopenharmony_ci   * Move from SHA-1 to SHA-256 in example programs using signatures
4628a8e1175bSopenharmony_ci     (suggested by Thorsten Mühlfelder).
4629a8e1175bSopenharmony_ci   * Remove some unneeded inclusions of header files from the standard library
4630a8e1175bSopenharmony_ci     "minimize" others (eg use stddef.h if only size_t is needed).
4631a8e1175bSopenharmony_ci   * Change #include lines in test files to use double quotes instead of angle
4632a8e1175bSopenharmony_ci     brackets for uniformity with the rest of the code.
4633a8e1175bSopenharmony_ci   * Remove dependency on sscanf() in X.509 parsing modules.
4634a8e1175bSopenharmony_ci
4635a8e1175bSopenharmony_ci= mbed TLS 1.3.10 released 2015-02-09
4636a8e1175bSopenharmony_ciSecurity
4637a8e1175bSopenharmony_ci   * NULL pointer dereference in the buffer-based allocator when the buffer is
4638a8e1175bSopenharmony_ci     full and polarssl_free() is called (found by Mark Hasemeyer)
4639a8e1175bSopenharmony_ci     (only possible if POLARSSL_MEMORY_BUFFER_ALLOC_C is enabled, which it is
4640a8e1175bSopenharmony_ci     not by default).
4641a8e1175bSopenharmony_ci   * Fix remotely-triggerable uninitialised pointer dereference caused by
4642a8e1175bSopenharmony_ci     crafted X.509 certificate (TLS server is not affected if it doesn't ask for a
4643a8e1175bSopenharmony_ci     client certificate) (found using Codenomicon Defensics).
4644a8e1175bSopenharmony_ci   * Fix remotely-triggerable memory leak caused by crafted X.509 certificates
4645a8e1175bSopenharmony_ci     (TLS server is not affected if it doesn't ask for a client certificate)
4646a8e1175bSopenharmony_ci     (found using Codenomicon Defensics).
4647a8e1175bSopenharmony_ci   * Fix potential stack overflow while parsing crafted X.509 certificates
4648a8e1175bSopenharmony_ci     (TLS server is not affected if it doesn't ask for a client certificate)
4649a8e1175bSopenharmony_ci     (found using Codenomicon Defensics).
4650a8e1175bSopenharmony_ci   * Fix timing difference that could theoretically lead to a
4651a8e1175bSopenharmony_ci     Bleichenbacher-style attack in the RSA and RSA-PSK key exchanges
4652a8e1175bSopenharmony_ci     (reported by Sebastian Schinzel).
4653a8e1175bSopenharmony_ci
4654a8e1175bSopenharmony_ciFeatures
4655a8e1175bSopenharmony_ci   * Add support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv).
4656a8e1175bSopenharmony_ci   * Add support for Extended Master Secret (draft-ietf-tls-session-hash).
4657a8e1175bSopenharmony_ci   * Add support for Encrypt-then-MAC (RFC 7366).
4658a8e1175bSopenharmony_ci   * Add function pk_check_pair() to test if public and private keys match.
4659a8e1175bSopenharmony_ci   * Add x509_crl_parse_der().
4660a8e1175bSopenharmony_ci   * Add compile-time option POLARSSL_X509_MAX_INTERMEDIATE_CA to limit the
4661a8e1175bSopenharmony_ci     length of an X.509 verification chain.
4662a8e1175bSopenharmony_ci   * Support for renegotiation can now be disabled at compile-time
4663a8e1175bSopenharmony_ci   * Support for 1/n-1 record splitting, a countermeasure against BEAST.
4664a8e1175bSopenharmony_ci   * Certificate selection based on signature hash, preferring SHA-1 over SHA-2
4665a8e1175bSopenharmony_ci     for pre-1.2 clients when multiple certificates are available.
4666a8e1175bSopenharmony_ci   * Add support for getrandom() syscall on recent Linux kernels with Glibc or
4667a8e1175bSopenharmony_ci     a compatible enough libc (eg uClibc).
4668a8e1175bSopenharmony_ci   * Add ssl_set_arc4_support() to make it easier to disable RC4 at runtime
4669a8e1175bSopenharmony_ci     while using the default ciphersuite list.
4670a8e1175bSopenharmony_ci   * Added new error codes and debug messages about selection of
4671a8e1175bSopenharmony_ci     ciphersuite/certificate.
4672a8e1175bSopenharmony_ci
4673a8e1175bSopenharmony_ciBugfix
4674a8e1175bSopenharmony_ci   * Stack buffer overflow if ctr_drbg_update() is called with too large
4675a8e1175bSopenharmony_ci     add_len (found by Jean-Philippe Aumasson) (not triggerable remotely).
4676a8e1175bSopenharmony_ci   * Possible buffer overflow of length at most POLARSSL_MEMORY_ALIGN_MULTIPLE
4677a8e1175bSopenharmony_ci     if memory_buffer_alloc_init() was called with buf not aligned and len not
4678a8e1175bSopenharmony_ci     a multiple of POLARSSL_MEMORY_ALIGN_MULTIPLE (not triggerable remotely).
4679a8e1175bSopenharmony_ci   * User set CFLAGS were ignored by Cmake with gcc (introduced in 1.3.9, found
4680a8e1175bSopenharmony_ci     by Julian Ospald).
4681a8e1175bSopenharmony_ci   * Fix potential undefined behaviour in Camellia.
4682a8e1175bSopenharmony_ci   * Fix potential failure in ECDSA signatures when POLARSSL_ECP_MAX_BITS is a
4683a8e1175bSopenharmony_ci     multiple of 8 (found by Gergely Budai).
4684a8e1175bSopenharmony_ci   * Fix unchecked return code in x509_crt_parse_path() on Windows (found by
4685a8e1175bSopenharmony_ci     Peter Vaskovic).
4686a8e1175bSopenharmony_ci   * Fix assembly selection for MIPS64 (thanks to James Cowgill).
4687a8e1175bSopenharmony_ci   * ssl_get_verify_result() now works even if the handshake was aborted due
4688a8e1175bSopenharmony_ci     to a failed verification (found by Fredrik Axelsson).
4689a8e1175bSopenharmony_ci   * Skip writing and parsing signature_algorithm extension if none of the
4690a8e1175bSopenharmony_ci     key exchanges enabled needs certificates. This fixes a possible interop
4691a8e1175bSopenharmony_ci     issue with some servers when a zero-length extension was sent. (Reported
4692a8e1175bSopenharmony_ci     by Peter Dettman.)
4693a8e1175bSopenharmony_ci   * On a 0-length input, base64_encode() did not correctly set output length
4694a8e1175bSopenharmony_ci     (found by Hendrik van den Boogaard).
4695a8e1175bSopenharmony_ci
4696a8e1175bSopenharmony_ciChanges
4697a8e1175bSopenharmony_ci   * Use deterministic nonces for AEAD ciphers in TLS by default (possible to
4698a8e1175bSopenharmony_ci     switch back to random with POLARSSL_SSL_AEAD_RANDOM_IV in config.h).
4699a8e1175bSopenharmony_ci   * Blind RSA private operations even when POLARSSL_RSA_NO_CRT is defined.
4700a8e1175bSopenharmony_ci   * ssl_set_own_cert() now returns an error on key-certificate mismatch.
4701a8e1175bSopenharmony_ci   * Forbid repeated extensions in X.509 certificates.
4702a8e1175bSopenharmony_ci   * debug_print_buf() now prints a text view in addition to hexadecimal.
4703a8e1175bSopenharmony_ci   * A specific error is now returned when there are ciphersuites in common
4704a8e1175bSopenharmony_ci     but none of them is usable due to external factors such as no certificate
4705a8e1175bSopenharmony_ci     with a suitable (extended)KeyUsage or curve or no PSK set.
4706a8e1175bSopenharmony_ci   * It is now possible to disable negotiation of truncated HMAC server-side
4707a8e1175bSopenharmony_ci     at runtime with ssl_set_truncated_hmac().
4708a8e1175bSopenharmony_ci   * Example programs for SSL client and server now disable SSLv3 by default.
4709a8e1175bSopenharmony_ci   * Example programs for SSL client and server now disable RC4 by default.
4710a8e1175bSopenharmony_ci   * Use platform.h in all test suites and programs.
4711a8e1175bSopenharmony_ci
4712a8e1175bSopenharmony_ci= PolarSSL 1.3.9 released 2014-10-20
4713a8e1175bSopenharmony_ciSecurity
4714a8e1175bSopenharmony_ci   * Lowest common hash was selected from signature_algorithms extension in
4715a8e1175bSopenharmony_ci     TLS 1.2 (found by Darren Bane) (introduced in 1.3.8).
4716a8e1175bSopenharmony_ci   * Remotely-triggerable memory leak when parsing some X.509 certificates
4717a8e1175bSopenharmony_ci     (server is not affected if it doesn't ask for a client certificate)
4718a8e1175bSopenharmony_ci     (found using Codenomicon Defensics).
4719a8e1175bSopenharmony_ci   * Remotely-triggerable memory leak when parsing crafted ClientHello
4720a8e1175bSopenharmony_ci     (not affected if ECC support was compiled out) (found using Codenomicon
4721a8e1175bSopenharmony_ci     Defensics).
4722a8e1175bSopenharmony_ci
4723a8e1175bSopenharmony_ciBugfix
4724a8e1175bSopenharmony_ci   * Support escaping of commas in x509_string_to_names()
4725a8e1175bSopenharmony_ci   * Fix compile error in ssl_pthread_server (found by Julian Ospald).
4726a8e1175bSopenharmony_ci   * Fix net_accept() regarding non-blocking sockets (found by Luca Pesce).
4727a8e1175bSopenharmony_ci   * Don't print uninitialised buffer in ssl_mail_client (found by Marc Abel).
4728a8e1175bSopenharmony_ci   * Fix warnings from Clang's scan-build (contributed by Alfred Klomp).
4729a8e1175bSopenharmony_ci   * Fix compile error in timing.c when POLARSSL_NET_C and POLARSSL_SELFTEST
4730a8e1175bSopenharmony_ci     are defined but not POLARSSL_HAVE_TIME (found by Stephane Di Vito).
4731a8e1175bSopenharmony_ci   * Remove non-existent file from VS projects (found by Peter Vaskovic).
4732a8e1175bSopenharmony_ci   * ssl_read() could return non-application data records on server while
4733a8e1175bSopenharmony_ci     renegotation was pending, and on client when a HelloRequest was received.
4734a8e1175bSopenharmony_ci   * Server-initiated renegotiation would fail with non-blocking I/O if the
4735a8e1175bSopenharmony_ci     write callback returned WANT_WRITE when requesting renegotiation.
4736a8e1175bSopenharmony_ci   * ssl_close_notify() could send more than one message in some circumstances
4737a8e1175bSopenharmony_ci     with non-blocking I/O.
4738a8e1175bSopenharmony_ci   * Fix compiler warnings on iOS (found by Sander Niemeijer).
4739a8e1175bSopenharmony_ci   * x509_crt_parse() did not increase total_failed on PEM error
4740a8e1175bSopenharmony_ci   * Fix compile error with armcc in mpi_is_prime()
4741a8e1175bSopenharmony_ci   * Fix potential bad read in parsing ServerHello (found by Adrien
4742a8e1175bSopenharmony_ci     Vialletelle).
4743a8e1175bSopenharmony_ci
4744a8e1175bSopenharmony_ciChanges
4745a8e1175bSopenharmony_ci   * Ciphersuites using SHA-256 or SHA-384 now require TLS 1.x (there is no
4746a8e1175bSopenharmony_ci     standard defining how to use SHA-2 with SSL 3.0).
4747a8e1175bSopenharmony_ci   * Ciphersuites using RSA-PSK key exchange new require TLS 1.x (the spec is
4748a8e1175bSopenharmony_ci     ambiguous on how to encode some packets with SSL 3.0).
4749a8e1175bSopenharmony_ci   * Made buffer size in pk_write_(pub)key_pem() more dynamic, eg smaller if
4750a8e1175bSopenharmony_ci     RSA is disabled, larger if POLARSSL_MPI_MAX_SIZE is larger.
4751a8e1175bSopenharmony_ci   * ssl_read() now returns POLARSSL_ERR_NET_WANT_READ rather than
4752a8e1175bSopenharmony_ci     POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE on harmless alerts.
4753a8e1175bSopenharmony_ci   * POLARSSL_MPI_MAX_SIZE now defaults to 1024 in order to allow 8192 bits
4754a8e1175bSopenharmony_ci     RSA keys.
4755a8e1175bSopenharmony_ci   * Accept spaces at end of line or end of buffer in base64_decode().
4756a8e1175bSopenharmony_ci   * X.509 certificates with more than one AttributeTypeAndValue per
4757a8e1175bSopenharmony_ci     RelativeDistinguishedName are not accepted any more.
4758a8e1175bSopenharmony_ci
4759a8e1175bSopenharmony_ci= PolarSSL 1.3.8 released 2014-07-11
4760a8e1175bSopenharmony_ciSecurity
4761a8e1175bSopenharmony_ci   * Fix length checking for AEAD ciphersuites (found by Codenomicon).
4762a8e1175bSopenharmony_ci     It was possible to crash the server (and client) using crafted messages
4763a8e1175bSopenharmony_ci     when a GCM suite was chosen.
4764a8e1175bSopenharmony_ci
4765a8e1175bSopenharmony_ciFeatures
4766a8e1175bSopenharmony_ci   * Add CCM module and cipher mode to Cipher Layer
4767a8e1175bSopenharmony_ci   * Support for CCM and CCM_8 ciphersuites
4768a8e1175bSopenharmony_ci   * Support for parsing and verifying RSASSA-PSS signatures in the X.509
4769a8e1175bSopenharmony_ci     modules (certificates, CRLs and CSRs).
4770a8e1175bSopenharmony_ci   * Blowfish in the cipher layer now supports variable length keys.
4771a8e1175bSopenharmony_ci   * Add example config.h for PSK with CCM, optimized for low RAM usage.
4772a8e1175bSopenharmony_ci   * Optimize for RAM usage in example config.h for NSA Suite B profile.
4773a8e1175bSopenharmony_ci   * Add POLARSSL_REMOVE_ARC4_CIPHERSUITES to allow removing RC4 ciphersuites
4774a8e1175bSopenharmony_ci     from the default list (inactive by default).
4775a8e1175bSopenharmony_ci   * Add server-side enforcement of sent renegotiation requests
4776a8e1175bSopenharmony_ci     (ssl_set_renegotiation_enforced())
4777a8e1175bSopenharmony_ci   * Add SSL_CIPHERSUITES config.h flag to allow specifying a list of
4778a8e1175bSopenharmony_ci     ciphersuites to use and save some memory if the list is small.
4779a8e1175bSopenharmony_ci
4780a8e1175bSopenharmony_ciChanges
4781a8e1175bSopenharmony_ci   * Add LINK_WITH_PTHREAD option in CMake for explicit linking that is
4782a8e1175bSopenharmony_ci     required on some platforms (e.g. OpenBSD)
4783a8e1175bSopenharmony_ci   * Migrate zeroizing of data to polarssl_zeroize() instead of memset()
4784a8e1175bSopenharmony_ci     against unwanted compiler optimizations
4785a8e1175bSopenharmony_ci   * md_list() now returns hashes strongest first
4786a8e1175bSopenharmony_ci   * Selection of hash for signing ServerKeyExchange in TLS 1.2 now picks
4787a8e1175bSopenharmony_ci     strongest offered by client.
4788a8e1175bSopenharmony_ci   * All public contexts have _init() and _free() functions now for simpler
4789a8e1175bSopenharmony_ci     usage pattern
4790a8e1175bSopenharmony_ci
4791a8e1175bSopenharmony_ciBugfix
4792a8e1175bSopenharmony_ci   * Fix in debug_print_msg()
4793a8e1175bSopenharmony_ci   * Enforce alignment in the buffer allocator even if buffer is not aligned
4794a8e1175bSopenharmony_ci   * Remove less-than-zero checks on unsigned numbers
4795a8e1175bSopenharmony_ci   * Stricter check on SSL ClientHello internal sizes compared to actual packet
4796a8e1175bSopenharmony_ci     size (found by TrustInSoft)
4797a8e1175bSopenharmony_ci   * Fix WSAStartup() return value check (found by Peter Vaskovic)
4798a8e1175bSopenharmony_ci   * Other minor issues (found by Peter Vaskovic)
4799a8e1175bSopenharmony_ci   * Fix symlink command for cross compiling with CMake (found by Andre
4800a8e1175bSopenharmony_ci     Heinecke)
4801a8e1175bSopenharmony_ci   * Fix DER output of gen_key app (found by Gergely Budai)
4802a8e1175bSopenharmony_ci   * Very small records were incorrectly rejected when truncated HMAC was in
4803a8e1175bSopenharmony_ci     use with some ciphersuites and versions (RC4 in all versions, CBC with
4804a8e1175bSopenharmony_ci     versions < TLS 1.1).
4805a8e1175bSopenharmony_ci   * Very large records using more than 224 bytes of padding were incorrectly
4806a8e1175bSopenharmony_ci     rejected with CBC-based ciphersuites and TLS >= 1.1
4807a8e1175bSopenharmony_ci   * Very large records using less padding could cause a buffer overread of up
4808a8e1175bSopenharmony_ci     to 32 bytes with CBC-based ciphersuites and TLS >= 1.1
4809a8e1175bSopenharmony_ci   * Restore ability to use a v1 cert as a CA if trusted locally. (This had
4810a8e1175bSopenharmony_ci     been removed in 1.3.6.)
4811a8e1175bSopenharmony_ci   * Restore ability to locally trust a self-signed cert that is not a proper
4812a8e1175bSopenharmony_ci     CA for use as an end entity certificate. (This had been removed in
4813a8e1175bSopenharmony_ci     1.3.6.)
4814a8e1175bSopenharmony_ci   * Fix preprocessor checks for bn_mul PPC asm (found by Barry K. Nathan).
4815a8e1175bSopenharmony_ci   * Use \n\t rather than semicolons for bn_mul asm, since some assemblers
4816a8e1175bSopenharmony_ci     interpret semicolons as comment delimiters (found by Barry K. Nathan).
4817a8e1175bSopenharmony_ci   * Fix off-by-one error in parsing Supported Point Format extension that
4818a8e1175bSopenharmony_ci     caused some handshakes to fail.
4819a8e1175bSopenharmony_ci   * Fix possible miscomputation of the premaster secret with DHE-PSK key
4820a8e1175bSopenharmony_ci     exchange that caused some handshakes to fail with other implementations.
4821a8e1175bSopenharmony_ci     (Failure rate <= 1/255 with common DHM moduli.)
4822a8e1175bSopenharmony_ci   * Disable broken Sparc64 bn_mul assembly (found by Florian Obser).
4823a8e1175bSopenharmony_ci   * Fix base64_decode() to return and check length correctly (in case of
4824a8e1175bSopenharmony_ci     tight buffers)
4825a8e1175bSopenharmony_ci   * Fix mpi_write_string() to write "00" as hex output for empty MPI (found
4826a8e1175bSopenharmony_ci     by Hui Dong)
4827a8e1175bSopenharmony_ci
4828a8e1175bSopenharmony_ci= PolarSSL 1.3.7 released on 2014-05-02
4829a8e1175bSopenharmony_ciFeatures
4830a8e1175bSopenharmony_ci   * debug_set_log_mode() added to determine raw or full logging
4831a8e1175bSopenharmony_ci   * debug_set_threshold() added to ignore messages over threshold level
4832a8e1175bSopenharmony_ci   * version_check_feature() added to check for compile-time options at
4833a8e1175bSopenharmony_ci     run-time
4834a8e1175bSopenharmony_ci
4835a8e1175bSopenharmony_ciChanges
4836a8e1175bSopenharmony_ci   * POLARSSL_CONFIG_OPTIONS has been removed. All values are individually
4837a8e1175bSopenharmony_ci     checked and filled in the relevant module headers
4838a8e1175bSopenharmony_ci   * Debug module only outputs full lines instead of parts
4839a8e1175bSopenharmony_ci   * Better support for the different Attribute Types from IETF PKIX (RFC 5280)
4840a8e1175bSopenharmony_ci   * AES-NI now compiles with "old" assemblers too
4841a8e1175bSopenharmony_ci   * Ciphersuites based on RC4 now have the lowest priority by default
4842a8e1175bSopenharmony_ci
4843a8e1175bSopenharmony_ciBugfix
4844a8e1175bSopenharmony_ci   * Only iterate over actual certificates in ssl_write_certificate_request()
4845a8e1175bSopenharmony_ci     (found by Matthew Page)
4846a8e1175bSopenharmony_ci   * Typos in platform.c and pkcs11.c (found by Daniel Phillips and Steffan
4847a8e1175bSopenharmony_ci     Karger)
4848a8e1175bSopenharmony_ci   * cert_write app should use subject of issuer certificate as issuer of cert
4849a8e1175bSopenharmony_ci   * Fix false reject in padding check in ssl_decrypt_buf() for CBC
4850a8e1175bSopenharmony_ci     ciphersuites, for full SSL frames of data.
4851a8e1175bSopenharmony_ci   * Improve interoperability by not writing extension length in ClientHello /
4852a8e1175bSopenharmony_ci     ServerHello when no extensions are present (found by Matthew Page)
4853a8e1175bSopenharmony_ci   * rsa_check_pubkey() now allows an E up to N
4854a8e1175bSopenharmony_ci   * On OpenBSD, use arc4random_buf() instead of rand() to prevent warnings
4855a8e1175bSopenharmony_ci   * mpi_fill_random() was creating numbers larger than requested on
4856a8e1175bSopenharmony_ci     big-endian platform when size was not an integer number of limbs
4857a8e1175bSopenharmony_ci   * Fix dependencies issues in X.509 test suite.
4858a8e1175bSopenharmony_ci   * Some parts of ssl_tls.c were compiled even when the module was disabled.
4859a8e1175bSopenharmony_ci   * Fix detection of DragonflyBSD in net.c (found by Markus Pfeiffer)
4860a8e1175bSopenharmony_ci   * Fix detection of Clang on some Apple platforms with CMake
4861a8e1175bSopenharmony_ci     (found by Barry K. Nathan)
4862a8e1175bSopenharmony_ci
4863a8e1175bSopenharmony_ci= PolarSSL 1.3.6 released on 2014-04-11
4864a8e1175bSopenharmony_ci
4865a8e1175bSopenharmony_ciFeatures
4866a8e1175bSopenharmony_ci   * Support for the ALPN SSL extension
4867a8e1175bSopenharmony_ci   * Add option 'use_dev_random' to gen_key application
4868a8e1175bSopenharmony_ci   * Enable verification of the keyUsage extension for CA and leaf
4869a8e1175bSopenharmony_ci     certificates (POLARSSL_X509_CHECK_KEY_USAGE)
4870a8e1175bSopenharmony_ci   * Enable verification of the extendedKeyUsage extension
4871a8e1175bSopenharmony_ci     (POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE)
4872a8e1175bSopenharmony_ci
4873a8e1175bSopenharmony_ciChanges
4874a8e1175bSopenharmony_ci   * x509_crt_info() now prints information about parsed extensions as well
4875a8e1175bSopenharmony_ci   * pk_verify() now returns a specific error code when the signature is valid
4876a8e1175bSopenharmony_ci     but shorter than the supplied length.
4877a8e1175bSopenharmony_ci   * Use UTC time to check certificate validity.
4878a8e1175bSopenharmony_ci   * Reject certificates with times not in UTC, per RFC 5280.
4879a8e1175bSopenharmony_ci
4880a8e1175bSopenharmony_ciSecurity
4881a8e1175bSopenharmony_ci   * Avoid potential timing leak in ecdsa_sign() by blinding modular division.
4882a8e1175bSopenharmony_ci     (Found by Watson Ladd.)
4883a8e1175bSopenharmony_ci   * The notAfter date of some certificates was no longer checked since 1.3.5.
4884a8e1175bSopenharmony_ci     This affects certificates in the user-supplied chain except the top
4885a8e1175bSopenharmony_ci     certificate. If the user-supplied chain contains only one certificates,
4886a8e1175bSopenharmony_ci     it is not affected (ie, its notAfter date is properly checked).
4887a8e1175bSopenharmony_ci   * Prevent potential NULL pointer dereference in ssl_read_record() (found by
4888a8e1175bSopenharmony_ci     TrustInSoft)
4889a8e1175bSopenharmony_ci
4890a8e1175bSopenharmony_ciBugfix
4891a8e1175bSopenharmony_ci   * The length of various ClientKeyExchange messages was not properly checked.
4892a8e1175bSopenharmony_ci   * Some example server programs were not sending the close_notify alert.
4893a8e1175bSopenharmony_ci   * Potential memory leak in mpi_exp_mod() when error occurs during
4894a8e1175bSopenharmony_ci     calculation of RR.
4895a8e1175bSopenharmony_ci   * Fixed malloc/free default #define in platform.c (found by Gergely Budai).
4896a8e1175bSopenharmony_ci   * Fixed type which made POLARSSL_ENTROPY_FORCE_SHA256 uneffective (found by
4897a8e1175bSopenharmony_ci     Gergely Budai).
4898a8e1175bSopenharmony_ci   * Fix #include path in ecdsa.h which wasn't accepted by some compilers.
4899a8e1175bSopenharmony_ci     (found by Gergely Budai)
4900a8e1175bSopenharmony_ci   * Fix compile errors when POLARSSL_ERROR_STRERROR_BC is undefined (found by
4901a8e1175bSopenharmony_ci     Shuo Chen).
4902a8e1175bSopenharmony_ci   * oid_get_numeric_string() used to truncate the output without returning an
4903a8e1175bSopenharmony_ci     error if the output buffer was just 1 byte too small.
4904a8e1175bSopenharmony_ci   * dhm_parse_dhm() (hence dhm_parse_dhmfile()) did not set dhm->len.
4905a8e1175bSopenharmony_ci   * Calling pk_debug() on an RSA-alt key would segfault.
4906a8e1175bSopenharmony_ci   * pk_get_size() and pk_get_len() were off by a factor 8 for RSA-alt keys.
4907a8e1175bSopenharmony_ci   * Potential buffer overwrite in pem_write_buffer() because of low length
4908a8e1175bSopenharmony_ci     indication (found by Thijs Alkemade)
4909a8e1175bSopenharmony_ci   * EC curves constants, which should be only in ROM since 1.3.3, were also
4910a8e1175bSopenharmony_ci     stored in RAM due to missing 'const's (found by Gergely Budai).
4911a8e1175bSopenharmony_ci
4912a8e1175bSopenharmony_ci= PolarSSL 1.3.5 released on 2014-03-26
4913a8e1175bSopenharmony_ciFeatures
4914a8e1175bSopenharmony_ci   * HMAC-DRBG as a separate module
4915a8e1175bSopenharmony_ci   * Option to set the Curve preference order (disabled by default)
4916a8e1175bSopenharmony_ci   * Single Platform compatilibity layer (for memory / printf / fprintf)
4917a8e1175bSopenharmony_ci   * Ability to provide alternate timing implementation
4918a8e1175bSopenharmony_ci   * Ability to force the entropy module to use SHA-256 as its basis
4919a8e1175bSopenharmony_ci     (POLARSSL_ENTROPY_FORCE_SHA256)
4920a8e1175bSopenharmony_ci   * Testing script ssl-opt.sh added for testing 'live' ssl option
4921a8e1175bSopenharmony_ci     interoperability against OpenSSL and PolarSSL
4922a8e1175bSopenharmony_ci   * Support for reading EC keys that use SpecifiedECDomain in some cases.
4923a8e1175bSopenharmony_ci   * Entropy module now supports seed writing and reading
4924a8e1175bSopenharmony_ci
4925a8e1175bSopenharmony_ciChanges
4926a8e1175bSopenharmony_ci   * Deprecated the Memory layer
4927a8e1175bSopenharmony_ci   * entropy_add_source(), entropy_update_manual() and entropy_gather()
4928a8e1175bSopenharmony_ci     now thread-safe if POLARSSL_THREADING_C defined
4929a8e1175bSopenharmony_ci   * Improvements to the CMake build system, contributed by Julian Ospald.
4930a8e1175bSopenharmony_ci   * Work around a bug of the version of Clang shipped by Apple with Mavericks
4931a8e1175bSopenharmony_ci     that prevented bignum.c from compiling. (Reported by Rafael Baptista.)
4932a8e1175bSopenharmony_ci   * Revamped the compat.sh interoperatibility script to include support for
4933a8e1175bSopenharmony_ci     testing against GnuTLS
4934a8e1175bSopenharmony_ci   * Deprecated ssl_set_own_cert_rsa() and ssl_set_own_cert_rsa_alt()
4935a8e1175bSopenharmony_ci   * Improvements to tests/Makefile, contributed by Oden Eriksson.
4936a8e1175bSopenharmony_ci
4937a8e1175bSopenharmony_ciSecurity
4938a8e1175bSopenharmony_ci   * Forbid change of server certificate during renegotiation to prevent
4939a8e1175bSopenharmony_ci     "triple handshake" attack when authentication mode is 'optional' (the
4940a8e1175bSopenharmony_ci     attack was already impossible when authentication is required).
4941a8e1175bSopenharmony_ci   * Check notBefore timestamp of certificates and CRLs from the future.
4942a8e1175bSopenharmony_ci   * Forbid sequence number wrapping
4943a8e1175bSopenharmony_ci   * Fixed possible buffer overflow with overlong PSK
4944a8e1175bSopenharmony_ci   * Possible remotely-triggered out-of-bounds memory access fixed (found by
4945a8e1175bSopenharmony_ci     TrustInSoft)
4946a8e1175bSopenharmony_ci
4947a8e1175bSopenharmony_ciBugfix
4948a8e1175bSopenharmony_ci   * ecp_gen_keypair() does more tries to prevent failure because of
4949a8e1175bSopenharmony_ci     statistics
4950a8e1175bSopenharmony_ci   * Fixed bug in RSA PKCS#1 v1.5 "reversed" operations
4951a8e1175bSopenharmony_ci   * Fixed testing with out-of-source builds using cmake
4952a8e1175bSopenharmony_ci   * Fixed version-major intolerance in server
4953a8e1175bSopenharmony_ci   * Fixed CMake symlinking on out-of-source builds
4954a8e1175bSopenharmony_ci   * Fixed dependency issues in test suite
4955a8e1175bSopenharmony_ci   * Programs rsa_sign_pss and rsa_verify_pss were not using PSS since 1.3.0
4956a8e1175bSopenharmony_ci   * Bignum's MIPS-32 assembly was used on MIPS-64, causing chaos. (Found by
4957a8e1175bSopenharmony_ci     Alex Wilson.)
4958a8e1175bSopenharmony_ci   * ssl_cache was creating entries when max_entries=0 if TIMING_C was enabled.
4959a8e1175bSopenharmony_ci   * m_sleep() was sleeping twice too long on most Unix platforms.
4960a8e1175bSopenharmony_ci   * Fixed bug with session tickets and non-blocking I/O in the unlikely case
4961a8e1175bSopenharmony_ci     send() would return an EAGAIN error when sending the ticket.
4962a8e1175bSopenharmony_ci   * ssl_cache was leaking memory when reusing a timed out entry containing a
4963a8e1175bSopenharmony_ci     client certificate.
4964a8e1175bSopenharmony_ci   * ssl_srv was leaking memory when client presented a timed out ticket
4965a8e1175bSopenharmony_ci     containing a client certificate
4966a8e1175bSopenharmony_ci   * ssl_init() was leaving a dirty pointer in ssl_context if malloc of
4967a8e1175bSopenharmony_ci     out_ctr failed
4968a8e1175bSopenharmony_ci   * ssl_handshake_init() was leaving dirty pointers in subcontexts if malloc
4969a8e1175bSopenharmony_ci     of one of them failed
4970a8e1175bSopenharmony_ci   * Fix typo in rsa_copy() that impacted PKCS#1 v2 contexts
4971a8e1175bSopenharmony_ci   * x509_get_current_time() uses localtime_r() to prevent thread issues
4972a8e1175bSopenharmony_ci
4973a8e1175bSopenharmony_ci= PolarSSL 1.3.4 released on 2014-01-27
4974a8e1175bSopenharmony_ciFeatures
4975a8e1175bSopenharmony_ci   * Support for the Koblitz curves: secp192k1, secp224k1, secp256k1
4976a8e1175bSopenharmony_ci   * Support for RIPEMD-160
4977a8e1175bSopenharmony_ci   * Support for AES CFB8 mode
4978a8e1175bSopenharmony_ci   * Support for deterministic ECDSA (RFC 6979)
4979a8e1175bSopenharmony_ci
4980a8e1175bSopenharmony_ciBugfix
4981a8e1175bSopenharmony_ci   * Potential memory leak in bignum_selftest()
4982a8e1175bSopenharmony_ci   * Replaced expired test certificate
4983a8e1175bSopenharmony_ci   * ssl_mail_client now terminates lines with CRLF, instead of LF
4984a8e1175bSopenharmony_ci   * net module handles timeouts on blocking sockets better (found by Tilman
4985a8e1175bSopenharmony_ci     Sauerbeck)
4986a8e1175bSopenharmony_ci   * Assembly format fixes in bn_mul.h
4987a8e1175bSopenharmony_ci
4988a8e1175bSopenharmony_ciSecurity
4989a8e1175bSopenharmony_ci   * Missing MPI_CHK calls added around unguarded mpi calls (found by
4990a8e1175bSopenharmony_ci     TrustInSoft)
4991a8e1175bSopenharmony_ci
4992a8e1175bSopenharmony_ci= PolarSSL 1.3.3 released on 2013-12-31
4993a8e1175bSopenharmony_ciFeatures
4994a8e1175bSopenharmony_ci   * EC key generation support in gen_key app
4995a8e1175bSopenharmony_ci   * Support for adhering to client ciphersuite order preference
4996a8e1175bSopenharmony_ci     (POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE)
4997a8e1175bSopenharmony_ci   * Support for Curve25519
4998a8e1175bSopenharmony_ci   * Support for ECDH-RSA and ECDH-ECDSA key exchanges and ciphersuites
4999a8e1175bSopenharmony_ci   * Support for IPv6 in the NET module
5000a8e1175bSopenharmony_ci   * AES-NI support for AES, AES-GCM and AES key scheduling
5001a8e1175bSopenharmony_ci   * SSL Pthread-based server example added (ssl_pthread_server)
5002a8e1175bSopenharmony_ci
5003a8e1175bSopenharmony_ciChanges
5004a8e1175bSopenharmony_ci   * gen_prime() speedup
5005a8e1175bSopenharmony_ci   * Speedup of ECP multiplication operation
5006a8e1175bSopenharmony_ci   * Relaxed some SHA2 ciphersuite's version requirements
5007a8e1175bSopenharmony_ci   * Dropped use of readdir_r() instead of readdir() with threading support
5008a8e1175bSopenharmony_ci   * More constant-time checks in the RSA module
5009a8e1175bSopenharmony_ci   * Split off curves from ecp.c into ecp_curves.c
5010a8e1175bSopenharmony_ci   * Curves are now stored fully in ROM
5011a8e1175bSopenharmony_ci   * Memory usage optimizations in ECP module
5012a8e1175bSopenharmony_ci   * Removed POLARSSL_THREADING_DUMMY
5013a8e1175bSopenharmony_ci
5014a8e1175bSopenharmony_ciBugfix
5015a8e1175bSopenharmony_ci   * Fixed bug in mpi_set_bit() on platforms where t_uint is wider than int
5016a8e1175bSopenharmony_ci   * Fixed X.509 hostname comparison (with non-regular characters)
5017a8e1175bSopenharmony_ci   * SSL now gracefully handles missing RNG
5018a8e1175bSopenharmony_ci   * Missing defines / cases for RSA_PSK key exchange
5019a8e1175bSopenharmony_ci   * crypt_and_hash app checks MAC before final decryption
5020a8e1175bSopenharmony_ci   * Potential memory leak in ssl_ticket_keys_init()
5021a8e1175bSopenharmony_ci   * Memory leak in benchmark application
5022a8e1175bSopenharmony_ci   * Fixed x509_crt_parse_path() bug on Windows platforms
5023a8e1175bSopenharmony_ci   * Added missing MPI_CHK() around some statements in mpi_div_mpi() (found by
5024a8e1175bSopenharmony_ci     TrustInSoft)
5025a8e1175bSopenharmony_ci   * Fixed potential overflow in certificate size verification in
5026a8e1175bSopenharmony_ci     ssl_write_certificate() (found by TrustInSoft)
5027a8e1175bSopenharmony_ci
5028a8e1175bSopenharmony_ciSecurity
5029a8e1175bSopenharmony_ci   * Possible remotely-triggered out-of-bounds memory access fixed (found by
5030a8e1175bSopenharmony_ci     TrustInSoft)
5031a8e1175bSopenharmony_ci
5032a8e1175bSopenharmony_ci= PolarSSL 1.3.2 released on 2013-11-04
5033a8e1175bSopenharmony_ciFeatures
5034a8e1175bSopenharmony_ci   * PK tests added to test framework
5035a8e1175bSopenharmony_ci   * Added optional optimization for NIST MODP curves (POLARSSL_ECP_NIST_OPTIM)
5036a8e1175bSopenharmony_ci   * Support for Camellia-GCM mode and ciphersuites
5037a8e1175bSopenharmony_ci
5038a8e1175bSopenharmony_ciChanges
5039a8e1175bSopenharmony_ci   * Padding checks in cipher layer are now constant-time
5040a8e1175bSopenharmony_ci   * Value comparisons in SSL layer are now constant-time
5041a8e1175bSopenharmony_ci   * Support for serialNumber, postalAddress and postalCode in X509 names
5042a8e1175bSopenharmony_ci   * SSL Renegotiation was refactored
5043a8e1175bSopenharmony_ci
5044a8e1175bSopenharmony_ciBugfix
5045a8e1175bSopenharmony_ci   * More stringent checks in cipher layer
5046a8e1175bSopenharmony_ci   * Server does not send out extensions not advertised by client
5047a8e1175bSopenharmony_ci   * Prevent possible alignment warnings on casting from char * to 'aligned *'
5048a8e1175bSopenharmony_ci   * Misc fixes and additions to dependency checks
5049a8e1175bSopenharmony_ci   * Const correctness
5050a8e1175bSopenharmony_ci   * cert_write with selfsign should use issuer_name as subject_name
5051a8e1175bSopenharmony_ci   * Fix ECDSA corner case: missing reduction mod N (found by DualTachyon)
5052a8e1175bSopenharmony_ci   * Defines to handle UEFI environment under MSVC
5053a8e1175bSopenharmony_ci   * Server-side initiated renegotiations send HelloRequest
5054a8e1175bSopenharmony_ci
5055a8e1175bSopenharmony_ci= PolarSSL 1.3.1 released on 2013-10-15
5056a8e1175bSopenharmony_ciFeatures
5057a8e1175bSopenharmony_ci   * Support for Brainpool curves and TLS ciphersuites (RFC 7027)
5058a8e1175bSopenharmony_ci   * Support for ECDHE-PSK key-exchange and ciphersuites
5059a8e1175bSopenharmony_ci   * Support for RSA-PSK key-exchange and ciphersuites
5060a8e1175bSopenharmony_ci
5061a8e1175bSopenharmony_ciChanges
5062a8e1175bSopenharmony_ci   * RSA blinding locks for a smaller amount of time
5063a8e1175bSopenharmony_ci   * TLS compression only allocates working buffer once
5064a8e1175bSopenharmony_ci   * Introduced POLARSSL_HAVE_READDIR_R for systems without it
5065a8e1175bSopenharmony_ci   * config.h is more script-friendly
5066a8e1175bSopenharmony_ci
5067a8e1175bSopenharmony_ciBugfix
5068a8e1175bSopenharmony_ci   * Missing MSVC defines added
5069a8e1175bSopenharmony_ci   * Compile errors with POLARSSL_RSA_NO_CRT
5070a8e1175bSopenharmony_ci   * Header files with 'polarssl/'
5071a8e1175bSopenharmony_ci   * Const correctness
5072a8e1175bSopenharmony_ci   * Possible naming collision in dhm_context
5073a8e1175bSopenharmony_ci   * Better support for MSVC
5074a8e1175bSopenharmony_ci   * threading_set_alt() name
5075a8e1175bSopenharmony_ci   * Added missing x509write_crt_set_version()
5076a8e1175bSopenharmony_ci
5077a8e1175bSopenharmony_ci= PolarSSL 1.3.0 released on 2013-10-01
5078a8e1175bSopenharmony_ciFeatures
5079a8e1175bSopenharmony_ci   * Elliptic Curve Cryptography module added
5080a8e1175bSopenharmony_ci   * Elliptic Curve Diffie Hellman module added
5081a8e1175bSopenharmony_ci   * Ephemeral Elliptic Curve Diffie Hellman support for SSL/TLS
5082a8e1175bSopenharmony_ci    (ECDHE-based ciphersuites)
5083a8e1175bSopenharmony_ci   * Ephemeral Elliptic Curve Digital Signature Algorithm support for SSL/TLS
5084a8e1175bSopenharmony_ci    (ECDSA-based ciphersuites)
5085a8e1175bSopenharmony_ci   * Ability to specify allowed ciphersuites based on the protocol version.
5086a8e1175bSopenharmony_ci   * PSK and DHE-PSK based ciphersuites added
5087a8e1175bSopenharmony_ci   * Memory allocation abstraction layer added
5088a8e1175bSopenharmony_ci   * Buffer-based memory allocator added (no malloc() / free() / HEAP usage)
5089a8e1175bSopenharmony_ci   * Threading abstraction layer added (dummy / pthread / alternate)
5090a8e1175bSopenharmony_ci   * Public Key abstraction layer added
5091a8e1175bSopenharmony_ci   * Parsing Elliptic Curve keys
5092a8e1175bSopenharmony_ci   * Parsing Elliptic Curve certificates
5093a8e1175bSopenharmony_ci   * Support for max_fragment_length extension (RFC 6066)
5094a8e1175bSopenharmony_ci   * Support for truncated_hmac extension (RFC 6066)
5095a8e1175bSopenharmony_ci   * Support for zeros-and-length (ANSI X.923) padding, one-and-zeros
5096a8e1175bSopenharmony_ci     (ISO/IEC 7816-4) padding and zero padding in the cipher layer
5097a8e1175bSopenharmony_ci   * Support for session tickets (RFC 5077)
5098a8e1175bSopenharmony_ci   * Certificate Request (CSR) generation with extensions (key_usage,
5099a8e1175bSopenharmony_ci     ns_cert_type)
5100a8e1175bSopenharmony_ci   * X509 Certificate writing with extensions (basic_constraints,
5101a8e1175bSopenharmony_ci     issuer_key_identifier, etc)
5102a8e1175bSopenharmony_ci   * Optional blinding for RSA, DHM and EC
5103a8e1175bSopenharmony_ci   * Support for multiple active certificate / key pairs in SSL servers for
5104a8e1175bSopenharmony_ci     the same host (Not to be confused with SNI!)
5105a8e1175bSopenharmony_ci
5106a8e1175bSopenharmony_ciChanges
5107a8e1175bSopenharmony_ci   * Ability to enable / disable SSL v3 / TLS 1.0 / TLS 1.1 / TLS 1.2
5108a8e1175bSopenharmony_ci     individually
5109a8e1175bSopenharmony_ci   * Introduced separate SSL Ciphersuites module that is based on
5110a8e1175bSopenharmony_ci     Cipher and MD information
5111a8e1175bSopenharmony_ci   * Internals for SSL module adapted to have separate IV pointer that is
5112a8e1175bSopenharmony_ci     dynamically set (Better support for hardware acceleration)
5113a8e1175bSopenharmony_ci   * Moved all OID functionality to a separate module. RSA function
5114a8e1175bSopenharmony_ci     prototypes for the RSA sign and verify functions changed as a result
5115a8e1175bSopenharmony_ci   * Split up the GCM module into a starts/update/finish cycle
5116a8e1175bSopenharmony_ci   * Client and server now filter sent and accepted ciphersuites on minimum
5117a8e1175bSopenharmony_ci     and maximum protocol version
5118a8e1175bSopenharmony_ci   * Ability to disable server_name extension (RFC 6066)
5119a8e1175bSopenharmony_ci   * Renamed error_strerror() to the less conflicting polarssl_strerror()
5120a8e1175bSopenharmony_ci     (Ability to keep old as well with POLARSSL_ERROR_STRERROR_BC)
5121a8e1175bSopenharmony_ci   * SHA2 renamed to SHA256, SHA4 renamed to SHA512 and functions accordingly
5122a8e1175bSopenharmony_ci   * All RSA operations require a random generator for blinding purposes
5123a8e1175bSopenharmony_ci   * X509 core refactored
5124a8e1175bSopenharmony_ci   * x509_crt_verify() now case insensitive for cn (RFC 6125 6.4)
5125a8e1175bSopenharmony_ci   * Also compiles / runs without time-based functions (!POLARSSL_HAVE_TIME)
5126a8e1175bSopenharmony_ci   * Support faulty X509 v1 certificates with extensions
5127a8e1175bSopenharmony_ci     (POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3)
5128a8e1175bSopenharmony_ci
5129a8e1175bSopenharmony_ciBugfix
5130a8e1175bSopenharmony_ci   * Fixed parse error in ssl_parse_certificate_request()
5131a8e1175bSopenharmony_ci   * zlib compression/decompression skipped on empty blocks
5132a8e1175bSopenharmony_ci   * Support for AIX header locations in net.c module
5133a8e1175bSopenharmony_ci   * Fixed file descriptor leaks
5134a8e1175bSopenharmony_ci
5135a8e1175bSopenharmony_ciSecurity
5136a8e1175bSopenharmony_ci   * RSA blinding on CRT operations to counter timing attacks
5137a8e1175bSopenharmony_ci     (found by Cyril Arnaud and Pierre-Alain Fouque)
5138a8e1175bSopenharmony_ci
5139a8e1175bSopenharmony_ci
5140a8e1175bSopenharmony_ci= Version 1.2.14 released 2015-05-??
5141a8e1175bSopenharmony_ci
5142a8e1175bSopenharmony_ciSecurity
5143a8e1175bSopenharmony_ci   * Fix potential invalid memory read in the server, that allows a client to
5144a8e1175bSopenharmony_ci     crash it remotely (found by Caj Larsson).
5145a8e1175bSopenharmony_ci   * Fix potential invalid memory read in certificate parsing, that allows a
5146a8e1175bSopenharmony_ci     client to crash the server remotely if client authentication is enabled
5147a8e1175bSopenharmony_ci     (found using Codenomicon Defensics).
5148a8e1175bSopenharmony_ci   * Add countermeasure against "Lucky 13 strikes back" cache-based attack,
5149a8e1175bSopenharmony_ci     https://dl.acm.org/citation.cfm?id=2714625
5150a8e1175bSopenharmony_ci
5151a8e1175bSopenharmony_ciBugfix
5152a8e1175bSopenharmony_ci   * Fix bug in Via Padlock support (found by Nikos Mavrogiannopoulos).
5153a8e1175bSopenharmony_ci   * Fix hardclock() (only used in the benchmarking program) with some
5154a8e1175bSopenharmony_ci     versions of mingw64 (found by kxjhlele).
5155a8e1175bSopenharmony_ci   * Fix warnings from mingw64 in timing.c (found by kxjklele).
5156a8e1175bSopenharmony_ci   * Fix potential unintended sign extension in asn1_get_len() on 64-bit
5157a8e1175bSopenharmony_ci     platforms (found with Coverity Scan).
5158a8e1175bSopenharmony_ci
5159a8e1175bSopenharmony_ci= Version 1.2.13 released 2015-02-16
5160a8e1175bSopenharmony_ciNote: Although PolarSSL has been renamed to mbed TLS, no changes reflecting
5161a8e1175bSopenharmony_ci      this will be made in the 1.2 branch at this point.
5162a8e1175bSopenharmony_ci
5163a8e1175bSopenharmony_ciSecurity
5164a8e1175bSopenharmony_ci   * Fix remotely-triggerable uninitialised pointer dereference caused by
5165a8e1175bSopenharmony_ci     crafted X.509 certificate (TLS server is not affected if it doesn't ask
5166a8e1175bSopenharmony_ci     for a client certificate) (found using Codenomicon Defensics).
5167a8e1175bSopenharmony_ci   * Fix remotely-triggerable memory leak caused by crafted X.509 certificates
5168a8e1175bSopenharmony_ci     (TLS server is not affected if it doesn't ask for a client certificate)
5169a8e1175bSopenharmony_ci     (found using Codenomicon Defensics).
5170a8e1175bSopenharmony_ci   * Fix potential stack overflow while parsing crafted X.509 certificates
5171a8e1175bSopenharmony_ci     (TLS server is not affected if it doesn't ask for a client certificate)
5172a8e1175bSopenharmony_ci     found using Codenomicon Defensics).
5173a8e1175bSopenharmony_ci   * Fix buffer overread of size 1 when parsing crafted X.509 certificates
5174a8e1175bSopenharmony_ci     (TLS server is not affected if it doesn't ask for a client certificate).
5175a8e1175bSopenharmony_ci
5176a8e1175bSopenharmony_ciBugfix
5177a8e1175bSopenharmony_ci   * Fix potential undefined behaviour in Camellia.
5178a8e1175bSopenharmony_ci   * Fix memory leaks in PKCS#5 and PKCS#12.
5179a8e1175bSopenharmony_ci   * Stack buffer overflow if ctr_drbg_update() is called with too large
5180a8e1175bSopenharmony_ci     add_len (found by Jean-Philippe Aumasson) (not triggerable remotely).
5181a8e1175bSopenharmony_ci   * Fix bug in MPI/bignum on s390/s390x (reported by Dan Horák) (introduced
5182a8e1175bSopenharmony_ci     in 1.2.12).
5183a8e1175bSopenharmony_ci   * Fix unchecked return code in x509_crt_parse_path() on Windows (found by
5184a8e1175bSopenharmony_ci     Peter Vaskovic).
5185a8e1175bSopenharmony_ci   * Fix assembly selection for MIPS64 (thanks to James Cowgill).
5186a8e1175bSopenharmony_ci   * ssl_get_verify_result() now works even if the handshake was aborted due
5187a8e1175bSopenharmony_ci     to a failed verification (found by Fredrik Axelsson).
5188a8e1175bSopenharmony_ci   * Skip writing and parsing signature_algorithm extension if none of the
5189a8e1175bSopenharmony_ci     key exchanges enabled needs certificates. This fixes a possible interop
5190a8e1175bSopenharmony_ci     issue with some servers when a zero-length extension was sent. (Reported
5191a8e1175bSopenharmony_ci     by Peter Dettman.)
5192a8e1175bSopenharmony_ci   * On a 0-length input, base64_encode() did not correctly set output length
5193a8e1175bSopenharmony_ci     (found by Hendrik van den Boogaard).
5194a8e1175bSopenharmony_ci
5195a8e1175bSopenharmony_ciChanges
5196a8e1175bSopenharmony_ci   * Blind RSA private operations even when POLARSSL_RSA_NO_CRT is defined.
5197a8e1175bSopenharmony_ci   * Forbid repeated extensions in X.509 certificates.
5198a8e1175bSopenharmony_ci   * Add compile-time option POLARSSL_X509_MAX_INTERMEDIATE_CA to limit the
5199a8e1175bSopenharmony_ci     length of an X.509 verification chain (default = 8).
5200a8e1175bSopenharmony_ci= Version 1.2.12 released 2014-10-24
5201a8e1175bSopenharmony_ci
5202a8e1175bSopenharmony_ciSecurity
5203a8e1175bSopenharmony_ci   * Remotely-triggerable memory leak when parsing some X.509 certificates
5204a8e1175bSopenharmony_ci     (server is not affected if it doesn't ask for a client certificate).
5205a8e1175bSopenharmony_ci     (Found using Codenomicon Defensics.)
5206a8e1175bSopenharmony_ci
5207a8e1175bSopenharmony_ciBugfix
5208a8e1175bSopenharmony_ci   * Fix potential bad read in parsing ServerHello (found by Adrien
5209a8e1175bSopenharmony_ci     Vialletelle).
5210a8e1175bSopenharmony_ci   * ssl_close_notify() could send more than one message in some circumstances
5211a8e1175bSopenharmony_ci     with non-blocking I/O.
5212a8e1175bSopenharmony_ci   * x509_crt_parse() did not increase total_failed on PEM error
5213a8e1175bSopenharmony_ci   * Fix compiler warnings on iOS (found by Sander Niemeijer).
5214a8e1175bSopenharmony_ci   * Don't print uninitialised buffer in ssl_mail_client (found by Marc Abel).
5215a8e1175bSopenharmony_ci   * Fix net_accept() regarding non-blocking sockets (found by Luca Pesce).
5216a8e1175bSopenharmony_ci   * ssl_read() could return non-application data records on server while
5217a8e1175bSopenharmony_ci     renegotation was pending, and on client when a HelloRequest was received.
5218a8e1175bSopenharmony_ci   * Fix warnings from Clang's scan-build (contributed by Alfred Klomp).
5219a8e1175bSopenharmony_ci
5220a8e1175bSopenharmony_ciChanges
5221a8e1175bSopenharmony_ci   * X.509 certificates with more than one AttributeTypeAndValue per
5222a8e1175bSopenharmony_ci     RelativeDistinguishedName are not accepted any more.
5223a8e1175bSopenharmony_ci   * ssl_read() now returns POLARSSL_ERR_NET_WANT_READ rather than
5224a8e1175bSopenharmony_ci     POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE on harmless alerts.
5225a8e1175bSopenharmony_ci   * Accept spaces at end of line or end of buffer in base64_decode().
5226a8e1175bSopenharmony_ci
5227a8e1175bSopenharmony_ci= Version 1.2.11 released 2014-07-11
5228a8e1175bSopenharmony_ciFeatures
5229a8e1175bSopenharmony_ci   * Entropy module now supports seed writing and reading
5230a8e1175bSopenharmony_ci
5231a8e1175bSopenharmony_ciChanges
5232a8e1175bSopenharmony_ci   * Introduced POLARSSL_HAVE_READDIR_R for systems without it
5233a8e1175bSopenharmony_ci   * Improvements to the CMake build system, contributed by Julian Ospald.
5234a8e1175bSopenharmony_ci   * Work around a bug of the version of Clang shipped by Apple with Mavericks
5235a8e1175bSopenharmony_ci     that prevented bignum.c from compiling. (Reported by Rafael Baptista.)
5236a8e1175bSopenharmony_ci   * Improvements to tests/Makefile, contributed by Oden Eriksson.
5237a8e1175bSopenharmony_ci   * Use UTC time to check certificate validity.
5238a8e1175bSopenharmony_ci   * Reject certificates with times not in UTC, per RFC 5280.
5239a8e1175bSopenharmony_ci   * Migrate zeroizing of data to polarssl_zeroize() instead of memset()
5240a8e1175bSopenharmony_ci     against unwanted compiler optimizations
5241a8e1175bSopenharmony_ci
5242a8e1175bSopenharmony_ciSecurity
5243a8e1175bSopenharmony_ci   * Forbid change of server certificate during renegotiation to prevent
5244a8e1175bSopenharmony_ci     "triple handshake" attack when authentication mode is optional (the
5245a8e1175bSopenharmony_ci     attack was already impossible when authentication is required).
5246a8e1175bSopenharmony_ci   * Check notBefore timestamp of certificates and CRLs from the future.
5247a8e1175bSopenharmony_ci   * Forbid sequence number wrapping
5248a8e1175bSopenharmony_ci   * Prevent potential NULL pointer dereference in ssl_read_record() (found by
5249a8e1175bSopenharmony_ci     TrustInSoft)
5250a8e1175bSopenharmony_ci   * Fix length checking for AEAD ciphersuites (found by Codenomicon).
5251a8e1175bSopenharmony_ci     It was possible to crash the server (and client) using crafted messages
5252a8e1175bSopenharmony_ci     when a GCM suite was chosen.
5253a8e1175bSopenharmony_ci
5254a8e1175bSopenharmony_ciBugfix
5255a8e1175bSopenharmony_ci   * Fixed X.509 hostname comparison (with non-regular characters)
5256a8e1175bSopenharmony_ci   * SSL now gracefully handles missing RNG
5257a8e1175bSopenharmony_ci   * crypt_and_hash app checks MAC before final decryption
5258a8e1175bSopenharmony_ci   * Fixed x509_crt_parse_path() bug on Windows platforms
5259a8e1175bSopenharmony_ci   * Added missing MPI_CHK() around some statements in mpi_div_mpi() (found by
5260a8e1175bSopenharmony_ci     TrustInSoft)
5261a8e1175bSopenharmony_ci   * Fixed potential overflow in certificate size verification in
5262a8e1175bSopenharmony_ci     ssl_write_certificate() (found by TrustInSoft)
5263a8e1175bSopenharmony_ci   * Fix ASM format in bn_mul.h
5264a8e1175bSopenharmony_ci   * Potential memory leak in bignum_selftest()
5265a8e1175bSopenharmony_ci   * Replaced expired test certificate
5266a8e1175bSopenharmony_ci   * ssl_mail_client now terminates lines with CRLF, instead of LF
5267a8e1175bSopenharmony_ci   * Fix bug in RSA PKCS#1 v1.5 "reversed" operations
5268a8e1175bSopenharmony_ci   * Fixed testing with out-of-source builds using cmake
5269a8e1175bSopenharmony_ci   * Fixed version-major intolerance in server
5270a8e1175bSopenharmony_ci   * Fixed CMake symlinking on out-of-source builds
5271a8e1175bSopenharmony_ci   * Bignum's MIPS-32 assembly was used on MIPS-64, causing chaos. (Found by
5272a8e1175bSopenharmony_ci     Alex Wilson.)
5273a8e1175bSopenharmony_ci   * ssl_init() was leaving a dirty pointer in ssl_context if malloc of
5274a8e1175bSopenharmony_ci     out_ctr failed
5275a8e1175bSopenharmony_ci   * ssl_handshake_init() was leaving dirty pointers in subcontexts if malloc
5276a8e1175bSopenharmony_ci     of one of them failed
5277a8e1175bSopenharmony_ci   * x509_get_current_time() uses localtime_r() to prevent thread issues
5278a8e1175bSopenharmony_ci   * Some example server programs were not sending the close_notify alert.
5279a8e1175bSopenharmony_ci   * Potential memory leak in mpi_exp_mod() when error occurs during
5280a8e1175bSopenharmony_ci     calculation of RR.
5281a8e1175bSopenharmony_ci   * Improve interoperability by not writing extension length in ClientHello
5282a8e1175bSopenharmony_ci     when no extensions are present (found by Matthew Page)
5283a8e1175bSopenharmony_ci   * rsa_check_pubkey() now allows an E up to N
5284a8e1175bSopenharmony_ci   * On OpenBSD, use arc4random_buf() instead of rand() to prevent warnings
5285a8e1175bSopenharmony_ci   * mpi_fill_random() was creating numbers larger than requested on
5286a8e1175bSopenharmony_ci     big-endian platform when size was not an integer number of limbs
5287a8e1175bSopenharmony_ci   * Fix detection of DragonflyBSD in net.c (found by Markus Pfeiffer)
5288a8e1175bSopenharmony_ci   * Stricter check on SSL ClientHello internal sizes compared to actual packet
5289a8e1175bSopenharmony_ci     size (found by TrustInSoft)
5290a8e1175bSopenharmony_ci   * Fix preprocessor checks for bn_mul PPC asm (found by Barry K. Nathan).
5291a8e1175bSopenharmony_ci   * Use \n\t rather than semicolons for bn_mul asm, since some assemblers
5292a8e1175bSopenharmony_ci     interpret semicolons as comment delimiters (found by Barry K. Nathan).
5293a8e1175bSopenharmony_ci   * Disable broken Sparc64 bn_mul assembly (found by Florian Obser).
5294a8e1175bSopenharmony_ci   * Fix base64_decode() to return and check length correctly (in case of
5295a8e1175bSopenharmony_ci     tight buffers)
5296a8e1175bSopenharmony_ci
5297a8e1175bSopenharmony_ci= Version 1.2.10 released 2013-10-07
5298a8e1175bSopenharmony_ciChanges
5299a8e1175bSopenharmony_ci   * Changed RSA blinding to a slower but thread-safe version
5300a8e1175bSopenharmony_ci
5301a8e1175bSopenharmony_ciBugfix
5302a8e1175bSopenharmony_ci   * Fixed memory leak in RSA as a result of introduction of blinding
5303a8e1175bSopenharmony_ci   * Fixed ssl_pkcs11_decrypt() prototype
5304a8e1175bSopenharmony_ci   * Fixed MSVC project files
5305a8e1175bSopenharmony_ci
5306a8e1175bSopenharmony_ci= Version 1.2.9 released 2013-10-01
5307a8e1175bSopenharmony_ciChanges
5308a8e1175bSopenharmony_ci   * x509_verify() now case insensitive for cn (RFC 6125 6.4)
5309a8e1175bSopenharmony_ci
5310a8e1175bSopenharmony_ciBugfix
5311a8e1175bSopenharmony_ci   * Fixed potential memory leak when failing to resume a session
5312a8e1175bSopenharmony_ci   * Fixed potential file descriptor leaks (found by Remi Gacogne)
5313a8e1175bSopenharmony_ci   * Minor fixes
5314a8e1175bSopenharmony_ci
5315a8e1175bSopenharmony_ciSecurity
5316a8e1175bSopenharmony_ci   * Fixed potential heap buffer overflow on large hostname setting
5317a8e1175bSopenharmony_ci   * Fixed potential negative value misinterpretation in load_file()
5318a8e1175bSopenharmony_ci   * RSA blinding on CRT operations to counter timing attacks
5319a8e1175bSopenharmony_ci     (found by Cyril Arnaud and Pierre-Alain Fouque)
5320a8e1175bSopenharmony_ci
5321a8e1175bSopenharmony_ci= Version 1.2.8 released 2013-06-19
5322a8e1175bSopenharmony_ciFeatures
5323a8e1175bSopenharmony_ci   * Parsing of PKCS#8 encrypted private key files
5324a8e1175bSopenharmony_ci   * PKCS#12 PBE and derivation functions
5325a8e1175bSopenharmony_ci   * Centralized module option values in config.h to allow user-defined
5326a8e1175bSopenharmony_ci     settings without editing header files by using POLARSSL_CONFIG_OPTIONS
5327a8e1175bSopenharmony_ci
5328a8e1175bSopenharmony_ciChanges
5329a8e1175bSopenharmony_ci   * HAVEGE random generator disabled by default
5330a8e1175bSopenharmony_ci   * Internally split up x509parse_key() into a (PEM) handler function
5331a8e1175bSopenharmony_ci     and specific DER parser functions for the PKCS#1 and unencrypted
5332a8e1175bSopenharmony_ci     PKCS#8 private key formats
5333a8e1175bSopenharmony_ci   * Added mechanism to provide alternative implementations for all
5334a8e1175bSopenharmony_ci     symmetric cipher and hash algorithms (e.g. POLARSSL_AES_ALT in
5335a8e1175bSopenharmony_ci     config.h)
5336a8e1175bSopenharmony_ci   * PKCS#5 module added. Moved PBKDF2 functionality inside and deprecated
5337a8e1175bSopenharmony_ci     old PBKDF2 module
5338a8e1175bSopenharmony_ci
5339a8e1175bSopenharmony_ciBugfix
5340a8e1175bSopenharmony_ci   * Secure renegotiation extension should only be sent in case client
5341a8e1175bSopenharmony_ci     supports secure renegotiation
5342a8e1175bSopenharmony_ci   * Fixed offset for cert_type list in ssl_parse_certificate_request()
5343a8e1175bSopenharmony_ci   * Fixed const correctness issues that have no impact on the ABI
5344a8e1175bSopenharmony_ci   * x509parse_crt() now better handles PEM error situations
5345a8e1175bSopenharmony_ci   * ssl_parse_certificate() now calls x509parse_crt_der() directly
5346a8e1175bSopenharmony_ci     instead of the x509parse_crt() wrapper that can also parse PEM
5347a8e1175bSopenharmony_ci     certificates
5348a8e1175bSopenharmony_ci   * x509parse_crtpath() is now reentrant and uses more portable stat()
5349a8e1175bSopenharmony_ci   * Fixed bignum.c and bn_mul.h to support Thumb2 and LLVM compiler
5350a8e1175bSopenharmony_ci   * Fixed values for 2-key Triple DES in cipher layer
5351a8e1175bSopenharmony_ci   * ssl_write_certificate_request() can handle empty ca_chain
5352a8e1175bSopenharmony_ci
5353a8e1175bSopenharmony_ciSecurity
5354a8e1175bSopenharmony_ci   * A possible DoS during the SSL Handshake, due to faulty parsing of
5355a8e1175bSopenharmony_ci     PEM-encoded certificates has been fixed (found by Jack Lloyd)
5356a8e1175bSopenharmony_ci
5357a8e1175bSopenharmony_ci= Version 1.2.7 released 2013-04-13
5358a8e1175bSopenharmony_ciFeatures
5359a8e1175bSopenharmony_ci   * Ability to specify allowed ciphersuites based on the protocol version.
5360a8e1175bSopenharmony_ci
5361a8e1175bSopenharmony_ciChanges
5362a8e1175bSopenharmony_ci   * Default Blowfish keysize is now 128-bits
5363a8e1175bSopenharmony_ci   * Test suites made smaller to accommodate Raspberry Pi
5364a8e1175bSopenharmony_ci
5365a8e1175bSopenharmony_ciBugfix
5366a8e1175bSopenharmony_ci   * Fix for MPI assembly for ARM
5367a8e1175bSopenharmony_ci   * GCM adapted to support sizes > 2^29
5368a8e1175bSopenharmony_ci
5369a8e1175bSopenharmony_ci= Version 1.2.6 released 2013-03-11
5370a8e1175bSopenharmony_ciBugfix
5371a8e1175bSopenharmony_ci   * Fixed memory leak in ssl_free() and ssl_reset() for active session
5372a8e1175bSopenharmony_ci   * Corrected GCM counter incrementation to use only 32-bits instead of
5373a8e1175bSopenharmony_ci     128-bits (found by Yawning Angel)
5374a8e1175bSopenharmony_ci   * Fixes for 64-bit compilation with MS Visual Studio
5375a8e1175bSopenharmony_ci   * Fixed net_bind() for specified IP addresses on little endian systems
5376a8e1175bSopenharmony_ci   * Fixed assembly code for ARM (Thumb and regular) for some compilers
5377a8e1175bSopenharmony_ci
5378a8e1175bSopenharmony_ciChanges
5379a8e1175bSopenharmony_ci   * Internally split up rsa_pkcs1_encrypt(), rsa_pkcs1_decrypt(),
5380a8e1175bSopenharmony_ci     rsa_pkcs1_sign() and rsa_pkcs1_verify() to separate PKCS#1 v1.5 and
5381a8e1175bSopenharmony_ci     PKCS#1 v2.1 functions
5382a8e1175bSopenharmony_ci   * Added support for custom labels when using rsa_rsaes_oaep_encrypt()
5383a8e1175bSopenharmony_ci     or rsa_rsaes_oaep_decrypt()
5384a8e1175bSopenharmony_ci   * Re-added handling for SSLv2 Client Hello when the define
5385a8e1175bSopenharmony_ci     POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is set
5386a8e1175bSopenharmony_ci   * The SSL session cache module (ssl_cache) now also retains peer_cert
5387a8e1175bSopenharmony_ci     information (not the entire chain)
5388a8e1175bSopenharmony_ci
5389a8e1175bSopenharmony_ciSecurity
5390a8e1175bSopenharmony_ci   * Removed further timing differences during SSL message decryption in
5391a8e1175bSopenharmony_ci     ssl_decrypt_buf()
5392a8e1175bSopenharmony_ci   * Removed timing differences due to bad padding from
5393a8e1175bSopenharmony_ci     rsa_rsaes_pkcs1_v15_decrypt() and rsa_pkcs1_decrypt() for PKCS#1 v1.5
5394a8e1175bSopenharmony_ci     operations
5395a8e1175bSopenharmony_ci
5396a8e1175bSopenharmony_ci= Version 1.2.5 released 2013-02-02
5397a8e1175bSopenharmony_ciChanges
5398a8e1175bSopenharmony_ci   * Allow enabling of dummy error_strerror() to support some use-cases
5399a8e1175bSopenharmony_ci   * Debug messages about padding errors during SSL message decryption are
5400a8e1175bSopenharmony_ci     disabled by default and can be enabled with POLARSSL_SSL_DEBUG_ALL
5401a8e1175bSopenharmony_ci   * Sending of security-relevant alert messages that do not break
5402a8e1175bSopenharmony_ci     interoperability can be switched on/off with the flag
5403a8e1175bSopenharmony_ci     POLARSSL_SSL_ALL_ALERT_MESSAGES
5404a8e1175bSopenharmony_ci
5405a8e1175bSopenharmony_ciSecurity
5406a8e1175bSopenharmony_ci   * Removed timing differences during SSL message decryption in
5407a8e1175bSopenharmony_ci     ssl_decrypt_buf() due to badly formatted padding
5408a8e1175bSopenharmony_ci
5409a8e1175bSopenharmony_ci= Version 1.2.4 released 2013-01-25
5410a8e1175bSopenharmony_ciChanges
5411a8e1175bSopenharmony_ci   * More advanced SSL ciphersuite representation and moved to more dynamic
5412a8e1175bSopenharmony_ci     SSL core
5413a8e1175bSopenharmony_ci   * Added ssl_handshake_step() to allow single stepping the handshake process
5414a8e1175bSopenharmony_ci
5415a8e1175bSopenharmony_ciBugfix
5416a8e1175bSopenharmony_ci   * Memory leak when using RSA_PKCS_V21 operations fixed
5417a8e1175bSopenharmony_ci   * Handle future version properly in ssl_write_certificate_request()
5418a8e1175bSopenharmony_ci   * Correctly handle CertificateRequest message in client for <= TLS 1.1
5419a8e1175bSopenharmony_ci     without DN list
5420a8e1175bSopenharmony_ci
5421a8e1175bSopenharmony_ci= Version 1.2.3 released 2012-11-26
5422a8e1175bSopenharmony_ciBugfix
5423a8e1175bSopenharmony_ci   * Server not always sending correct CertificateRequest message
5424a8e1175bSopenharmony_ci
5425a8e1175bSopenharmony_ci= Version 1.2.2 released 2012-11-24
5426a8e1175bSopenharmony_ciChanges
5427a8e1175bSopenharmony_ci   * Added p_hw_data to ssl_context for context specific hardware acceleration
5428a8e1175bSopenharmony_ci     data
5429a8e1175bSopenharmony_ci   * During verify trust-CA is only checked for expiration and CRL presence
5430a8e1175bSopenharmony_ci
5431a8e1175bSopenharmony_ciBugfixes
5432a8e1175bSopenharmony_ci   * Fixed client authentication compatibility
5433a8e1175bSopenharmony_ci   * Fixed dependency on POLARSSL_SHA4_C in SSL modules
5434a8e1175bSopenharmony_ci
5435a8e1175bSopenharmony_ci= Version 1.2.1 released 2012-11-20
5436a8e1175bSopenharmony_ciChanges
5437a8e1175bSopenharmony_ci   * Depth that the certificate verify callback receives is now numbered
5438a8e1175bSopenharmony_ci     bottom-up (Peer cert depth is 0)
5439a8e1175bSopenharmony_ci
5440a8e1175bSopenharmony_ciBugfixes
5441a8e1175bSopenharmony_ci   * Fixes for MSVC6
5442a8e1175bSopenharmony_ci   * Moved mpi_inv_mod() outside POLARSSL_GENPRIME
5443a8e1175bSopenharmony_ci   * Allow R and A to point to same mpi in mpi_div_mpi (found by Manuel
5444a8e1175bSopenharmony_ci     Pégourié-Gonnard)
5445a8e1175bSopenharmony_ci   * Fixed possible segfault in mpi_shift_r() (found by Manuel
5446a8e1175bSopenharmony_ci     Pégourié-Gonnard)
5447a8e1175bSopenharmony_ci   * Added max length check for rsa_pkcs1_sign with PKCS#1 v2.1
5448a8e1175bSopenharmony_ci
5449a8e1175bSopenharmony_ci= Version 1.2.0 released 2012-10-31
5450a8e1175bSopenharmony_ciFeatures
5451a8e1175bSopenharmony_ci   * Added support for NULL cipher (POLARSSL_CIPHER_NULL_CIPHER) and weak
5452a8e1175bSopenharmony_ci     ciphersuites (POLARSSL_ENABLE_WEAK_CIPHERSUITES). They are disabled by
5453a8e1175bSopenharmony_ci     default!
5454a8e1175bSopenharmony_ci   * Added support for wildcard certificates
5455a8e1175bSopenharmony_ci   * Added support for multi-domain certificates through the X509 Subject
5456a8e1175bSopenharmony_ci     Alternative Name extension
5457a8e1175bSopenharmony_ci   * Added preliminary ASN.1 buffer writing support
5458a8e1175bSopenharmony_ci   * Added preliminary X509 Certificate Request writing support
5459a8e1175bSopenharmony_ci   * Added key_app_writer example application
5460a8e1175bSopenharmony_ci   * Added cert_req example application
5461a8e1175bSopenharmony_ci   * Added base Galois Counter Mode (GCM) for AES
5462a8e1175bSopenharmony_ci   * Added TLS 1.2 support (RFC 5246)
5463a8e1175bSopenharmony_ci   * Added GCM suites to TLS 1.2 (RFC 5288)
5464a8e1175bSopenharmony_ci   * Added commandline error code convertor (util/strerror)
5465a8e1175bSopenharmony_ci   * Added support for Hardware Acceleration hooking in SSL/TLS
5466a8e1175bSopenharmony_ci   * Added OpenSSL / PolarSSL compatibility script (tests/compat.sh) and
5467a8e1175bSopenharmony_ci     example application (programs/ssl/o_p_test) (requires OpenSSL)
5468a8e1175bSopenharmony_ci   * Added X509 CA Path support
5469a8e1175bSopenharmony_ci   * Added Thumb assembly optimizations
5470a8e1175bSopenharmony_ci   * Added DEFLATE compression support as per RFC3749 (requires zlib)
5471a8e1175bSopenharmony_ci   * Added blowfish algorithm (Generic and cipher layer)
5472a8e1175bSopenharmony_ci   * Added PKCS#5 PBKDF2 key derivation function
5473a8e1175bSopenharmony_ci   * Added Secure Renegotiation (RFC 5746)
5474a8e1175bSopenharmony_ci   * Added predefined DHM groups from RFC 5114
5475a8e1175bSopenharmony_ci   * Added simple SSL session cache implementation
5476a8e1175bSopenharmony_ci   * Added ServerName extension parsing (SNI) at server side
5477a8e1175bSopenharmony_ci   * Added option to add minimum accepted SSL/TLS protocol version
5478a8e1175bSopenharmony_ci
5479a8e1175bSopenharmony_ciChanges
5480a8e1175bSopenharmony_ci   * Removed redundant POLARSSL_DEBUG_MSG define
5481a8e1175bSopenharmony_ci   * AES code only check for Padlock once
5482a8e1175bSopenharmony_ci   * Fixed const-correctness mpi_get_bit()
5483a8e1175bSopenharmony_ci   * Documentation for mpi_lsb() and mpi_msb()
5484a8e1175bSopenharmony_ci   * Moved out_msg to out_hdr + 32 to support hardware acceleration
5485a8e1175bSopenharmony_ci   * Changed certificate verify behaviour to comply with RFC 6125 section 6.3
5486a8e1175bSopenharmony_ci     to not match CN if subjectAltName extension is present (Closes ticket #56)
5487a8e1175bSopenharmony_ci   * Cipher layer cipher_mode_t POLARSSL_MODE_CFB128 is renamed to
5488a8e1175bSopenharmony_ci     POLARSSL_MODE_CFB, to also handle different block size CFB modes.
5489a8e1175bSopenharmony_ci   * Removed handling for SSLv2 Client Hello (as per RFC 5246 recommendation)
5490a8e1175bSopenharmony_ci   * Revamped session resumption handling
5491a8e1175bSopenharmony_ci   * Generalized external private key implementation handling (like PKCS#11)
5492a8e1175bSopenharmony_ci     in SSL/TLS
5493a8e1175bSopenharmony_ci   * Revamped x509_verify() and the SSL f_vrfy callback implementations
5494a8e1175bSopenharmony_ci   * Moved from unsigned long to fixed width uint32_t types throughout code
5495a8e1175bSopenharmony_ci   * Renamed ciphersuites naming scheme to IANA reserved names
5496a8e1175bSopenharmony_ci
5497a8e1175bSopenharmony_ciBugfix
5498a8e1175bSopenharmony_ci   * Fixed handling error in mpi_cmp_mpi() on longer B values (found by
5499a8e1175bSopenharmony_ci     Hui Dong)
5500a8e1175bSopenharmony_ci   * Fixed potential heap corruption in x509_name allocation
5501a8e1175bSopenharmony_ci   * Fixed single RSA test that failed on Big Endian systems (Closes ticket #54)
5502a8e1175bSopenharmony_ci   * mpi_exp_mod() now correctly handles negative base numbers (Closes ticket
5503a8e1175bSopenharmony_ci     #52)
5504a8e1175bSopenharmony_ci   * Handle encryption with private key and decryption with public key as per
5505a8e1175bSopenharmony_ci     RFC 2313
5506a8e1175bSopenharmony_ci   * Handle empty certificate subject names
5507a8e1175bSopenharmony_ci   * Prevent reading over buffer boundaries on X509 certificate parsing
5508a8e1175bSopenharmony_ci   * mpi_add_abs() now correctly handles adding short numbers to long numbers
5509a8e1175bSopenharmony_ci     with carry rollover (found by Ruslan Yushchenko)
5510a8e1175bSopenharmony_ci   * Handle existence of OpenSSL Trust Extensions at end of X.509 DER blob
5511a8e1175bSopenharmony_ci   * Fixed MPI assembly for SPARC64 platform
5512a8e1175bSopenharmony_ci
5513a8e1175bSopenharmony_ciSecurity
5514a8e1175bSopenharmony_ci   * Fixed potential memory zeroization on miscrafted RSA key (found by Eloi
5515a8e1175bSopenharmony_ci     Vanderbeken)
5516a8e1175bSopenharmony_ci
5517a8e1175bSopenharmony_ci= Version 1.1.8 released on 2013-10-01
5518a8e1175bSopenharmony_ciBugfix
5519a8e1175bSopenharmony_ci   * Fixed potential memory leak when failing to resume a session
5520a8e1175bSopenharmony_ci   * Fixed potential file descriptor leaks
5521a8e1175bSopenharmony_ci
5522a8e1175bSopenharmony_ciSecurity
5523a8e1175bSopenharmony_ci   * Potential buffer-overflow for ssl_read_record() (independently found by
5524a8e1175bSopenharmony_ci     both TrustInSoft and Paul Brodeur of Leviathan Security Group)
5525a8e1175bSopenharmony_ci   * Potential negative value misinterpretation in load_file()
5526a8e1175bSopenharmony_ci   * Potential heap buffer overflow on large hostname setting
5527a8e1175bSopenharmony_ci
5528a8e1175bSopenharmony_ci= Version 1.1.7 released on 2013-06-19
5529a8e1175bSopenharmony_ciChanges
5530a8e1175bSopenharmony_ci   * HAVEGE random generator disabled by default
5531a8e1175bSopenharmony_ci
5532a8e1175bSopenharmony_ciBugfix
5533a8e1175bSopenharmony_ci   * x509parse_crt() now better handles PEM error situations
5534a8e1175bSopenharmony_ci   * ssl_parse_certificate() now calls x509parse_crt_der() directly
5535a8e1175bSopenharmony_ci     instead of the x509parse_crt() wrapper that can also parse PEM
5536a8e1175bSopenharmony_ci     certificates
5537a8e1175bSopenharmony_ci   * Fixed values for 2-key Triple DES in cipher layer
5538a8e1175bSopenharmony_ci   * ssl_write_certificate_request() can handle empty ca_chain
5539a8e1175bSopenharmony_ci
5540a8e1175bSopenharmony_ciSecurity
5541a8e1175bSopenharmony_ci   * A possible DoS during the SSL Handshake, due to faulty parsing of
5542a8e1175bSopenharmony_ci     PEM-encoded certificates has been fixed (found by Jack Lloyd)
5543a8e1175bSopenharmony_ci
5544a8e1175bSopenharmony_ci= Version 1.1.6 released on 2013-03-11
5545a8e1175bSopenharmony_ciBugfix
5546a8e1175bSopenharmony_ci   * Fixed net_bind() for specified IP addresses on little endian systems
5547a8e1175bSopenharmony_ci
5548a8e1175bSopenharmony_ciChanges
5549a8e1175bSopenharmony_ci   * Allow enabling of dummy error_strerror() to support some use-cases
5550a8e1175bSopenharmony_ci   * Debug messages about padding errors during SSL message decryption are
5551a8e1175bSopenharmony_ci     disabled by default and can be enabled with POLARSSL_SSL_DEBUG_ALL
5552a8e1175bSopenharmony_ci
5553a8e1175bSopenharmony_ciSecurity
5554a8e1175bSopenharmony_ci   * Removed timing differences during SSL message decryption in
5555a8e1175bSopenharmony_ci     ssl_decrypt_buf()
5556a8e1175bSopenharmony_ci   * Removed timing differences due to bad padding from
5557a8e1175bSopenharmony_ci     rsa_rsaes_pkcs1_v15_decrypt() and rsa_pkcs1_decrypt() for PKCS#1 v1.5
5558a8e1175bSopenharmony_ci     operations
5559a8e1175bSopenharmony_ci
5560a8e1175bSopenharmony_ci= Version 1.1.5 released on 2013-01-16
5561a8e1175bSopenharmony_ciBugfix
5562a8e1175bSopenharmony_ci   * Fixed MPI assembly for SPARC64 platform
5563a8e1175bSopenharmony_ci   * Handle existence of OpenSSL Trust Extensions at end of X.509 DER blob
5564a8e1175bSopenharmony_ci   * mpi_add_abs() now correctly handles adding short numbers to long numbers
5565a8e1175bSopenharmony_ci     with carry rollover
5566a8e1175bSopenharmony_ci   * Moved mpi_inv_mod() outside POLARSSL_GENPRIME
5567a8e1175bSopenharmony_ci   * Prevent reading over buffer boundaries on X509 certificate parsing
5568a8e1175bSopenharmony_ci   * mpi_exp_mod() now correctly handles negative base numbers (Closes ticket
5569a8e1175bSopenharmony_ci     #52)
5570a8e1175bSopenharmony_ci   * Fixed possible segfault in mpi_shift_r() (found by Manuel
5571a8e1175bSopenharmony_ci     Pégourié-Gonnard)
5572a8e1175bSopenharmony_ci   * Allow R and A to point to same mpi in mpi_div_mpi (found by Manuel
5573a8e1175bSopenharmony_ci     Pégourié-Gonnard)
5574a8e1175bSopenharmony_ci   * Added max length check for rsa_pkcs1_sign with PKCS#1 v2.1
5575a8e1175bSopenharmony_ci   * Memory leak when using RSA_PKCS_V21 operations fixed
5576a8e1175bSopenharmony_ci   * Handle encryption with private key and decryption with public key as per
5577a8e1175bSopenharmony_ci     RFC 2313
5578a8e1175bSopenharmony_ci   * Fixes for MSVC6
5579a8e1175bSopenharmony_ci
5580a8e1175bSopenharmony_ciSecurity
5581a8e1175bSopenharmony_ci   * Fixed potential memory zeroization on miscrafted RSA key (found by Eloi
5582a8e1175bSopenharmony_ci     Vanderbeken)
5583a8e1175bSopenharmony_ci
5584a8e1175bSopenharmony_ci= Version 1.1.4 released on 2012-05-31
5585a8e1175bSopenharmony_ciBugfix
5586a8e1175bSopenharmony_ci   * Correctly handle empty SSL/TLS packets (Found by James Yonan)
5587a8e1175bSopenharmony_ci   * Fixed potential heap corruption in x509_name allocation
5588a8e1175bSopenharmony_ci   * Fixed single RSA test that failed on Big Endian systems (Closes ticket #54)
5589a8e1175bSopenharmony_ci
5590a8e1175bSopenharmony_ci= Version 1.1.3 released on 2012-04-29
5591a8e1175bSopenharmony_ciBugfix
5592a8e1175bSopenharmony_ci   * Fixed random MPI generation to not generate more size than requested.
5593a8e1175bSopenharmony_ci
5594a8e1175bSopenharmony_ci= Version 1.1.2 released on 2012-04-26
5595a8e1175bSopenharmony_ciBugfix
5596a8e1175bSopenharmony_ci   * Fixed handling error in mpi_cmp_mpi() on longer B values (found by
5597a8e1175bSopenharmony_ci     Hui Dong)
5598a8e1175bSopenharmony_ci
5599a8e1175bSopenharmony_ciSecurity
5600a8e1175bSopenharmony_ci   * Fixed potential memory corruption on miscrafted client messages (found by
5601a8e1175bSopenharmony_ci     Frama-C team at CEA LIST)
5602a8e1175bSopenharmony_ci   * Fixed generation of DHM parameters to correct length (found by Ruslan
5603a8e1175bSopenharmony_ci     Yushchenko)
5604a8e1175bSopenharmony_ci
5605a8e1175bSopenharmony_ci= Version 1.1.1 released on 2012-01-23
5606a8e1175bSopenharmony_ciBugfix
5607a8e1175bSopenharmony_ci   * Check for failed malloc() in ssl_set_hostname() and x509_get_entries()
5608a8e1175bSopenharmony_ci     (Closes ticket #47, found by Hugo Leisink)
5609a8e1175bSopenharmony_ci   * Fixed issues with Intel compiler on 64-bit systems (Closes ticket #50)
5610a8e1175bSopenharmony_ci   * Fixed multiple compiler warnings for VS6 and armcc
5611a8e1175bSopenharmony_ci   * Fixed bug in CTR_CRBG selftest
5612a8e1175bSopenharmony_ci
5613a8e1175bSopenharmony_ci= Version 1.1.0 released on 2011-12-22
5614a8e1175bSopenharmony_ciFeatures
5615a8e1175bSopenharmony_ci   * Added ssl_session_reset() to allow better multi-connection pools of
5616a8e1175bSopenharmony_ci     SSL contexts without needing to set all non-connection-specific
5617a8e1175bSopenharmony_ci     data and pointers again. Adapted ssl_server to use this functionality.
5618a8e1175bSopenharmony_ci   * Added ssl_set_max_version() to allow clients to offer a lower maximum
5619a8e1175bSopenharmony_ci     supported version to a server to help buggy server implementations.
5620a8e1175bSopenharmony_ci     (Closes ticket #36)
5621a8e1175bSopenharmony_ci   * Added cipher_get_cipher_mode() and cipher_get_cipher_operation()
5622a8e1175bSopenharmony_ci     introspection functions (Closes ticket #40)
5623a8e1175bSopenharmony_ci   * Added CTR_DRBG based on AES-256-CTR (NIST SP 800-90) random generator
5624a8e1175bSopenharmony_ci   * Added a generic entropy accumulator that provides support for adding
5625a8e1175bSopenharmony_ci     custom entropy sources and added some generic and platform dependent
5626a8e1175bSopenharmony_ci     entropy sources
5627a8e1175bSopenharmony_ci
5628a8e1175bSopenharmony_ciChanges
5629a8e1175bSopenharmony_ci   * Documentation for AES and Camellia in modes CTR and CFB128 clarified.
5630a8e1175bSopenharmony_ci   * Fixed rsa_encrypt and rsa_decrypt examples to use public key for
5631a8e1175bSopenharmony_ci     encryption and private key for decryption. (Closes ticket #34)
5632a8e1175bSopenharmony_ci   * Inceased maximum size of ASN1 length reads to 32-bits.
5633a8e1175bSopenharmony_ci   * Added an EXPLICIT tag number parameter to x509_get_ext()
5634a8e1175bSopenharmony_ci   * Added a separate CRL entry extension parsing function
5635a8e1175bSopenharmony_ci   * Separated the ASN.1 parsing code from the X.509 specific parsing code.
5636a8e1175bSopenharmony_ci     So now there is a module that is controlled with POLARSSL_ASN1_PARSE_C.
5637a8e1175bSopenharmony_ci   * Changed the defined key-length of DES ciphers in cipher.h to include the
5638a8e1175bSopenharmony_ci     parity bits, to prevent mistakes in copying data. (Closes ticket #33)
5639a8e1175bSopenharmony_ci   * Loads of minimal changes to better support WINCE as a build target
5640a8e1175bSopenharmony_ci     (Credits go to Marco Lizza)
5641a8e1175bSopenharmony_ci   * Added POLARSSL_MPI_WINDOW_SIZE definition to allow easier time to memory
5642a8e1175bSopenharmony_ci     trade-off
5643a8e1175bSopenharmony_ci   * Introduced POLARSSL_MPI_MAX_SIZE and POLARSSL_MPI_MAX_BITS for MPI size
5644a8e1175bSopenharmony_ci     management (Closes ticket #44)
5645a8e1175bSopenharmony_ci   * Changed the used random function pointer to more flexible format. Renamed
5646a8e1175bSopenharmony_ci     havege_rand() to havege_random() to prevent mistakes. Lots of changes as
5647a8e1175bSopenharmony_ci     a consequence in library code and programs
5648a8e1175bSopenharmony_ci   * Moved all examples programs to use the new entropy and CTR_DRBG
5649a8e1175bSopenharmony_ci   * Added permissive certificate parsing to x509parse_crt() and
5650a8e1175bSopenharmony_ci     x509parse_crtfile(). With permissive parsing the parsing does not stop on
5651a8e1175bSopenharmony_ci     encountering a parse-error. Beware that the meaning of return values has
5652a8e1175bSopenharmony_ci     changed!
5653a8e1175bSopenharmony_ci   * All error codes are now negative. Even on mermory failures and IO errors.
5654a8e1175bSopenharmony_ci
5655a8e1175bSopenharmony_ciBugfix
5656a8e1175bSopenharmony_ci   * Fixed faulty HMAC-MD2 implementation. Found by dibac. (Closes
5657a8e1175bSopenharmony_ci     ticket #37)
5658a8e1175bSopenharmony_ci   * Fixed a bug where the CRL parser expected an EXPLICIT ASN.1 tag
5659a8e1175bSopenharmony_ci     before version numbers
5660a8e1175bSopenharmony_ci   * Allowed X509 key usage parsing to accept 4 byte values instead of the
5661a8e1175bSopenharmony_ci     standard 1 byte version sometimes used by Microsoft. (Closes ticket #38)
5662a8e1175bSopenharmony_ci   * Fixed incorrect behaviour in case of RSASSA-PSS with a salt length
5663a8e1175bSopenharmony_ci     smaller than the hash length. (Closes ticket #41)
5664a8e1175bSopenharmony_ci   * If certificate serial is longer than 32 octets, serial number is now
5665a8e1175bSopenharmony_ci     appended with '....' after first 28 octets
5666a8e1175bSopenharmony_ci   * Improved build support for s390x and sparc64 in bignum.h
5667a8e1175bSopenharmony_ci   * Fixed MS Visual C++ name clash with int64 in sha4.h
5668a8e1175bSopenharmony_ci   * Corrected removal of leading "00:" in printing serial numbers in
5669a8e1175bSopenharmony_ci     certificates and CRLs
5670a8e1175bSopenharmony_ci
5671a8e1175bSopenharmony_ci= Version 1.0.0 released on 2011-07-27
5672a8e1175bSopenharmony_ciFeatures
5673a8e1175bSopenharmony_ci   * Expanded cipher layer with support for CFB128 and CTR mode
5674a8e1175bSopenharmony_ci   * Added rsa_encrypt and rsa_decrypt simple example programs.
5675a8e1175bSopenharmony_ci
5676a8e1175bSopenharmony_ciChanges
5677a8e1175bSopenharmony_ci   * The generic cipher and message digest layer now have normal error
5678a8e1175bSopenharmony_ci     codes instead of integers
5679a8e1175bSopenharmony_ci
5680a8e1175bSopenharmony_ciBugfix
5681a8e1175bSopenharmony_ci   * Undid faulty bug fix in ssl_write() when flushing old data (Ticket
5682a8e1175bSopenharmony_ci     #18)
5683a8e1175bSopenharmony_ci
5684a8e1175bSopenharmony_ci= Version 0.99-pre5 released on 2011-05-26
5685a8e1175bSopenharmony_ciFeatures
5686a8e1175bSopenharmony_ci   * Added additional Cipher Block Modes to symmetric ciphers
5687a8e1175bSopenharmony_ci     (AES CTR, Camellia CTR, XTEA CBC) including the option to
5688a8e1175bSopenharmony_ci     enable and disable individual modes when needed
5689a8e1175bSopenharmony_ci   * Functions requiring File System functions can now be disabled
5690a8e1175bSopenharmony_ci     by undefining POLARSSL_FS_IO
5691a8e1175bSopenharmony_ci   * A error_strerror function() has been added to translate between
5692a8e1175bSopenharmony_ci     error codes and their description.
5693a8e1175bSopenharmony_ci   * Added mpi_get_bit() and mpi_set_bit() individual bit setter/getter
5694a8e1175bSopenharmony_ci     functions.
5695a8e1175bSopenharmony_ci   * Added ssl_mail_client and ssl_fork_server as example programs.
5696a8e1175bSopenharmony_ci
5697a8e1175bSopenharmony_ciChanges
5698a8e1175bSopenharmony_ci   * Major argument / variable rewrite. Introduced use of size_t
5699a8e1175bSopenharmony_ci     instead of int for buffer lengths and loop variables for
5700a8e1175bSopenharmony_ci     better unsigned / signed use. Renamed internal bigint types
5701a8e1175bSopenharmony_ci     t_int and t_dbl to t_uint and t_udbl in the process
5702a8e1175bSopenharmony_ci   * mpi_init() and mpi_free() now only accept a single MPI
5703a8e1175bSopenharmony_ci     argument and do not accept variable argument lists anymore.
5704a8e1175bSopenharmony_ci   * The error codes have been remapped and combining error codes
5705a8e1175bSopenharmony_ci     is now done with a PLUS instead of an OR as error codes
5706a8e1175bSopenharmony_ci     used are negative.
5707a8e1175bSopenharmony_ci   * Changed behaviour of net_read(), ssl_fetch_input() and ssl_recv().
5708a8e1175bSopenharmony_ci     net_recv() now returns 0 on EOF instead of
5709a8e1175bSopenharmony_ci     POLARSSL_ERR_NET_CONN_RESET. ssl_fetch_input() returns
5710a8e1175bSopenharmony_ci     POLARSSL_ERR_SSL_CONN_EOF on an EOF from its f_recv() function.
5711a8e1175bSopenharmony_ci     ssl_read() returns 0 if a POLARSSL_ERR_SSL_CONN_EOF is received
5712a8e1175bSopenharmony_ci     after the handshake.
5713a8e1175bSopenharmony_ci   * Network functions now return POLARSSL_ERR_NET_WANT_READ or
5714a8e1175bSopenharmony_ci     POLARSSL_ERR_NET_WANT_WRITE instead of the ambiguous
5715a8e1175bSopenharmony_ci     POLARSSL_ERR_NET_TRY_AGAIN
5716a8e1175bSopenharmony_ci
5717a8e1175bSopenharmony_ci= Version 0.99-pre4 released on 2011-04-01
5718a8e1175bSopenharmony_ciFeatures
5719a8e1175bSopenharmony_ci   * Added support for PKCS#1 v2.1 encoding and thus support
5720a8e1175bSopenharmony_ci     for the RSAES-OAEP and RSASSA-PSS operations.
5721a8e1175bSopenharmony_ci   * Reading of Public Key files incorporated into default x509
5722a8e1175bSopenharmony_ci     functionality as well.
5723a8e1175bSopenharmony_ci   * Added mpi_fill_random() for centralized filling of big numbers
5724a8e1175bSopenharmony_ci     with random data (Fixed ticket #10)
5725a8e1175bSopenharmony_ci
5726a8e1175bSopenharmony_ciChanges
5727a8e1175bSopenharmony_ci   * Debug print of MPI now removes leading zero octets and
5728a8e1175bSopenharmony_ci     displays actual bit size of the value.
5729a8e1175bSopenharmony_ci   * x509parse_key() (and as a consequence x509parse_keyfile())
5730a8e1175bSopenharmony_ci     does not zeroize memory in advance anymore. Use rsa_init()
5731a8e1175bSopenharmony_ci     before parsing a key or keyfile!
5732a8e1175bSopenharmony_ci
5733a8e1175bSopenharmony_ciBugfix
5734a8e1175bSopenharmony_ci   * Debug output of MPI's now the same independent of underlying
5735a8e1175bSopenharmony_ci     platform (32-bit / 64-bit) (Fixes ticket #19, found by Mads
5736a8e1175bSopenharmony_ci     Kiilerich and Mihai Militaru)
5737a8e1175bSopenharmony_ci   * Fixed bug in ssl_write() when flushing old data (Fixed ticket
5738a8e1175bSopenharmony_ci     #18, found by Nikolay Epifanov)
5739a8e1175bSopenharmony_ci   * Fixed proper handling of RSASSA-PSS verification with variable
5740a8e1175bSopenharmony_ci     length salt lengths
5741a8e1175bSopenharmony_ci
5742a8e1175bSopenharmony_ci= Version 0.99-pre3 released on 2011-02-28
5743a8e1175bSopenharmony_ciThis release replaces version 0.99-pre2 which had possible copyright issues.
5744a8e1175bSopenharmony_ciFeatures
5745a8e1175bSopenharmony_ci   * Parsing PEM private keys encrypted with DES and AES
5746a8e1175bSopenharmony_ci     are now supported as well (Fixes ticket #5)
5747a8e1175bSopenharmony_ci   * Added crl_app program to allow easy reading and
5748a8e1175bSopenharmony_ci     printing of X509 CRLs from file
5749a8e1175bSopenharmony_ci
5750a8e1175bSopenharmony_ciChanges
5751a8e1175bSopenharmony_ci   * Parsing of PEM files moved to separate module (Fixes
5752a8e1175bSopenharmony_ci     ticket #13). Also possible to remove PEM support for
5753a8e1175bSopenharmony_ci     systems only using DER encoding
5754a8e1175bSopenharmony_ci
5755a8e1175bSopenharmony_ciBugfixes
5756a8e1175bSopenharmony_ci   * Corrected parsing of UTCTime dates before 1990 and
5757a8e1175bSopenharmony_ci     after 1950
5758a8e1175bSopenharmony_ci   * Support more exotic OID's when parsing certificates
5759a8e1175bSopenharmony_ci     (found by Mads Kiilerich)
5760a8e1175bSopenharmony_ci   * Support more exotic name representations when parsing
5761a8e1175bSopenharmony_ci     certificates (found by Mads Kiilerich)
5762a8e1175bSopenharmony_ci   * Replaced the expired test certificates
5763a8e1175bSopenharmony_ci   * Do not bail out if no client certificate specified. Try
5764a8e1175bSopenharmony_ci     to negotiate anonymous connection (Fixes ticket #12,
5765a8e1175bSopenharmony_ci     found by Boris Krasnovskiy)
5766a8e1175bSopenharmony_ci
5767a8e1175bSopenharmony_ciSecurity fixes
5768a8e1175bSopenharmony_ci   * Fixed a possible Man-in-the-Middle attack on the
5769a8e1175bSopenharmony_ci     Diffie Hellman key exchange (thanks to Larry Highsmith,
5770a8e1175bSopenharmony_ci     Subreption LLC)
5771a8e1175bSopenharmony_ci
5772a8e1175bSopenharmony_ci= Version 0.99-pre1 released on 2011-01-30
5773a8e1175bSopenharmony_ciFeatures
5774a8e1175bSopenharmony_ciNote: Most of these features have been donated by Fox-IT
5775a8e1175bSopenharmony_ci   * Added Doxygen source code documentation parts
5776a8e1175bSopenharmony_ci   * Added reading of DHM context from memory and file
5777a8e1175bSopenharmony_ci   * Improved X509 certificate parsing to include extended
5778a8e1175bSopenharmony_ci     certificate fields, including Key Usage
5779a8e1175bSopenharmony_ci   * Improved certificate verification and verification
5780a8e1175bSopenharmony_ci     against the available CRLs
5781a8e1175bSopenharmony_ci   * Detection for DES weak keys and parity bits added
5782a8e1175bSopenharmony_ci   * Improvements to support integration in other
5783a8e1175bSopenharmony_ci     applications:
5784a8e1175bSopenharmony_ci       + Added generic message digest and cipher wrapper
5785a8e1175bSopenharmony_ci       + Improved information about current capabilities,
5786a8e1175bSopenharmony_ci         status, objects and configuration
5787a8e1175bSopenharmony_ci       + Added verification callback on certificate chain
5788a8e1175bSopenharmony_ci         verification to allow external blacklisting
5789a8e1175bSopenharmony_ci       + Additional example programs to show usage
5790a8e1175bSopenharmony_ci   * Added support for PKCS#11 through the use of the
5791a8e1175bSopenharmony_ci     libpkcs11-helper library
5792a8e1175bSopenharmony_ci
5793a8e1175bSopenharmony_ciChanges
5794a8e1175bSopenharmony_ci   * x509parse_time_expired() checks time in addition to
5795a8e1175bSopenharmony_ci     the existing date check
5796a8e1175bSopenharmony_ci   * The ciphers member of ssl_context and the cipher member
5797a8e1175bSopenharmony_ci     of ssl_session have been renamed to ciphersuites and
5798a8e1175bSopenharmony_ci     ciphersuite respectively. This clarifies the difference
5799a8e1175bSopenharmony_ci     with the generic cipher layer and is better naming
5800a8e1175bSopenharmony_ci     altogether
5801a8e1175bSopenharmony_ci
5802a8e1175bSopenharmony_ci= Version 0.14.0 released on 2010-08-16
5803a8e1175bSopenharmony_ciFeatures
5804a8e1175bSopenharmony_ci   * Added support for SSL_EDH_RSA_AES_128_SHA and
5805a8e1175bSopenharmony_ci     SSL_EDH_RSA_CAMELLIA_128_SHA ciphersuites
5806a8e1175bSopenharmony_ci   * Added compile-time and run-time version information
5807a8e1175bSopenharmony_ci   * Expanded ssl_client2 arguments for more flexibility
5808a8e1175bSopenharmony_ci   * Added support for TLS v1.1
5809a8e1175bSopenharmony_ci
5810a8e1175bSopenharmony_ciChanges
5811a8e1175bSopenharmony_ci   * Made Makefile cleaner
5812a8e1175bSopenharmony_ci   * Removed dependency on rand() in rsa_pkcs1_encrypt().
5813a8e1175bSopenharmony_ci     Now using random fuction provided to function and
5814a8e1175bSopenharmony_ci     changed the prototype of rsa_pkcs1_encrypt(),
5815a8e1175bSopenharmony_ci     rsa_init() and rsa_gen_key().
5816a8e1175bSopenharmony_ci   * Some SSL defines were renamed in order to avoid
5817a8e1175bSopenharmony_ci     future confusion
5818a8e1175bSopenharmony_ci
5819a8e1175bSopenharmony_ciBug fixes
5820a8e1175bSopenharmony_ci   * Fixed CMake out of source build for tests (found by
5821a8e1175bSopenharmony_ci     kkert)
5822a8e1175bSopenharmony_ci   * rsa_check_private() now supports PKCS1v2 keys as well
5823a8e1175bSopenharmony_ci   * Fixed deadlock in rsa_pkcs1_encrypt() on failing random
5824a8e1175bSopenharmony_ci     generator
5825a8e1175bSopenharmony_ci
5826a8e1175bSopenharmony_ci= Version 0.13.1 released on 2010-03-24
5827a8e1175bSopenharmony_ciBug fixes
5828a8e1175bSopenharmony_ci   * Fixed Makefile in library that was mistakenly merged
5829a8e1175bSopenharmony_ci   * Added missing const string fixes
5830a8e1175bSopenharmony_ci
5831a8e1175bSopenharmony_ci= Version 0.13.0 released on 2010-03-21
5832a8e1175bSopenharmony_ciFeatures
5833a8e1175bSopenharmony_ci   * Added option parsing for host and port selection to
5834a8e1175bSopenharmony_ci     ssl_client2
5835a8e1175bSopenharmony_ci   * Added support for GeneralizedTime in X509 parsing
5836a8e1175bSopenharmony_ci   * Added cert_app program to allow easy reading and
5837a8e1175bSopenharmony_ci     printing of X509 certificates from file or SSL
5838a8e1175bSopenharmony_ci     connection.
5839a8e1175bSopenharmony_ci
5840a8e1175bSopenharmony_ciChanges
5841a8e1175bSopenharmony_ci   * Added const correctness for main code base
5842a8e1175bSopenharmony_ci   * X509 signature algorithm determination is now
5843a8e1175bSopenharmony_ci     in a function to allow easy future expansion
5844a8e1175bSopenharmony_ci   * Changed symmetric cipher functions to
5845a8e1175bSopenharmony_ci     identical interface (returning int result values)
5846a8e1175bSopenharmony_ci   * Changed ARC4 to use separate input/output buffer
5847a8e1175bSopenharmony_ci   * Added reset function for HMAC context as speed-up
5848a8e1175bSopenharmony_ci     for specific use-cases
5849a8e1175bSopenharmony_ci
5850a8e1175bSopenharmony_ciBug fixes
5851a8e1175bSopenharmony_ci   * Fixed bug resulting in failure to send the last
5852a8e1175bSopenharmony_ci     certificate in the chain in ssl_write_certificate() and
5853a8e1175bSopenharmony_ci     ssl_write_certificate_request() (found by fatbob)
5854a8e1175bSopenharmony_ci   * Added small fixes for compiler warnings on a Mac
5855a8e1175bSopenharmony_ci     (found by Frank de Brabander)
5856a8e1175bSopenharmony_ci   * Fixed algorithmic bug in mpi_is_prime() (found by
5857a8e1175bSopenharmony_ci     Smbat Tonoyan)
5858a8e1175bSopenharmony_ci
5859a8e1175bSopenharmony_ci= Version 0.12.1 released on 2009-10-04
5860a8e1175bSopenharmony_ciChanges
5861a8e1175bSopenharmony_ci   * Coverage test definitions now support 'depends_on'
5862a8e1175bSopenharmony_ci     tagging system.
5863a8e1175bSopenharmony_ci   * Tests requiring specific hashing algorithms now honor
5864a8e1175bSopenharmony_ci     the defines.
5865a8e1175bSopenharmony_ci
5866a8e1175bSopenharmony_ciBug fixes
5867a8e1175bSopenharmony_ci   * Changed typo in #ifdef in x509parse.c (found
5868a8e1175bSopenharmony_ci     by Eduardo)
5869a8e1175bSopenharmony_ci
5870a8e1175bSopenharmony_ci= Version 0.12.0 released on 2009-07-28
5871a8e1175bSopenharmony_ciFeatures
5872a8e1175bSopenharmony_ci   * Added CMake makefiles as alternative to regular Makefiles.
5873a8e1175bSopenharmony_ci   * Added preliminary Code Coverage tests for AES, ARC4,
5874a8e1175bSopenharmony_ci     Base64, MPI, SHA-family, MD-family, HMAC-SHA-family,
5875a8e1175bSopenharmony_ci     Camellia, DES, 3-DES, RSA PKCS#1, XTEA, Diffie-Hellman
5876a8e1175bSopenharmony_ci     and X509parse.
5877a8e1175bSopenharmony_ci
5878a8e1175bSopenharmony_ciChanges
5879a8e1175bSopenharmony_ci   * Error codes are not (necessarily) negative. Keep
5880a8e1175bSopenharmony_ci     this is mind when checking for errors.
5881a8e1175bSopenharmony_ci   * RSA_RAW renamed to SIG_RSA_RAW for consistency.
5882a8e1175bSopenharmony_ci   * Fixed typo in name of POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE.
5883a8e1175bSopenharmony_ci   * Changed interface for AES and Camellia setkey functions
5884a8e1175bSopenharmony_ci     to indicate invalid key lengths.
5885a8e1175bSopenharmony_ci
5886a8e1175bSopenharmony_ciBug fixes
5887a8e1175bSopenharmony_ci   * Fixed include location of endian.h on FreeBSD (found by
5888a8e1175bSopenharmony_ci     Gabriel)
5889a8e1175bSopenharmony_ci   * Fixed include location of endian.h and name clash on
5890a8e1175bSopenharmony_ci     Apples (found by Martin van Hensbergen)
5891a8e1175bSopenharmony_ci   * Fixed HMAC-MD2 by modifying md2_starts(), so that the
5892a8e1175bSopenharmony_ci     required HMAC ipad and opad variables are not cleared.
5893a8e1175bSopenharmony_ci     (found by code coverage tests)
5894a8e1175bSopenharmony_ci   * Prevented use of long long in bignum if
5895a8e1175bSopenharmony_ci     POLARSSL_HAVE_LONGLONG not defined (found by Giles
5896a8e1175bSopenharmony_ci     Bathgate).
5897a8e1175bSopenharmony_ci   * Fixed incorrect handling of negative strings in
5898a8e1175bSopenharmony_ci     mpi_read_string() (found by code coverage tests).
5899a8e1175bSopenharmony_ci   * Fixed segfault on handling empty rsa_context in
5900a8e1175bSopenharmony_ci     rsa_check_pubkey() and rsa_check_privkey() (found by
5901a8e1175bSopenharmony_ci     code coverage tests).
5902a8e1175bSopenharmony_ci   * Fixed incorrect handling of one single negative input
5903a8e1175bSopenharmony_ci     value in mpi_add_abs() (found by code coverage tests).
5904a8e1175bSopenharmony_ci   * Fixed incorrect handling of negative first input
5905a8e1175bSopenharmony_ci     value in mpi_sub_abs() (found by code coverage tests).
5906a8e1175bSopenharmony_ci   * Fixed incorrect handling of negative first input
5907a8e1175bSopenharmony_ci     value in mpi_mod_mpi() and mpi_mod_int(). Resulting
5908a8e1175bSopenharmony_ci     change also affects mpi_write_string() (found by code
5909a8e1175bSopenharmony_ci     coverage tests).
5910a8e1175bSopenharmony_ci   * Corrected is_prime() results for 0, 1 and 2 (found by
5911a8e1175bSopenharmony_ci     code coverage tests).
5912a8e1175bSopenharmony_ci   * Fixed Camellia and XTEA for 64-bit Windows systems.
5913a8e1175bSopenharmony_ci
5914a8e1175bSopenharmony_ci= Version 0.11.1 released on 2009-05-17
5915a8e1175bSopenharmony_ci   * Fixed missing functionality for SHA-224, SHA-256, SHA384,
5916a8e1175bSopenharmony_ci     SHA-512 in rsa_pkcs1_sign()
5917a8e1175bSopenharmony_ci
5918a8e1175bSopenharmony_ci= Version 0.11.0 released on 2009-05-03
5919a8e1175bSopenharmony_ci   * Fixed a bug in mpi_gcd() so that it also works when both
5920a8e1175bSopenharmony_ci     input numbers are even and added testcases to check
5921a8e1175bSopenharmony_ci     (found by Pierre Habouzit).
5922a8e1175bSopenharmony_ci   * Added support for SHA-224, SHA-256, SHA-384 and SHA-512
5923a8e1175bSopenharmony_ci     one way hash functions with the PKCS#1 v1.5 signing and
5924a8e1175bSopenharmony_ci     verification.
5925a8e1175bSopenharmony_ci   * Fixed minor bug regarding mpi_gcd located within the
5926a8e1175bSopenharmony_ci     POLARSSL_GENPRIME block.
5927a8e1175bSopenharmony_ci   * Fixed minor memory leak in x509parse_crt() and added better
5928a8e1175bSopenharmony_ci     handling of 'full' certificate chains (found by Mathias
5929a8e1175bSopenharmony_ci     Olsson).
5930a8e1175bSopenharmony_ci   * Centralized file opening and reading for x509 files into
5931a8e1175bSopenharmony_ci     load_file()
5932a8e1175bSopenharmony_ci   * Made definition of net_htons() endian-clean for big endian
5933a8e1175bSopenharmony_ci     systems (Found by Gernot).
5934a8e1175bSopenharmony_ci   * Undefining POLARSSL_HAVE_ASM now also handles prevents asm in
5935a8e1175bSopenharmony_ci     padlock and timing code.
5936a8e1175bSopenharmony_ci   * Fixed an off-by-one buffer allocation in ssl_set_hostname()
5937a8e1175bSopenharmony_ci     responsible for crashes and unwanted behaviour.
5938a8e1175bSopenharmony_ci   * Added support for Certificate Revocation List (CRL) parsing.
5939a8e1175bSopenharmony_ci   * Added support for CRL revocation to x509parse_verify() and
5940a8e1175bSopenharmony_ci     SSL/TLS code.
5941a8e1175bSopenharmony_ci   * Fixed compatibility of XTEA and Camellia on a 64-bit system
5942a8e1175bSopenharmony_ci     (found by Felix von Leitner).
5943a8e1175bSopenharmony_ci
5944a8e1175bSopenharmony_ci= Version 0.10.0 released on 2009-01-12
5945a8e1175bSopenharmony_ci   * Migrated XySSL to PolarSSL
5946a8e1175bSopenharmony_ci   * Added XTEA symmetric cipher
5947a8e1175bSopenharmony_ci   * Added Camellia symmetric cipher
5948a8e1175bSopenharmony_ci   * Added support for ciphersuites: SSL_RSA_CAMELLIA_128_SHA,
5949a8e1175bSopenharmony_ci     SSL_RSA_CAMELLIA_256_SHA and SSL_EDH_RSA_CAMELLIA_256_SHA
5950a8e1175bSopenharmony_ci   * Fixed dangerous bug that can cause a heap overflow in
5951a8e1175bSopenharmony_ci     rsa_pkcs1_decrypt (found by Christophe Devine)
5952a8e1175bSopenharmony_ci
5953a8e1175bSopenharmony_ci================================================================
5954a8e1175bSopenharmony_ciXySSL ChangeLog
5955a8e1175bSopenharmony_ci
5956a8e1175bSopenharmony_ci= Version 0.9 released on 2008-03-16
5957a8e1175bSopenharmony_ci
5958a8e1175bSopenharmony_ci    * Added support for ciphersuite: SSL_RSA_AES_128_SHA
5959a8e1175bSopenharmony_ci    * Enabled support for large files by default in aescrypt2.c
5960a8e1175bSopenharmony_ci    * Preliminary openssl wrapper contributed by David Barrett
5961a8e1175bSopenharmony_ci    * Fixed a bug in ssl_write() that caused the same payload to
5962a8e1175bSopenharmony_ci      be sent twice in non-blocking mode when send returns EAGAIN
5963a8e1175bSopenharmony_ci    * Fixed ssl_parse_client_hello(): session id and challenge must
5964a8e1175bSopenharmony_ci      not be swapped in the SSLv2 ClientHello (found by Greg Robson)
5965a8e1175bSopenharmony_ci    * Added user-defined callback debug function (Krystian Kolodziej)
5966a8e1175bSopenharmony_ci    * Before freeing a certificate, properly zero out all cert. data
5967a8e1175bSopenharmony_ci    * Fixed the "mode" parameter so that encryption/decryption are
5968a8e1175bSopenharmony_ci      not swapped on PadLock; also fixed compilation on older versions
5969a8e1175bSopenharmony_ci      of gcc (bug reported by David Barrett)
5970a8e1175bSopenharmony_ci    * Correctly handle the case in padlock_xcryptcbc() when input or
5971a8e1175bSopenharmony_ci      output data is non-aligned by falling back to the software
5972a8e1175bSopenharmony_ci      implementation, as VIA Nehemiah cannot handle non-aligned buffers
5973a8e1175bSopenharmony_ci    * Fixed a memory leak in x509parse_crt() which was reported by Greg
5974a8e1175bSopenharmony_ci      Robson-Garth; some x509write.c fixes by Pascal Vizeli, thanks to
5975a8e1175bSopenharmony_ci      Matthew Page who reported several bugs
5976a8e1175bSopenharmony_ci    * Fixed x509_get_ext() to accept some rare certificates which have
5977a8e1175bSopenharmony_ci      an INTEGER instead of a BOOLEAN for BasicConstraints::cA.
5978a8e1175bSopenharmony_ci    * Added support on the client side for the TLS "hostname" extension
5979a8e1175bSopenharmony_ci      (patch contributed by David Patino)
5980a8e1175bSopenharmony_ci    * Make x509parse_verify() return BADCERT_CN_MISMATCH when an empty
5981a8e1175bSopenharmony_ci      string is passed as the CN (bug reported by spoofy)
5982a8e1175bSopenharmony_ci    * Added an option to enable/disable the BN assembly code
5983a8e1175bSopenharmony_ci    * Updated rsa_check_privkey() to verify that (D*E) = 1 % (P-1)*(Q-1)
5984a8e1175bSopenharmony_ci    * Disabled obsolete hash functions by default (MD2, MD4); updated
5985a8e1175bSopenharmony_ci      selftest and benchmark to not test ciphers that have been disabled
5986a8e1175bSopenharmony_ci    * Updated x509parse_cert_info() to correctly display byte 0 of the
5987a8e1175bSopenharmony_ci      serial number, setup correct server port in the ssl client example
5988a8e1175bSopenharmony_ci    * Fixed a critical denial-of-service with X.509 cert. verification:
5989a8e1175bSopenharmony_ci      peer may cause xyssl to loop indefinitely by sending a certificate
5990a8e1175bSopenharmony_ci      for which the RSA signature check fails (bug reported by Benoit)
5991a8e1175bSopenharmony_ci    * Added test vectors for: AES-CBC, AES-CFB, DES-CBC and 3DES-CBC,
5992a8e1175bSopenharmony_ci      HMAC-MD5, HMAC-SHA1, HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512
5993a8e1175bSopenharmony_ci    * Fixed HMAC-SHA-384 and HMAC-SHA-512 (thanks to Josh Sinykin)
5994a8e1175bSopenharmony_ci    * Modified ssl_parse_client_key_exchange() to protect against
5995a8e1175bSopenharmony_ci      Daniel Bleichenbacher attack on PKCS#1 v1.5 padding, as well
5996a8e1175bSopenharmony_ci      as the Klima-Pokorny-Rosa extension of Bleichenbacher's attack
5997a8e1175bSopenharmony_ci    * Updated rsa_gen_key() so that ctx->N is always nbits in size
5998a8e1175bSopenharmony_ci    * Fixed assembly PPC compilation errors on Mac OS X, thanks to
5999a8e1175bSopenharmony_ci      David Barrett and Dusan Semen
6000a8e1175bSopenharmony_ci
6001a8e1175bSopenharmony_ci= Version 0.8 released on 2007-10-20
6002a8e1175bSopenharmony_ci
6003a8e1175bSopenharmony_ci    * Modified the HMAC functions to handle keys larger
6004a8e1175bSopenharmony_ci      than 64 bytes, thanks to Stephane Desneux and gary ng
6005a8e1175bSopenharmony_ci    * Fixed ssl_read_record() to properly update the handshake
6006a8e1175bSopenharmony_ci      message digests, which fixes IE6/IE7 client authentication
6007a8e1175bSopenharmony_ci    * Cleaned up the XYSSL* #defines, suggested by Azriel Fasten
6008a8e1175bSopenharmony_ci    * Fixed net_recv(), thanks to Lorenz Schori and Egon Kocjan
6009a8e1175bSopenharmony_ci    * Added user-defined callbacks for handling I/O and sessions
6010a8e1175bSopenharmony_ci    * Added lots of debugging output in the SSL/TLS functions
6011a8e1175bSopenharmony_ci    * Added preliminary X.509 cert. writing by Pascal Vizeli
6012a8e1175bSopenharmony_ci    * Added preliminary support for the VIA PadLock routines
6013a8e1175bSopenharmony_ci    * Added AES-CFB mode of operation, contributed by chmike
6014a8e1175bSopenharmony_ci    * Added an SSL/TLS stress testing program (ssl_test.c)
6015a8e1175bSopenharmony_ci    * Updated the RSA PKCS#1 code to allow choosing between
6016a8e1175bSopenharmony_ci      RSA_PUBLIC and RSA_PRIVATE, as suggested by David Barrett
6017a8e1175bSopenharmony_ci    * Updated ssl_read() to skip 0-length records from OpenSSL
6018a8e1175bSopenharmony_ci    * Fixed the make install target to comply with *BSD make
6019a8e1175bSopenharmony_ci    * Fixed a bug in mpi_read_binary() on 64-bit platforms
6020a8e1175bSopenharmony_ci    * mpi_is_prime() speedups, thanks to Kevin McLaughlin
6021a8e1175bSopenharmony_ci    * Fixed a long standing memory leak in mpi_is_prime()
6022a8e1175bSopenharmony_ci    * Replaced realloc with malloc in mpi_grow(), and set
6023a8e1175bSopenharmony_ci      the sign of zero as positive in mpi_init() (reported
6024a8e1175bSopenharmony_ci      by Jonathan M. McCune)
6025a8e1175bSopenharmony_ci
6026a8e1175bSopenharmony_ci= Version 0.7 released on 2007-07-07
6027a8e1175bSopenharmony_ci
6028a8e1175bSopenharmony_ci    * Added support for the MicroBlaze soft-core processor
6029a8e1175bSopenharmony_ci    * Fixed a bug in ssl_tls.c which sometimes prevented SSL
6030a8e1175bSopenharmony_ci      connections from being established with non-blocking I/O
6031a8e1175bSopenharmony_ci    * Fixed a couple bugs in the VS6 and UNIX Makefiles
6032a8e1175bSopenharmony_ci    * Fixed the "PIC register ebx clobbered in asm" bug
6033a8e1175bSopenharmony_ci    * Added HMAC starts/update/finish support functions
6034a8e1175bSopenharmony_ci    * Added the SHA-224, SHA-384 and SHA-512 hash functions
6035a8e1175bSopenharmony_ci    * Fixed the net_set_*block routines, thanks to Andreas
6036a8e1175bSopenharmony_ci    * Added a few demonstration programs: md5sum, sha1sum,
6037a8e1175bSopenharmony_ci      dh_client, dh_server, rsa_genkey, rsa_sign, rsa_verify
6038a8e1175bSopenharmony_ci    * Added new bignum import and export helper functions
6039a8e1175bSopenharmony_ci    * Rewrote README.txt in program/ssl/ca to better explain
6040a8e1175bSopenharmony_ci      how to create a test PKI
6041a8e1175bSopenharmony_ci
6042a8e1175bSopenharmony_ci= Version 0.6 released on 2007-04-01
6043a8e1175bSopenharmony_ci
6044a8e1175bSopenharmony_ci    * Ciphers used in SSL/TLS can now be disabled at compile
6045a8e1175bSopenharmony_ci      time, to reduce the memory footprint on embedded systems
6046a8e1175bSopenharmony_ci    * Added multiply assembly code for the TriCore and modified
6047a8e1175bSopenharmony_ci      havege_struct for this processor, thanks to David Patiño
6048a8e1175bSopenharmony_ci    * Added multiply assembly code for 64-bit PowerPCs,
6049a8e1175bSopenharmony_ci      thanks to Peking University and the OSU Open Source Lab
6050a8e1175bSopenharmony_ci    * Added experimental support of Quantum Cryptography
6051a8e1175bSopenharmony_ci    * Added support for autoconf, contributed by Arnaud Cornet
6052a8e1175bSopenharmony_ci    * Fixed "long long" compilation issues on IA-64 and PPC64
6053a8e1175bSopenharmony_ci    * Fixed a bug introduced in xyssl-0.5/timing.c: hardclock
6054a8e1175bSopenharmony_ci      was not being correctly defined on ARM and MIPS
6055a8e1175bSopenharmony_ci
6056a8e1175bSopenharmony_ci= Version 0.5 released on 2007-03-01
6057a8e1175bSopenharmony_ci
6058a8e1175bSopenharmony_ci    * Added multiply assembly code for SPARC and Alpha
6059a8e1175bSopenharmony_ci    * Added (beta) support for non-blocking I/O operations
6060a8e1175bSopenharmony_ci    * Implemented session resuming and client authentication
6061a8e1175bSopenharmony_ci    * Fixed some portability issues on WinCE, MINIX 3, Plan9
6062a8e1175bSopenharmony_ci      (thanks to Benjamin Newman), HP-UX, FreeBSD and Solaris
6063a8e1175bSopenharmony_ci    * Improved the performance of the EDH key exchange
6064a8e1175bSopenharmony_ci    * Fixed a bug that caused valid packets with a payload
6065a8e1175bSopenharmony_ci      size of 16384 bytes to be rejected
6066a8e1175bSopenharmony_ci
6067a8e1175bSopenharmony_ci= Version 0.4 released on 2007-02-01
6068a8e1175bSopenharmony_ci
6069a8e1175bSopenharmony_ci    * Added support for Ephemeral Diffie-Hellman key exchange
6070a8e1175bSopenharmony_ci    * Added multiply asm code for SSE2, ARM, PPC, MIPS and M68K
6071a8e1175bSopenharmony_ci    * Various improvement to the modular exponentiation code
6072a8e1175bSopenharmony_ci    * Rewrote the headers to generate the API docs with doxygen
6073a8e1175bSopenharmony_ci    * Fixed a bug in ssl_encrypt_buf (incorrect padding was
6074a8e1175bSopenharmony_ci      generated) and in ssl_parse_client_hello (max. client
6075a8e1175bSopenharmony_ci      version was not properly set), thanks to Didier Rebeix
6076a8e1175bSopenharmony_ci    * Fixed another bug in ssl_parse_client_hello: clients with
6077a8e1175bSopenharmony_ci      cipherlists larger than 96 bytes were incorrectly rejected
6078a8e1175bSopenharmony_ci    * Fixed a couple memory leak in x509_read.c
6079a8e1175bSopenharmony_ci
6080a8e1175bSopenharmony_ci= Version 0.3 released on 2007-01-01
6081a8e1175bSopenharmony_ci
6082a8e1175bSopenharmony_ci    * Added server-side SSLv3 and TLSv1.0 support
6083a8e1175bSopenharmony_ci    * Multiple fixes to enhance the compatibility with g++,
6084a8e1175bSopenharmony_ci      thanks to Xosé Antón Otero Ferreira
6085a8e1175bSopenharmony_ci    * Fixed a bug in the CBC code, thanks to dowst; also,
6086a8e1175bSopenharmony_ci      the bignum code is no longer dependent on long long
6087a8e1175bSopenharmony_ci    * Updated rsa_pkcs1_sign to handle arbitrary large inputs
6088a8e1175bSopenharmony_ci    * Updated timing.c for improved compatibility with i386
6089a8e1175bSopenharmony_ci      and 486 processors, thanks to Arnaud Cornet
6090a8e1175bSopenharmony_ci
6091a8e1175bSopenharmony_ci= Version 0.2 released on 2006-12-01
6092a8e1175bSopenharmony_ci
6093a8e1175bSopenharmony_ci    * Updated timing.c to support ARM and MIPS arch
6094a8e1175bSopenharmony_ci    * Updated the MPI code to support 8086 on MSVC 1.5
6095a8e1175bSopenharmony_ci    * Added the copyright notice at the top of havege.h
6096a8e1175bSopenharmony_ci    * Fixed a bug in sha2_hmac, thanks to newsoft/Wenfang Zhang
6097a8e1175bSopenharmony_ci    * Fixed a bug reported by Adrian Rüegsegger in x509_read_key
6098a8e1175bSopenharmony_ci    * Fixed a bug reported by Torsten Lauter in ssl_read_record
6099a8e1175bSopenharmony_ci    * Fixed a bug in rsa_check_privkey that would wrongly cause
6100a8e1175bSopenharmony_ci      valid RSA keys to be dismissed (thanks to oldwolf)
6101a8e1175bSopenharmony_ci    * Fixed a bug in mpi_is_prime that caused some primes to fail
6102a8e1175bSopenharmony_ci      the Miller-Rabin primality test
6103a8e1175bSopenharmony_ci
6104a8e1175bSopenharmony_ci    I'd also like to thank Younès Hafri for the CRUX linux port,
6105a8e1175bSopenharmony_ci    Khalil Petit who added XySSL into pkgsrc and Arnaud Cornet
6106a8e1175bSopenharmony_ci    who maintains the Debian package :-)
6107a8e1175bSopenharmony_ci
6108a8e1175bSopenharmony_ci= Version 0.1 released on 2006-11-01
6109