GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing android.googlesource.com — platform/external/mbedtls - Git at Google Bug: 262003926Clone this repo:
README for Mbed TLSMbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols. Its small code footprint makes it suitable for embedded systems. Mbed TLS includes a reference implementation of the PSA Cryptography API. This is currently a preview for evaluation purposes only. ConfigurationMbed TLS should build out of the box on most systems. Some platform specific options are available in the fully documented configuration file Compiler options can be set using conventional environment variables such as We provide some non-standard configurations focused on specific use cases in the DocumentationThe main Mbed TLS documentation is available via ReadTheDocs. Documentation for the PSA Cryptography API is available on GitHub. To generate a local copy of the library documentation in HTML format, tailored to your compile-time configuration:
For other sources of documentation, see the SUPPORT document. CompilingThere are currently three active build systems used within Mbed TLS releases:
The main systems used for development are CMake and GNU Make. Those systems are always complete and up-to-date. The others should reflect all changes present in the CMake and Make build system, although features may not be ported there automatically. The Make and CMake build systems create three libraries: libmbedcrypto, libmbedx509, and libmbedtls. Note that libmbedtls depends on libmbedx509 and libmbedcrypto, and libmbedx509 depends on libmbedcrypto. As a result, some linkers will expect flags to be in a specific order, for example the GNU linker wants Tool versionsYou need the following tools to build the library with the provided makefiles:
Generated source files in the development branchThe source code of Mbed TLS includes some files that are automatically generated by scripts and whose content depends only on the Mbed TLS source, not on the platform or on the library configuration. These files are not included in the development branch of Mbed TLS, but the generated files are included in official releases. This section explains how to generate the missing files in the development branch. The following tools are required:
If you are cross-compiling, you must set the Any of the following methods are available to generate the configuration-independent files:
MakeWe require GNU Make. To build the library and the sample programs, GNU Make and a C compiler are sufficient. Some of the more advanced build targets require some Unix/Linux tools. We intentionally only use a minimum of functionality in the makefiles in order to keep them as simple and independent of different toolchains as possible, to allow users to more easily move between different platforms. Users who need more features are recommended to use CMake. In order to build from the source code using GNU Make, just enter at the command line: make In order to run the tests, enter: make check The tests need Python to be built and Perl to be run. If you don't have one of them installed, you can skip building the tests with: make no_test You'll still be able to run a much smaller set of tests with: programs/test/selftest In order to build for a Windows platform, you should use Setting the variable Please note that setting Depending on your platform, you might run into some issues. Please check the Makefiles in In case you find that you need to do something else as well, please let us know what, so we can add it to the Mbed TLS Knowledge Base. CMakeIn order to build the source using CMake in a separate directory (recommended), just enter at the command line: mkdir /path/to/build_dir && cd /path/to/build_dir cmake /path/to/mbedtls_source cmake --build . In order to run the tests, enter: ctest The test suites need Python to be built and Perl to be executed. If you don‘t have one of these installed, you’ll want to disable the test suites with: cmake -DENABLE_TESTING=Off /path/to/mbedtls_source If you disabled the test suites, but kept the programs enabled, you can still run a much smaller set of tests with: programs/test/selftest To configure CMake for building shared libraries, use: cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On /path/to/mbedtls_source There are many different build modes available within the CMake buildsystem. Most of them are available for gcc and clang, though some are compiler-specific:
Switching build modes in CMake is simple. For debug mode, enter at the command line: cmake -D CMAKE_BUILD_TYPE=Debug /path/to/mbedtls_source To list other available CMake options, use: cmake -LH Note that, with CMake, you can't adjust the compiler or its flags after the initial invocation of cmake. This means that CC=your_cc cmake /path/to/mbedtls_source If you already invoked cmake and want to change those settings, you need to remove the build directory and create it again. Note that it is possible to build in-place; this will however overwrite the provided Makefiles (see cmake . make If you want to change find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} +
You can now make the desired change: CC=your_cc cmake . make Regarding variables, also note that if you set CFLAGS when invoking cmake, your value of CFLAGS doesn‘t override the content provided by cmake (depending on the build mode as seen above), it’s merely prepended to it. Consuming Mbed TLSMbed TLS provides a package config file for consumption as a dependency in other CMake projects. You can include Mbed TLS's CMake targets yourself with: find_package(MbedTLS) If prompted, set
You can then use these directly through add_executable(xyz)
target_link_libraries(xyz
PUBLIC MbedTLS::mbedtls
MbedTLS::mbedcrypto
MbedTLS::mbedx509)
This will link the Mbed TLS libraries to your library or application, and add its include directories to your target (transitively, in the case of Mbed TLS as a subprojectMbed TLS supports being built as a CMake subproject. One can use Microsoft Visual StudioThe build files for Microsoft Visual Studio are generated for Visual Studio 2013. The solution file In the development branch of Mbed TLS, the Visual Studio solution files need to be generated first as described in “Generated source files in the development branch”. Example programsWe've included example programs for a lot of different features and uses in TestsMbed TLS includes an elaborate test suite in For machines with a Unix shell and OpenSSL (and optionally GnuTLS) installed, additional test scripts are available:
Instead of manually installing the required versions of all tools required for testing, it is possible to use the Docker images from our CI systems, as explained in our testing infrastructure repository. Porting Mbed TLSMbed TLS can be ported to many different architectures, OS's and platforms. Before starting a port, you may find the following Knowledge Base articles useful:
Mbed TLS is mostly written in portable C99; however, it has a few platform requirements that go beyond the standard, but are met by most modern architectures:
PSA cryptography APIPSA APIArm's Platform Security Architecture (PSA) is a holistic set of threat models, security analyses, hardware and firmware architecture specifications, and an open source firmware reference implementation. PSA provides a recipe, based on industry best practice, that allows security to be consistently designed in, at both a hardware and firmware level. The PSA cryptography API provides access to a set of cryptographic primitives. It has a dual purpose. First, it can be used in a PSA-compliant platform to build services, such as secure boot, secure storage and secure communication. Second, it can also be used independently of other PSA components on any platform. The design goals of the PSA cryptography API include:
Arm welcomes feedback on the design of the API. If you think something could be improved, please open an issue on our Github repository. Alternatively, if you prefer to provide your feedback privately, please email us at PSA implementation in Mbed TLSMbed TLS includes a reference implementation of the PSA Cryptography API. However, it does not aim to implement the whole specification; in particular it does not implement all the algorithms. The X.509 and TLS code can use PSA cryptography for most operations. To enable this support, activate the compilation option PSA driversMbed TLS supports drivers for cryptographic accelerators, secure elements and random generators. This is work in progress. Please note that the driver interfaces are not fully stable yet and may change without notice. We intend to preserve backward compatibility for application code (using the PSA Crypto API), but the code of the drivers may have to change in future minor releases of Mbed TLS. Please see the PSA driver example and guide for information on writing a driver. When using drivers, you will generally want to enable two compilation options (see the reference manual for more information):
LicenseUnless specifically indicated otherwise in a file, Mbed TLS files are provided under a dual Apache-2.0 OR GPL-2.0-or-later license. See the LICENSE file for the full text of these licenses, and the ‘License and Copyright’ section in the contributing guidelines for more information. Third-party code included in Mbed TLSThis project contains code from other projects. This code is located within the
ContributingWe gratefully accept bug reports and contributions from the community. Please see the contributing guidelines for details on how to do this. Contact
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |