1a8e1175bSopenharmony_ci# Maintained branches
2a8e1175bSopenharmony_ci
3a8e1175bSopenharmony_ciAt any point in time, we have a number of maintained branches, currently consisting of:
4a8e1175bSopenharmony_ci
5a8e1175bSopenharmony_ci- The [`main`](https://github.com/Mbed-TLS/mbedtls/tree/main) branch:
6a8e1175bSopenharmony_ci  this always contains the latest release, including all publicly available
7a8e1175bSopenharmony_ci  security fixes.
8a8e1175bSopenharmony_ci- The [`development`](https://github.com/Mbed-TLS/mbedtls/tree/development) branch:
9a8e1175bSopenharmony_ci  this is where the next major version of Mbed TLS (version 4.0) is being
10a8e1175bSopenharmony_ci  prepared. It has API changes that make it incompatible with Mbed TLS 3.x,
11a8e1175bSopenharmony_ci  as well as all the new features and bug fixes and security fixes.
12a8e1175bSopenharmony_ci- One or more long-time support (LTS) branches: these only get bug fixes and
13a8e1175bSopenharmony_ci  security fixes. Currently, the supported LTS branches are:
14a8e1175bSopenharmony_ci- [`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28).
15a8e1175bSopenharmony_ci- [`mbedtls-3.6`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-3.6).
16a8e1175bSopenharmony_ci
17a8e1175bSopenharmony_ciWe retain a number of historical branches, whose names are prefixed by `archive/`,
18a8e1175bSopenharmony_cisuch as [`archive/mbedtls-2.7`](https://github.com/Mbed-TLS/mbedtls/tree/archive/mbedtls-2.7).
19a8e1175bSopenharmony_ciThese branches will not receive any changes or updates.
20a8e1175bSopenharmony_ci
21a8e1175bSopenharmony_ciWe use [Semantic Versioning](https://semver.org/). In particular, we maintain
22a8e1175bSopenharmony_ciAPI compatibility in the `main` branch across minor version changes (e.g.
23a8e1175bSopenharmony_cithe API of 3.(x+1) is backward compatible with 3.x). We only break API
24a8e1175bSopenharmony_cicompatibility on major version changes (e.g. from 3.x to 4.0). We also maintain
25a8e1175bSopenharmony_ciABI compatibility within LTS branches; see the next section for details.
26a8e1175bSopenharmony_ci
27a8e1175bSopenharmony_ciWe will make regular LTS releases on an 18-month cycle, each of which will have
28a8e1175bSopenharmony_cia 3 year support lifetime. On this basis, 3.6 LTS (released March 2024) will be
29a8e1175bSopenharmony_cisupported until March 2027. The next LTS release will be a 4.x release, which is
30a8e1175bSopenharmony_ciplanned for September 2025.
31a8e1175bSopenharmony_ci
32a8e1175bSopenharmony_ci## Backwards Compatibility for application code
33a8e1175bSopenharmony_ci
34a8e1175bSopenharmony_ciWe maintain API compatibility in released versions of Mbed TLS. If you have
35a8e1175bSopenharmony_cicode that's working and secure with Mbed TLS x.y.z and does not rely on
36a8e1175bSopenharmony_ciundocumented features, then you should be able to re-compile it without
37a8e1175bSopenharmony_cimodification with any later release x.y'.z' with the same major version
38a8e1175bSopenharmony_cinumber, and your code will still build, be secure, and work.
39a8e1175bSopenharmony_ci
40a8e1175bSopenharmony_ciNote that this guarantee only applies if you either use the default
41a8e1175bSopenharmony_cicompile-time configuration (`mbedtls/mbedtls_config.h`) or the same modified
42a8e1175bSopenharmony_cicompile-time configuration. Changing compile-time configuration options can
43a8e1175bSopenharmony_ciresult in an incompatible API or ABI, although features will generally not
44a8e1175bSopenharmony_ciaffect unrelated features (for example, enabling or disabling a
45a8e1175bSopenharmony_cicryptographic algorithm does not break code that does not use that
46a8e1175bSopenharmony_cialgorithm).
47a8e1175bSopenharmony_ci
48a8e1175bSopenharmony_ciNote that new releases of Mbed TLS may extend the API. Here are some
49a8e1175bSopenharmony_ciexamples of changes that are common in minor releases of Mbed TLS, and are
50a8e1175bSopenharmony_cinot considered API compatibility breaks:
51a8e1175bSopenharmony_ci
52a8e1175bSopenharmony_ci* Adding or reordering fields in a structure or union.
53a8e1175bSopenharmony_ci* Removing a field from a structure, unless the field is documented as public.
54a8e1175bSopenharmony_ci* Adding items to an enum.
55a8e1175bSopenharmony_ci* Returning an error code that was not previously documented for a function
56a8e1175bSopenharmony_ci  when a new error condition arises.
57a8e1175bSopenharmony_ci* Changing which error code is returned in a case where multiple error
58a8e1175bSopenharmony_ci  conditions apply.
59a8e1175bSopenharmony_ci* Changing the behavior of a function from failing to succeeding, when the
60a8e1175bSopenharmony_ci  change is a reasonable extension of the current behavior, i.e. the
61a8e1175bSopenharmony_ci  addition of a new feature.
62a8e1175bSopenharmony_ci
63a8e1175bSopenharmony_ciThere are rare exceptions where we break API compatibility: code that was
64a8e1175bSopenharmony_cirelying on something that became insecure in the meantime (for example,
65a8e1175bSopenharmony_cicrypto that was found to be weak) may need to be changed. In case security
66a8e1175bSopenharmony_cicomes in conflict with backwards compatibility, we will put security first,
67a8e1175bSopenharmony_cibut always attempt to provide a compatibility option.
68a8e1175bSopenharmony_ci
69a8e1175bSopenharmony_ci## Backward compatibility for the key store
70a8e1175bSopenharmony_ci
71a8e1175bSopenharmony_ciWe maintain backward compatibility with previous versions of the
72a8e1175bSopenharmony_ciPSA Crypto persistent storage since Mbed TLS 2.25.0, provided that the
73a8e1175bSopenharmony_cistorage backend (PSA ITS implementation) is configured in a compatible way.
74a8e1175bSopenharmony_ciWe intend to maintain this backward compatibility throughout a major version
75a8e1175bSopenharmony_ciof Mbed TLS (for example, all Mbed TLS 3.y versions will be able to read
76a8e1175bSopenharmony_cikeys written under any Mbed TLS 3.x with x <= y).
77a8e1175bSopenharmony_ci
78a8e1175bSopenharmony_ciMbed TLS 3.x can also read keys written by Mbed TLS 2.25.0 through 2.28.x
79a8e1175bSopenharmony_ciLTS, but future major version upgrades (for example from 2.28.x/3.x to 4.y)
80a8e1175bSopenharmony_cimay require the use of an upgrade tool.
81a8e1175bSopenharmony_ci
82a8e1175bSopenharmony_ciNote that this guarantee does not currently fully extend to drivers, which
83a8e1175bSopenharmony_ciare an experimental feature. We intend to maintain compatibility with the
84a8e1175bSopenharmony_cibasic use of drivers from Mbed TLS 2.28.0 onwards, even if driver APIs
85a8e1175bSopenharmony_cichange. However, for more experimental parts of the driver interface, such
86a8e1175bSopenharmony_cias the use of driver state, we do not yet guarantee backward compatibility.
87a8e1175bSopenharmony_ci
88a8e1175bSopenharmony_ci## Long-time support branches
89a8e1175bSopenharmony_ci
90a8e1175bSopenharmony_ciFor the LTS branches, additionally we try very hard to also maintain ABI
91a8e1175bSopenharmony_cicompatibility (same definition as API except with re-linking instead of
92a8e1175bSopenharmony_cire-compiling) and to avoid any increase in code size or RAM usage, or in the
93a8e1175bSopenharmony_ciminimum version of tools needed to build the code. The only exception, as
94a8e1175bSopenharmony_cibefore, is in case those goals would conflict with fixing a security issue, we
95a8e1175bSopenharmony_ciwill put security first but provide a compatibility option. (So far we never
96a8e1175bSopenharmony_cihad to break ABI compatibility in an LTS branch, but we occasionally had to
97a8e1175bSopenharmony_ciincrease code size for a security fix.)
98a8e1175bSopenharmony_ci
99a8e1175bSopenharmony_ciFor contributors, see the [Backwards Compatibility section of
100a8e1175bSopenharmony_ciCONTRIBUTING](CONTRIBUTING.md#backwards-compatibility).
101a8e1175bSopenharmony_ci
102a8e1175bSopenharmony_ci## Current Branches
103a8e1175bSopenharmony_ci
104a8e1175bSopenharmony_ciThe following branches are currently maintained:
105a8e1175bSopenharmony_ci
106a8e1175bSopenharmony_ci- [main](https://github.com/Mbed-TLS/mbedtls/tree/main)
107a8e1175bSopenharmony_ci- [`development`](https://github.com/Mbed-TLS/mbedtls/)
108a8e1175bSopenharmony_ci- [`mbedtls-3.6`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-3.6)
109a8e1175bSopenharmony_ci maintained until March 2027, see
110a8e1175bSopenharmony_ci  <https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.6.0>.
111a8e1175bSopenharmony_ci- [`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28)
112a8e1175bSopenharmony_ci maintained until the end of 2024, see
113a8e1175bSopenharmony_ci  <https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.8>.
114a8e1175bSopenharmony_ci
115a8e1175bSopenharmony_ciUsers are urged to always use the latest version of a maintained branch.
116