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