Updated changelog

This commit is contained in:
WolverinDEV 2019-07-07 18:40:03 +02:00
parent 7e4a15e9dc
commit ee2bd4f4c5
1 changed files with 7 additions and 9 deletions

View File

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