mirror of https://github.com/ARMmbed/mbed-os.git
BLE Nordic: Initialize and teardown tls platform context
parent
dfcdbbfb14
commit
4d0126898c
|
@ -47,6 +47,7 @@ namespace vendor {
|
|||
namespace nordic {
|
||||
|
||||
CryptoToolbox::CryptoToolbox() : _initialized(false) {
|
||||
mbedtls_platform_setup(&_platform_context);
|
||||
mbedtls_entropy_init(&_entropy_context);
|
||||
mbedtls_ecp_group_init(&_group);
|
||||
int err = mbedtls_ecp_group_load(
|
||||
|
@ -59,6 +60,7 @@ CryptoToolbox::CryptoToolbox() : _initialized(false) {
|
|||
CryptoToolbox::~CryptoToolbox() {
|
||||
mbedtls_ecp_group_free(&_group);
|
||||
mbedtls_entropy_free(&_entropy_context);
|
||||
mbedtls_platform_teardown(&_platform_context);
|
||||
}
|
||||
|
||||
bool CryptoToolbox::generate_keys(
|
||||
|
|
|
@ -132,6 +132,7 @@ 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