Change mbedtls_platform_context parameter to NULL

Change the parameter being sent to `mbedtls_platform_setup()` and
`mbedtls_platfrm_teardown()` to NULL, as it is now being unused
in Mbed OS.
pull/7960/head
Ron Eldor 2018-09-03 08:38:57 +03:00
parent 83e0e65a42
commit 5817d71ad8
4 changed files with 6 additions and 9 deletions

View File

@ -188,15 +188,14 @@ int main()
{
int ret = 0;
#if defined(MBEDTLS_PLATFORM_C)
mbedtls_platform_context platform_ctx;
if ((ret = mbedtls_platform_setup(&platform_ctx)) != 0) {
if ((ret = mbedtls_platform_setup(NULL)) != 0) {
mbedtls_printf("Mbed TLS multitest failed! mbedtls_platform_setup returned %d\n", ret);
return 1;
}
#endif
ret = (Harness::run(specification) ? 0 : 1);
#if defined(MBEDTLS_PLATFORM_C)
mbedtls_platform_teardown(&platform_ctx);
mbedtls_platform_teardown(NULL);
#endif
return ret;
}

View File

@ -96,15 +96,14 @@ int main()
{
int ret = 0;
#if defined(MBEDTLS_PLATFORM_C)
mbedtls_platform_context platform_ctx;
if ((ret = mbedtls_platform_setup(&platform_ctx)) != 0) {
if ((ret = mbedtls_platform_setup(NULL)) != 0) {
mbedtls_printf("Mbed TLS selftest failed! mbedtls_platform_setup returned %d\n", ret);
return 1;
}
#endif
ret = (Harness::run(specification) ? 0 : 1);
#if defined(MBEDTLS_PLATFORM_C)
mbedtls_platform_teardown(&platform_ctx);
mbedtls_platform_teardown(NULL);
#endif
return ret;
}

View File

@ -47,7 +47,7 @@ namespace vendor {
namespace nordic {
CryptoToolbox::CryptoToolbox() : _initialized(false) {
mbedtls_platform_setup(&_platform_context);
mbedtls_platform_setup(NULL);
mbedtls_entropy_init(&_entropy_context);
mbedtls_ecp_group_init(&_group);
int err = mbedtls_ecp_group_load(
@ -60,7 +60,7 @@ CryptoToolbox::CryptoToolbox() : _initialized(false) {
CryptoToolbox::~CryptoToolbox() {
mbedtls_ecp_group_free(&_group);
mbedtls_entropy_free(&_entropy_context);
mbedtls_platform_teardown(&_platform_context);
mbedtls_platform_teardown(NULL);
}
bool CryptoToolbox::generate_keys(

View File

@ -132,7 +132,6 @@ private:
void swap_endian(uint8_t* buf, size_t len);
bool _initialized;
mbedtls_platform_context _platform_context;
mbedtls_entropy_context _entropy_context;
mbedtls_ecp_group _group;
};