Merge pull request #9576 from yossi2le/yossi_remove_redundant_ifdef

Remove redundant ifdef DEVICE_TRNG from DeviceKey
pull/9715/head
Cruz Monrreal 2019-02-13 17:09:57 -06:00 committed by GitHub
commit 583980fa2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -260,7 +260,7 @@ int DeviceKey::generate_key_by_random(uint32_t *output, size_t size)
return DEVICEKEY_INVALID_PARAM;
}
#if DEVICE_TRNG
#if defined(DEVICE_TRNG) || defined(MBEDTLS_ENTROPY_NV_SEED)
uint32_t test_buff[DEVICE_KEY_32BYTE / sizeof(int)];
mbedtls_entropy_context *entropy = new mbedtls_entropy_context;
mbedtls_entropy_init(entropy);
@ -276,6 +276,7 @@ int DeviceKey::generate_key_by_random(uint32_t *output, size_t size)
mbedtls_entropy_free(entropy);
delete entropy;
#endif
return ret;