blob: 2257a615d3fe7633554a2b3f8e941719517714c0 [file] [log] [blame] [view]
Ron Eldorea24d752017-08-31 17:02:01 +03001Contributing
2============
Ron Eldorb5e6a772017-08-16 11:23:31 +03003We gratefully accept bug reports and contributions from the community. There are some requirements we need to fulfill in order to be able to integrate contributions:
4
Ron Eldor7f888982017-08-16 16:05:52 +03005 - As with any open source project, contributions will be reviewed by the project team and community and may need some modifications to be accepted.
6 - The contribution should not break API or ABI, unless there is a real justification for that. If there is an API change, the contribution, if accepted, will be merged only when there will be a major release.
7
Ron Eldorea24d752017-08-31 17:02:01 +03008Contributor License Agreement (CLA)
9-----------------------------------
Ron Eldorb2231fc2017-09-10 17:32:05 +030010- All contributions, whether large or small, require a Contributor's License Agreement (CLA) to be accepted. This is because source code can possibly fall under copyright law and we need your consent to share in the ownership of the copyright.
11- To accept the Contributor’s License Agreement (CLA), individual contributors can do this by creating an Mbed account and [accepting the online agreement here with a click through](https://developer.mbed.org/contributor_agreement/). Alternatively, for contributions from corporations, or those that do not wish to create an Mbed account, a slightly different agreement can be found [here](https://www.mbed.com/en/about-mbed/contributor-license-agreements/). This agreement should be signed and returned to Arm as described in the instructions given.
Ron Eldor7f888982017-08-16 16:05:52 +030012
Ron Eldorea24d752017-08-31 17:02:01 +030013Coding Standards
14----------------
Ron Eldorb2231fc2017-09-10 17:32:05 +030015- We would ask that contributions conform to [our coding standards](https://tls.mbed.org/kb/development/mbedtls-coding-standards), and that contributions are fully tested before submission, as mentioned in the [Tests](#tests) and [Continuous Integration](#continuous-integration-tests) sections.
Ron Eldor7f888982017-08-16 16:05:52 +030016- The code should be written in a clean and readable style.
17- The code should be written in a portable generic way, that will benefit the whole community, and not only your own needs.
Ron Eldorea24d752017-08-31 17:02:01 +030018- The code should be secure, and will be reviewed from a security point of view as well.
Ron Eldorb5e6a772017-08-16 11:23:31 +030019
Ron Eldorea24d752017-08-31 17:02:01 +030020Making a Contribution
21---------------------
Ron Eldorb5e6a772017-08-16 11:23:31 +0300221. [Check for open issues](https://github.com/ARMmbed/mbedtls/issues) or [start a discussion](https://tls.mbed.org/discussions) around a feature idea or a bug.
Ron Eldorb2231fc2017-09-10 17:32:05 +0300231. Fork the [Mbed TLS repository on GitHub](https://github.com/ARMmbed/mbedtls) to start making your changes. As a general rule, you should use the ["development" branch](https://github.com/ARMmbed/mbedtls/tree/development) as a basis.
Ron Eldorea24d752017-08-31 17:02:01 +0300241. Write a test which shows that the bug was fixed or that the feature works as expected.
Ron Eldorb2231fc2017-09-10 17:32:05 +0300251. Send a pull request (PR) and work with us until it gets merged and published. Contributions may need some modifications, so a few rounds of review and fixing may be necessary. We will include your name in the ChangeLog :)
Ron Eldorea24d752017-08-31 17:02:01 +0300261. For quick merging, the contribution should be short, and concentrated on a single feature or topic. The larger the contribution is, the longer it would take to review it and merge it.
Ron Eldorb2231fc2017-09-10 17:32:05 +0300271. Mbed TLS is released under the Apache license, and as such, all the added files should include the Apache license header.
Ron Eldorb5e6a772017-08-16 11:23:31 +030028
Simon Butcherd50f7862018-07-03 16:11:44 +010029Long Term Support Branches
30--------------------------
31Mbed TLS maintains several LTS (Long Term Support) branches, which are maintained continuously for a given period. The LTS branches are provided to allow users of the library to have a maintained version of the library which contains security fixes and fixes for other defects, without encountering any API changes or requiring changes in their own code. To allow users to take advantage of the LTS branches, these branches maintain backwards compatibility for both the public API and ABI.
Ron Eldorb5e6a772017-08-16 11:23:31 +030032
Simon Butcherd50f7862018-07-03 16:11:44 +010033When backporting to these branches please observe the following rules:
34
35 1. Generally, all changes to the library which change the API cannot be backported.
36 2. All bug fixes must be backported to the LTS branches if they correct a defect in an LTS branch. If a bug fix introduces a change to the API such as a new function, the fix should be reworked to avoid the API change. API changes without very strong justification are unlikely to be accepted.
37 3. If a contribution is a new feature or enhancement, no backporting is required. Exceptions to this may be addtional test cases or quality improvements such as changes to scripts.
38
39It would be highly appreciated if contributions are backported to LTS branches in addition to the [development branch](https://github.com/ARMmbed/mbedtls/tree/development).
40
41Currently maintained LTS branches are:
42
Ron Eldorea24d752017-08-31 17:02:01 +0300431. [mbedtls-2.1](https://github.com/ARMmbed/mbedtls/tree/mbedtls-2.1)
Simon Butcherd50f7862018-07-03 16:11:44 +0100441. [mbedtls-2.7](https://github.com/ARMmbed/mbedtls/tree/mbedtls-2.7)
Ron Eldorb5e6a772017-08-16 11:23:31 +030045
Ron Eldorea24d752017-08-31 17:02:01 +030046Tests
47-----
Ron Eldorb2231fc2017-09-10 17:32:05 +030048As mentioned, tests that show the correctness of the feature or bug fix should be added to the pull request, if no such tests exist.
49Mbed TLS includes an elaborate test suite in `tests/` that initially requires Perl to generate the tests files (e.g. `test_suite_mpi.c`). These files are generated from a `function file` (e.g. `suites/test_suite_mpi.function`) and a `data file` (e.g. `suites/test_suite_mpi.data`). The function file contains the test functions. The data file contains the test cases, specified as parameters that will be passed to the test function.
Ron Eldorb5e6a772017-08-16 11:23:31 +030050
Ron Eldor7f888982017-08-16 16:05:52 +030051Sample applications, if needed, should be modified as well.
52
Ron Eldorea24d752017-08-31 17:02:01 +030053Continuous Integration Tests
54----------------------------
Ron Eldor7f888982017-08-16 16:05:52 +030055Once a PR has been made, the Continuous Integration (CI) tests are triggered and run. You should follow the result of the CI tests, and fix failures.
Ron Eldor1680d3d2017-08-16 17:28:21 +030056It is advised to enable the [githooks scripts](https://github.com/ARMmbed/mbedtls/tree/development/tests/git-scripts) prior to pushing your changes, for catching some of the issues as early as possible.
Ron Eldor7f888982017-08-16 16:05:52 +030057
Ron Eldorea24d752017-08-31 17:02:01 +030058Documentation
59-------------
Ron Eldorb2231fc2017-09-10 17:32:05 +030060Mbed TLS should be well documented. If documentation is needed, speak out!
Ron Eldor7f888982017-08-16 16:05:52 +030061
621. All interfaces should be documented through Doxygen. New APIs should introduce Doxygen documentation.
Ron Eldorea24d752017-08-31 17:02:01 +0300631. Complex parts in the code should include comments.
641. If needed, a Readme file is advised.
651. If a [Knowledge Base (KB)](https://tls.mbed.org/kb) article should be added, write this as a comment in the PR description.
661. A [ChangeLog](https://github.com/ARMmbed/mbedtls/blob/development/ChangeLog) entry should be added for this contribution.