blob: 20503c33174ca3a7427bda4a71648699c8d40018 [file] [log] [blame] [view]
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +02001# mbed TLS
2
Simon Butcherdf819242015-08-19 19:33:27 +01003mbed TLS (formerly known as PolarSSL) makes it trivially easy for developers to include cryptographic and SSL/TLS capabilities in their embedded products, with a minimal code footprint. It offers an SSL library with an intuitive API and readable source code.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +02004
Simon Butcherdf819242015-08-19 19:33:27 +01005The Beta release of mbed TLS integrates the mbed TLS library into mbed OS, mbed SDK and yotta. This is a preview release intended for evaluation only and is **not recommended for deployment**. This implementation currently implements no secure source of random numbers, weakening it's security.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +02006
7## Sample programs
8
9This release includes the following examples:
10
Simon Butcherdf819242015-08-19 19:33:27 +0100111. [**TLS client:**](https://github.com/ARMmbed/mbedtls/blob/development/yotta/data/example-tls-client) found in `test/example-tls-client`, downloads a test file from an HTTPS server and looks for a specific string in that file.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020012
Simon Butcherdf819242015-08-19 19:33:27 +0100132. [**Self test:**](https://github.com/ARMmbed/mbedtls/blob/development/yotta/data/example-selftest) found in `test/example-selftest`, tests different basic functions in the mbed TLS library.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020014
Simon Butcherdf819242015-08-19 19:33:27 +0100153. [**Benchmark:**](https://github.com/ARMmbed/mbedtls/blob/development/yotta/data/example-benchmark) found in `test/example-benchmark`, measures the time taken to perform basic cryptographic functions used in the library.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020016
Simon Butcherdf819242015-08-19 19:33:27 +010017These examples are integrated as yotta tests so that they are built automatically when you build mbed TLS. You'll find other examples in the various `test/example-*` directories alongside these examples.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020018
19## Running TLS
20
Simon Butcherdf819242015-08-19 19:33:27 +010021Please follow the instructions in the [TLS client sample](https://github.com/ARMmbed/mbedtls/blob/development/yotta/data/example-tls-client) directory, to build and run the example. These include a list of prerequisites and an explanation of building mbed TLS with yotta.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020022
Manuel Pégourié-Gonnard32da9f62015-07-31 15:52:30 +020023## Configuring mbed TLS features
24
Simon Butcherdf819242015-08-19 19:33:27 +010025mbed TLS makes it easy to disable any feature during compilation that isn't required for a particular project. The default configuration enables all modern and widely-used features which should meet the needs of new projects and disables all features that are older or less common, to minimise the code footprint. The list of available compilation flags is available in the fully documented [config.h file](https://github.com/ARMmbed/mbedtls/blob/development/include/mbedtls/config.h), present in the `mbedtls` directory of the yotta module.
Manuel Pégourié-Gonnard32da9f62015-07-31 15:52:30 +020026
Simon Butcherdf819242015-08-19 19:33:27 +010027Should you need to adjust those flags, you can provide your own configuration file with suitable `#define` and `#undef` statements, to be included between the default definitions and the sanity checks. This file should be in your application's include directory and can be named freely; you just need to let mbed TLS know the name of the file, by using yotta's [configuration system](http://docs.yottabuild.org/reference/config.html). This name should go in your `config.json`, under mbedtls, as the key `user-config-file`, for example:
Manuel Pégourié-Gonnard32da9f62015-07-31 15:52:30 +020028
29 {
30 "mbedtls": {
31 "user-config-file": "\"myapp/my_mbedtls_config_changes.h\""
32 }
33 }
34
35Please note you need to provide the exact name that will be used in the `#include` directive, including the `<>` or quotes around the name.
36
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020037## Contributing
38
Simon Butcherdf819242015-08-19 19:33:27 +010039We gratefully accept bugs and contributions from the community. There are some requirements we need to fulfil in order to be able to integrate contributions:
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020040
Manuel Pégourié-Gonnard324fc022015-08-20 11:51:53 +020041* Simple bug fixes to existing code do not contain copyright themselves and we can integrate without issue. The same is true of trivial contributions.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020042
Simon Butcherdf819242015-08-19 19:33:27 +010043* For larger contributions, such as a new feature, the code can possibly fall under copyright law. We then need your consent to share in the ownership of the copyright. We have a form for this, which we will mail to you in case you submit a contribution or pull request that we deem this necessary for.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020044
45To contribute, please:
46
47* [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.
48
Manuel Pégourié-Gonnard324fc022015-08-20 11:51:53 +020049* 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 as a basis.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020050
51* Write a test that shows that the bug was fixed or that the feature works as expected.
52
53* Send a pull request and bug us until it gets merged and published. We will include your name in the ChangeLog :)