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