Mbed TLS recently released a new version of its library. We have also released a new version of our tools and libraries that integrate Mbed TLS. This shouldn't affect you in any way, unless you're using our C++ library. In that case, you may need to update your build scripts.
Version 4.1 of Mbed TLS does not introduce any groundbreaking new features, but it addresses some security vulnerabilities and fixes a few bugs. The full list of changes is available on their GitHub page.
Unfortunately, some of these changes have altered the source file directory structure. This has forced us to update the compilation process for our C++ library.
Specifically, you need to compile and include three additional directories:
- Sources/yapi/mbedtls/tf-psa-crypto/extras
- Sources/yapi/mbedtls/tf-psa-crypto/utilities
- Sources/yapi/mbedtls/tf-psa-crypto/platform
Depending on your situation, this change may have a greater or lesser impact.
You use CMake
If you use CMake, you don't need to make any changes. Simply update our library from GitHub or from our web site. We have already updated the MakeLists.txt file in the Sources subdirectory. You just need to recompile your project.
You use our build scripts
Here too, there is no need to modify your project. If you use our build scripts (or Gnu makefile directly) to compile our C++ library, simply update our library and recompile everything.
You compile our library with your own scripts/IDE
If you have directly included the source files in your IDE or build script, you need to update your project.
Specifically, to compile our C++ library, you need to compile the following files:
- the C++ files for the classes you use from the "Sources" directory
- all C files in the "Sources/yapi" directory
- all C files in the "Sources/yapi/mbedtls/library" directory
- all C files in the "Sources/yapi/mbedtls/tf-psa-crypto/core/" directory
- all C files in the "Sources/yapi/mbedtls/tf-psa-crypto/drivers/builtin/src/" directory
- all C files in the "Sources/yapi/mbedtls/tf-psa-crypto/extras/" directory
- all C files in the "Sources/yapi/mbedtls/tf-psa-crypto/utilities/" directory
- all C files in the "Sources/yapi/mbedtls/tf-psa-crypto/platform/" directory
You must also ensure that the following directories are in the include path:
- the "Sources" directory
- the "Sources/yapi/mbedtls/include" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/core" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/drivers/builtin/include" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/drivers/builtin/src" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/include" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/extras" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/utilities" directory
- the "Sources/yapi/mbedtls/tf-psa-crypto/platform" directory
We have updated the README.md file located at the root of our C++ library with the exact list of all the files that you need to compile. This should save you some time and allow you to check in case of errors.
You are not using SSL/TLS
If you do not need to use the https:// or wss:// protocols, you can continue to compile our library without Mbed TLS. No changes are required; you simply need to define the NO_YSSL macro in your IDE or makefile.
You are using our library for the first time
In addition to the solutions we've just listed, you can start with one of our examples. As well as the source code, most examples include ready-to-compile IDE projects for the following IDEs:
- Visual Studio
- Xcode
- Code::Blocks
This allows beginners to easily test our modules and view the file structure.
Conclusion
We try as much as possible to simplify the way to update our libraries, because we know how frustrating it is to waste hours getting something to work again that used to work before. Unfortunately, in this case, we couldn't avoid this directory structure change. However, we hope this post will help you update your build scripts in no time.
