mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
check if sip key is available
This commit is contained in:
parent
8566f6c127
commit
876e98d91e
@ -910,12 +910,14 @@ namespace transport
|
|||||||
|
|
||||||
void NTCP2Session::SetNextSentFrameLength (size_t frameLen, uint8_t * lengthBuf)
|
void NTCP2Session::SetNextSentFrameLength (size_t frameLen, uint8_t * lengthBuf)
|
||||||
{
|
{
|
||||||
#if OPENSSL_SIPHASH
|
#if OPENSSL_SIPHASH
|
||||||
|
if (!m_SendMDCtx) return;
|
||||||
EVP_DigestSignInit (m_SendMDCtx, nullptr, nullptr, nullptr, nullptr);
|
EVP_DigestSignInit (m_SendMDCtx, nullptr, nullptr, nullptr, nullptr);
|
||||||
EVP_DigestSignUpdate (m_SendMDCtx, m_SendIV.buf, 8);
|
EVP_DigestSignUpdate (m_SendMDCtx, m_SendIV.buf, 8);
|
||||||
size_t l = 8;
|
size_t l = 8;
|
||||||
EVP_DigestSignFinal (m_SendMDCtx, m_SendIV.buf, &l);
|
EVP_DigestSignFinal (m_SendMDCtx, m_SendIV.buf, &l);
|
||||||
#else
|
#else
|
||||||
|
if (!m_SendSipKey) return;
|
||||||
i2p::crypto::Siphash<8> (m_SendIV.buf, m_SendIV.buf, 8, m_SendSipKey);
|
i2p::crypto::Siphash<8> (m_SendIV.buf, m_SendIV.buf, 8, m_SendSipKey);
|
||||||
#endif
|
#endif
|
||||||
// length must be in BigEndian
|
// length must be in BigEndian
|
||||||
|
Loading…
Reference in New Issue
Block a user