summaryrefslogtreecommitdiff
path: root/src/core/telemetry_session.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-10-09 16:56:56 -0400
committerGravatar GitHub2018-10-09 16:56:56 -0400
commit89939be9e6c455f851978eb27d3ecb201c0f32be (patch)
treebb00ae611ae39a09f03e154040613b92c35460c9 /src/core/telemetry_session.cpp
parentMerge pull request #1462 from lioncash/move (diff)
parenttelemetry_session: Remove doxygen comment for a non-existent parameter (diff)
downloadyuzu-89939be9e6c455f851978eb27d3ecb201c0f32be.tar.gz
yuzu-89939be9e6c455f851978eb27d3ecb201c0f32be.tar.xz
yuzu-89939be9e6c455f851978eb27d3ecb201c0f32be.zip
Merge pull request #1465 from lioncash/telemetry
telemetry_session: Minor miscellaneous changes
Diffstat (limited to 'src/core/telemetry_session.cpp')
-rw-r--r--src/core/telemetry_session.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index f29fff1e7..7b04792b5 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -2,12 +2,16 @@
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
7#include <mbedtls/ctr_drbg.h>
8#include <mbedtls/entropy.h>
9
5#include "common/assert.h" 10#include "common/assert.h"
6#include "common/common_types.h" 11#include "common/common_types.h"
7#include "common/file_util.h" 12#include "common/file_util.h"
13#include "common/logging/log.h"
8 14
9#include <mbedtls/ctr_drbg.h>
10#include <mbedtls/entropy.h>
11#include "core/core.h" 15#include "core/core.h"
12#include "core/file_sys/control_metadata.h" 16#include "core/file_sys/control_metadata.h"
13#include "core/file_sys/patch_manager.h" 17#include "core/file_sys/patch_manager.h"
@@ -28,11 +32,11 @@ static u64 GenerateTelemetryId() {
28 mbedtls_entropy_context entropy; 32 mbedtls_entropy_context entropy;
29 mbedtls_entropy_init(&entropy); 33 mbedtls_entropy_init(&entropy);
30 mbedtls_ctr_drbg_context ctr_drbg; 34 mbedtls_ctr_drbg_context ctr_drbg;
31 std::string personalization = "yuzu Telemetry ID"; 35 constexpr std::array<char, 18> personalization{{"yuzu Telemetry ID"}};
32 36
33 mbedtls_ctr_drbg_init(&ctr_drbg); 37 mbedtls_ctr_drbg_init(&ctr_drbg);
34 ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, 38 ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
35 reinterpret_cast<const unsigned char*>(personalization.c_str()), 39 reinterpret_cast<const unsigned char*>(personalization.data()),
36 personalization.size()) == 0); 40 personalization.size()) == 0);
37 ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id), 41 ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id),
38 sizeof(u64)) == 0); 42 sizeof(u64)) == 0);