mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
fixed crash of encrypted leaseset without authentication
This commit is contained in:
parent
d503190647
commit
9b6facf3b0
@ -415,10 +415,8 @@ namespace client
|
|||||||
auto it2 = m_LeaseSetRequests.find (key);
|
auto it2 = m_LeaseSetRequests.find (key);
|
||||||
if (it2 != m_LeaseSetRequests.end () && it2->second->requestedBlindedKey)
|
if (it2 != m_LeaseSetRequests.end () && it2->second->requestedBlindedKey)
|
||||||
{
|
{
|
||||||
const uint8_t * secret = nullptr;
|
|
||||||
if (m_LeaseSetPrivKey) secret = *m_LeaseSetPrivKey; // m_LeaseSetPrivKey ? *m_LeaseSetPrivKey: nullptr invokes copy contructor
|
|
||||||
auto ls2 = std::make_shared<i2p::data::LeaseSet2> (buf + offset, len - offset,
|
auto ls2 = std::make_shared<i2p::data::LeaseSet2> (buf + offset, len - offset,
|
||||||
it2->second->requestedBlindedKey, secret, GetPreferredCryptoType ());
|
it2->second->requestedBlindedKey, m_LeaseSetPrivKey ? ((const uint8_t *)*m_LeaseSetPrivKey) : nullptr , GetPreferredCryptoType ());
|
||||||
if (ls2->IsValid ())
|
if (ls2->IsValid ())
|
||||||
{
|
{
|
||||||
m_RemoteLeaseSets[ls2->GetIdentHash ()] = ls2; // ident is not key
|
m_RemoteLeaseSets[ls2->GetIdentHash ()] = ls2; // ident is not key
|
||||||
|
Loading…
Reference in New Issue
Block a user