diff --git a/source/base/peer/client_authenticator.cc b/source/base/peer/client_authenticator.cc index 14d84e904b..69c3882a5e 100644 --- a/source/base/peer/client_authenticator.cc +++ b/source/base/peer/client_authenticator.cc @@ -438,6 +438,7 @@ bool ClientAuthenticator::readSessionChallenge(const ByteArray& buffer) LOG(LS_INFO) << "Server Name: " << challenge->computer_name(); LOG(LS_INFO) << "Server OS: " << challenge->os_name(); LOG(LS_INFO) << "Server CPU Cores: " << challenge->cpu_cores(); + LOG(LS_INFO) << "Server Arch: " << challenge->arch(); return true; } @@ -458,6 +459,18 @@ void ClientAuthenticator::sendSessionResponse() response->set_computer_name(SysInfo::computerName()); response->set_cpu_cores(static_cast(SysInfo::processorThreads())); +#if defined(ARCH_CPU_X86) + response->set_arch("x86"); +#elif defined(ARCH_CPU_X86_64) + response->set_arch("x86_64"); +#elif defined(ARCH_CPU_ARMEL) + response->set_arch("arm"); +#elif defined(ARCH_CPU_ARM64) + response->set_arch("arm64"); +#else + response->set_arch(std::string()); +#endif + LOG(LS_INFO) << "Sending: SessionResponse"; sendMessage(*response); } diff --git a/source/base/peer/server_authenticator.cc b/source/base/peer/server_authenticator.cc index dc1b64194b..c3696d21dd 100644 --- a/source/base/peer/server_authenticator.cc +++ b/source/base/peer/server_authenticator.cc @@ -566,6 +566,18 @@ void ServerAuthenticator::doSessionChallenge() session_challenge->set_computer_name(SysInfo::computerName()); session_challenge->set_cpu_cores(static_cast(SysInfo::processorThreads())); +#if defined(ARCH_CPU_X86) + session_challenge->set_arch("x86"); +#elif defined(ARCH_CPU_X86_64) + session_challenge->set_arch("x86_64"); +#elif defined(ARCH_CPU_ARMEL) + session_challenge->set_arch("arm"); +#elif defined(ARCH_CPU_ARM64) + session_challenge->set_arch("arm64"); +#else + session_challenge->set_arch(std::string()); +#endif + LOG(LS_INFO) << "Sending: SessionChallenge"; sendMessage(*session_challenge); } @@ -592,6 +604,7 @@ void ServerAuthenticator::onSessionResponse(const ByteArray& buffer) LOG(LS_INFO) << "Client Name: " << session_response->computer_name(); LOG(LS_INFO) << "Client OS: " << session_response->os_name(); LOG(LS_INFO) << "Client CPU Cores: " << session_response->cpu_cores(); + LOG(LS_INFO) << "Client Arch: " << session_response->arch(); BitSet session_type = session_response->session_type(); if (session_type.count() != 1) diff --git a/source/proto/key_exchange.proto b/source/proto/key_exchange.proto index da2f310a09..2cb765e984 100644 --- a/source/proto/key_exchange.proto +++ b/source/proto/key_exchange.proto @@ -114,6 +114,7 @@ message SessionChallenge uint32 cpu_cores = 3; string os_name = 4; string computer_name = 5; + string arch = 6; } // Client to server. @@ -124,4 +125,5 @@ message SessionResponse uint32 cpu_cores = 3; string os_name = 4; string computer_name = 5; + string arch = 6; }