Merge pull request #7960 from RonEld/set_NULL_as_platform_context

Change mbedtls_platform_context parameter to NULL
pull/8156/head
Martin Kojtal 2018-09-17 14:30:03 +02:00 committed by GitHub
commit 10b5a3a9d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
};