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