mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #7960 from RonEld/set_NULL_as_platform_context
Change mbedtls_platform_context parameter to NULLpull/8156/head
commit
10b5a3a9d8
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue