Updated changelog

This commit is contained in:
WolverinDEV 2019-07-07 18:40:03 +02:00
parent 7e4a15e9dc
commit ee2bd4f4c5

View File

@ -126,20 +126,18 @@ bool CryptionHandler::setupSharedSecretNew(const std::string &alpha, const std::
assert(alpha.length() == 10); assert(alpha.length() == 10);
assert(beta.length() == 54); assert(beta.length() == 54);
string shared; uint8_t shared[32];
string sharedIv; uint8_t shared_iv[64];
shared.resize(32, '\0');
sharedIv.resize(64, '\0'); keyMul(shared, reinterpret_cast<const uint8_t *>(publicKey), reinterpret_cast<const uint8_t *>(privateKey), true); //Remote key get negated
keyMul((uint8_t*) shared.data(), reinterpret_cast<const uint8_t *>(publicKey), reinterpret_cast<const uint8_t *>(privateKey), true); //Remote key get negated digest::sha512((const char*) shared, 32, shared_iv);
sharedIv = digest::sha512(shared);
digest::sha512(shared.data(), 32, sharedIv.data());
auto xor_key = alpha + beta; auto xor_key = alpha + beta;
for(int i = 0; i < 64; i++) for(int i = 0; i < 64; i++)
sharedIv[i] ^= xor_key[i]; shared_iv[i] ^= xor_key[i];
{ {
lock_guard lock(this->cache_key_lock); lock_guard lock(this->cache_key_lock);
memcpy(this->iv_struct, sharedIv.data(), 64); memcpy(this->iv_struct, shared_iv, 64);
this->iv_struct_length = 64; this->iv_struct_length = 64;
uint8_t mac_buffer[SHA_DIGEST_LENGTH]; uint8_t mac_buffer[SHA_DIGEST_LENGTH];