summaryrefslogtreecommitdiffstats
path: root/src/core/telemetry_session.cpp
diff options
context:
space:
mode:
authorfearlessTobi <thm.frey@gmail.com>2018-09-17 17:16:01 +0200
committerfearlessTobi <thm.frey@gmail.com>2018-10-02 15:30:48 +0200
commitb4ace6ec6f86079b3bd297f95dfe133240b53e15 (patch)
treeefbbacb734024ad2b0be5980bf67f553976c2c11 /src/core/telemetry_session.cpp
parentPort web_service from Citra (diff)
downloadyuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.tar
yuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.tar.gz
yuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.tar.bz2
yuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.tar.lz
yuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.tar.xz
yuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.tar.zst
yuzu-b4ace6ec6f86079b3bd297f95dfe133240b53e15.zip
Diffstat (limited to '')
-rw-r--r--src/core/telemetry_session.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 09c85297a..c02188adc 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -28,11 +28,12 @@ static u64 GenerateTelemetryId() {
mbedtls_entropy_context entropy;
mbedtls_entropy_init(&entropy);
mbedtls_ctr_drbg_context ctr_drbg;
- const char* personalization = "yuzu Telemetry ID";
+ std::string personalization = "yuzu Telemetry ID";
mbedtls_ctr_drbg_init(&ctr_drbg);
- mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
- (const unsigned char*)personalization, strlen(personalization));
+ ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
+ reinterpret_cast<const unsigned char*>(personalization.c_str()),
+ personalization.size()) == 0)
ASSERT(mbedtls_ctr_drbg_random(&ctr_drbg, reinterpret_cast<unsigned char*>(&telemetry_id),
sizeof(u64)) == 0);
@@ -88,7 +89,7 @@ u64 RegenerateTelemetryId() {
return new_telemetry_id;
}
-bool VerifyLogin(std::string username, std::string token) {
+bool VerifyLogin(const std::string& username, const std::string& token) {
#ifdef ENABLE_WEB_SERVICE
return WebService::VerifyLogin(Settings::values.web_api_url, username, token);
#else
@@ -120,7 +121,7 @@ TelemetrySession::TelemetrySession() {
u64 program_id{};
const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadProgramId(program_id)};
if (res == Loader::ResultStatus::Success) {
- std::string formatted_program_id{fmt::format("{:016X}", program_id)};
+ const std::string formatted_program_id{fmt::format("{:016X}", program_id)};
AddField(Telemetry::FieldType::Session, "ProgramId", formatted_program_id);
std::string name;