Skip to content

Commit 10b5a3a

Browse files
authored
Merge pull request #7960 from RonEld/set_NULL_as_platform_context
Change mbedtls_platform_context parameter to NULL
2 parents 9abcbf6 + 5817d71 commit 10b5a3a

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

TESTS/mbedtls/multi/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,14 @@ int main()
188188
{
189189
int ret = 0;
190190
#if defined(MBEDTLS_PLATFORM_C)
191-
mbedtls_platform_context platform_ctx;
192-
if ((ret = mbedtls_platform_setup(&platform_ctx)) != 0) {
191+
if ((ret = mbedtls_platform_setup(NULL)) != 0) {
193192
mbedtls_printf("Mbed TLS multitest failed! mbedtls_platform_setup returned %d\n", ret);
194193
return 1;
195194
}
196195
#endif
197196
ret = (Harness::run(specification) ? 0 : 1);
198197
#if defined(MBEDTLS_PLATFORM_C)
199-
mbedtls_platform_teardown(&platform_ctx);
198+
mbedtls_platform_teardown(NULL);
200199
#endif
201200
return ret;
202201
}

TESTS/mbedtls/selftest/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,14 @@ int main()
9696
{
9797
int ret = 0;
9898
#if defined(MBEDTLS_PLATFORM_C)
99-
mbedtls_platform_context platform_ctx;
100-
if ((ret = mbedtls_platform_setup(&platform_ctx)) != 0) {
99+
if ((ret = mbedtls_platform_setup(NULL)) != 0) {
101100
mbedtls_printf("Mbed TLS selftest failed! mbedtls_platform_setup returned %d\n", ret);
102101
return 1;
103102
}
104103
#endif
105104
ret = (Harness::run(specification) ? 0 : 1);
106105
#if defined(MBEDTLS_PLATFORM_C)
107-
mbedtls_platform_teardown(&platform_ctx);
106+
mbedtls_platform_teardown(NULL);
108107
#endif
109108
return ret;
110109
}

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xCrypto.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace vendor {
4747
namespace nordic {
4848

4949
CryptoToolbox::CryptoToolbox() : _initialized(false) {
50-
mbedtls_platform_setup(&_platform_context);
50+
mbedtls_platform_setup(NULL);
5151
mbedtls_entropy_init(&_entropy_context);
5252
mbedtls_ecp_group_init(&_group);
5353
int err = mbedtls_ecp_group_load(
@@ -60,7 +60,7 @@ CryptoToolbox::CryptoToolbox() : _initialized(false) {
6060
CryptoToolbox::~CryptoToolbox() {
6161
mbedtls_ecp_group_free(&_group);
6262
mbedtls_entropy_free(&_entropy_context);
63-
mbedtls_platform_teardown(&_platform_context);
63+
mbedtls_platform_teardown(NULL);
6464
}
6565

6666
bool CryptoToolbox::generate_keys(

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xCrypto.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ class CryptoToolbox : mbed::NonCopyable<CryptoToolbox> {
132132
void swap_endian(uint8_t* buf, size_t len);
133133

134134
bool _initialized;
135-
mbedtls_platform_context _platform_context;
136135
mbedtls_entropy_context _entropy_context;
137136
mbedtls_ecp_group _group;
138137
};

0 commit comments

Comments
 (0)