Skip to content

Commit 583980f

Browse files
author
Cruz Monrreal
authored
Merge pull request #9576 from yossi2le/yossi_remove_redundant_ifdef
Remove redundant ifdef DEVICE_TRNG from DeviceKey
2 parents b820ec8 + d8d91c3 commit 583980f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

features/device_key/source/DeviceKey.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ int DeviceKey::generate_key_by_random(uint32_t *output, size_t size)
260260
return DEVICEKEY_INVALID_PARAM;
261261
}
262262

263-
#if DEVICE_TRNG
263+
#if defined(DEVICE_TRNG) || defined(MBEDTLS_ENTROPY_NV_SEED)
264264
uint32_t test_buff[DEVICE_KEY_32BYTE / sizeof(int)];
265265
mbedtls_entropy_context *entropy = new mbedtls_entropy_context;
266266
mbedtls_entropy_init(entropy);
@@ -276,6 +276,7 @@ int DeviceKey::generate_key_by_random(uint32_t *output, size_t size)
276276

277277
mbedtls_entropy_free(entropy);
278278
delete entropy;
279+
279280
#endif
280281

281282
return ret;

0 commit comments

Comments
 (0)