diff --git a/server/src/client/voice/VoiceClientCommandHandler.cpp b/server/src/client/voice/VoiceClientCommandHandler.cpp index 8368b89..b976a43 100644 --- a/server/src/client/voice/VoiceClientCommandHandler.cpp +++ b/server/src/client/voice/VoiceClientCommandHandler.cpp @@ -58,13 +58,13 @@ command_result VoiceClient::handleCommand(ts::Command &command) { return SpeakingClient::handleCommand(command); } -inline bool calculate_security_level(int& result, ecc_key* pubKey, size_t offset) { +inline bool calculate_security_level(int& result, ecc_key* pubKey, const std::string& offset) { size_t pubLength = 256; char pubBuffer[256]; if((result = ecc_export(reinterpret_cast(pubBuffer), &pubLength, PK_PUBLIC, pubKey)) != CRYPT_OK) return false; - std::string hashStr = base64_encode(pubBuffer, pubLength) + to_string(offset); + std::string hashStr = base64_encode(pubBuffer, pubLength) + offset; char shaBuffer[SHA_DIGEST_LENGTH]; SHA1((const unsigned char *) hashStr.data(), hashStr.length(), (unsigned char *) shaBuffer); @@ -89,7 +89,7 @@ command_result VoiceClient::handleCommandClientInit(Command &cmd) { auto client_identity = this->connection->crypt_setup_handler().identity_key(); int security_level; - if(!calculate_security_level(security_level, &*client_identity, cmd["client_key_offset"])) { + if(!calculate_security_level(security_level, &*client_identity, cmd["client_key_offset"].string())) { logError(this->getServerId(), "[{}] Failed to calculate security level. Error code: {}", CLIENT_STR_LOG_PREFIX, security_level); return command_result{error::vs_critical}; } diff --git a/shared b/shared index c079098..d213c0a 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit c0790984eeea45c2692680fd133e6048cbafe57c +Subproject commit d213c0ade0ea0752eec6ce995e661a49a2818a4e