@@ -47,13 +47,19 @@ namespace DeviceLayer {
47
47
PlatformManagerImpl PlatformManagerImpl::sInstance ;
48
48
49
49
#if defined(SL_MBEDTLS_USE_TINYCRYPT)
50
- sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL ;
50
+ sys_mutex_t PlatformManagerImpl::rngMutexHandle = nullptr ;
51
51
52
52
int PlatformManagerImpl::uECC_RNG_Function (uint8_t * dest, unsigned int size)
53
53
{
54
+ <<<<<<< HEAD:src/platform/silabs/PlatformManagerImpl.cpp
54
55
sys_mutex_lock (&rngMutexHandle);
55
56
int res = (chip::Crypto::DRBG_get_bytes (dest, size) == CHIP_NO_ERROR) ? size : 0 ;
56
57
sys_mutex_unlock (&rngMutexHandle);
58
+ =======
59
+ osMutexAcquire (rngMutexHandle, osWaitForever);
60
+ int res = (chip::Crypto::DRBG_get_bytes (dest, size) == CHIP_NO_ERROR) ? size : 0 ;
61
+ osMutexRelease (rngMutexHandle);
62
+ >>>>>>> 1f2c99eff4 (Changes necessary for WiFi SDK lwip component usage vs. source/header file reference):src/platform/silabs/SiWx917/PlatformManagerImpl.cpp
57
63
58
64
return res;
59
65
}
@@ -97,7 +103,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
97
103
ReturnErrorOnFailure (chip::Crypto::add_entropy_source (app_entropy_source, NULL , 16 ));
98
104
#endif // !SLI_SI91X_MCU_INTERFACE
99
105
/* Set RNG function for tinycrypt operations. */
100
- VerifyOrExit (sys_mutex_new (&rngMutexHandle) == ERR_OK, err = CHIP_ERROR_NO_MEMORY);
106
+ rngMutexHandle = osMutexNew (nullptr );
107
+ VerifyOrExit ((&rngMutexHandle != nullptr ), err = CHIP_ERROR_NO_MEMORY);
101
108
uECC_set_rng (PlatformManagerImpl::uECC_RNG_Function);
102
109
#endif // SL_MBEDTLS_USE_TINYCRYPT
103
110
0 commit comments