diff options
Diffstat (limited to 'src/core/telemetry_session.cpp')
| -rw-r--r-- | src/core/telemetry_session.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index f29fff1e7..68edb24f5 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <array> | ||
| 6 | |||
| 5 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 6 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 7 | #include "common/file_util.h" | 9 | #include "common/file_util.h" |
| @@ -28,11 +30,11 @@ static u64 GenerateTelemetryId() { | |||
| 28 | mbedtls_entropy_context entropy; | 30 | mbedtls_entropy_context entropy; |
| 29 | mbedtls_entropy_init(&entropy); | 31 | mbedtls_entropy_init(&entropy); |
| 30 | mbedtls_ctr_drbg_context ctr_drbg; | 32 | mbedtls_ctr_drbg_context ctr_drbg; |
| 31 | std::string personalization = "yuzu Telemetry ID"; | 33 | constexpr std::array<char, 18> personalization{{"yuzu Telemetry ID"}}; |
| 32 | 34 | ||
| 33 | mbedtls_ctr_drbg_init(&ctr_drbg); | 35 | mbedtls_ctr_drbg_init(&ctr_drbg); |
| 34 | ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, | 36 | ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, |
| 35 | reinterpret_cast<const unsigned char*>(personalization.c_str()), | 37 | reinterpret_cast<const unsigned char*>(personalization.data()), |
| 36 | personalization.size()) == 0); | 38 | personalization.size()) == 0); |
| 37 | ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id), | 39 | ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id), |
| 38 | sizeof(u64)) == 0); | 40 | sizeof(u64)) == 0); |