device-os
device-os copied to clipboard
Exports part of mbedtls to the user application
Problem
We'd like to have access to mbedTLS functions available in system-firmware from user application in certain cases.
Solution
This PR exports crypto dynalib from system side and imports it from the user part.
Steps to Test
TODO
Example App
#include "application.h"
#include <mbedtls/ecjpake.h>
// for mbedtls_default_rng
#include "mbedtls_util.h"
/* executes once at startup */
void setup() {
mbedtls_ecjpake_context test = {};
mbedtls_ecjpake_init(&test);
size_t olen = 123;
mbedtls_ecjpake_derive_secret(&test, nullptr, 123, &olen, mbedtls_default_rng, nullptr);
mbedtls_ecjpake_free(&test);
}
References
N/A
Completeness
- [x] User is totes amazing for contributing!
- [ ] Contributor has signed CLA (Info here)
- [ ] Problem and Solution clearly stated
- [ ] Run unit/integration/application tests on device
- [ ] Added documentation
- [ ] Added to CHANGELOG.md after merging (add links to docs and issues)
Just for the record, this is not planned to be released but is being made available for hacking. Currently, mbedtls is provided within the system so that the application can include its own version of the library.