mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
show ECIESx25519 session and tag on the web console
This commit is contained in:
parent
7133a07f38
commit
27d69894d4
@ -22,6 +22,7 @@
|
|||||||
#include "HTTPServer.h"
|
#include "HTTPServer.h"
|
||||||
#include "Daemon.h"
|
#include "Daemon.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "ECIESX25519AEADRatchetSession.h"
|
||||||
#ifdef WIN32_APP
|
#ifdef WIN32_APP
|
||||||
#include "Win32/Win32App.h"
|
#include "Win32/Win32App.h"
|
||||||
#endif
|
#endif
|
||||||
@ -409,6 +410,16 @@ namespace http {
|
|||||||
<< "<div class='content'>\r\n<table><tbody><thead><th>Destination</th><th>Amount</th></thead>\r\n" << tmp_s.str () << "</tbody></table>\r\n</div>\r\n</div>\r\n";
|
<< "<div class='content'>\r\n<table><tbody><thead><th>Destination</th><th>Amount</th></thead>\r\n" << tmp_s.str () << "</tbody></table>\r\n</div>\r\n</div>\r\n";
|
||||||
} else
|
} else
|
||||||
s << "Outgoing: <i>0</i><br>\r\n";
|
s << "Outgoing: <i>0</i><br>\r\n";
|
||||||
|
auto numECIESx25519Tags = dest->GetNumIncomingECIESx25519Tags ();
|
||||||
|
if (numECIESx25519Tags > 0)
|
||||||
|
s << "Incoming ECIESx25519: <i>" << numECIESx25519Tags << "</i><br>";
|
||||||
|
if (!dest->GetECIESx25519Sessions ().empty ())
|
||||||
|
{
|
||||||
|
s << "<br>\r\n<b>ECIESx25519Tags sessions</b><br>";
|
||||||
|
for (const auto& it: dest->GetECIESx25519Sessions ())
|
||||||
|
s << i2p::client::context.GetAddressBook ().ToAddress(it.second->GetDestination ())
|
||||||
|
<< " " << it.second->GetState () << "<br>\r\n";
|
||||||
|
}
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,15 @@ namespace garlic
|
|||||||
std::list<std::pair<uint16_t, int> > m_AckRequests; // (tagsetid, index)
|
std::list<std::pair<uint16_t, int> > m_AckRequests; // (tagsetid, index)
|
||||||
bool m_SendReverseKey = false, m_SendForwardKey = false;
|
bool m_SendReverseKey = false, m_SendForwardKey = false;
|
||||||
std::unique_ptr<DHRatchet> m_NextReceiveRatchet, m_NextSendRatchet;
|
std::unique_ptr<DHRatchet> m_NextReceiveRatchet, m_NextSendRatchet;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// for HTTP only
|
||||||
|
int GetState () const { return (int)m_State; }
|
||||||
|
i2p::data::IdentHash GetDestination () const
|
||||||
|
{
|
||||||
|
return m_Destination ? *m_Destination : i2p::data::IdentHash ();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::shared_ptr<I2NPMessage> WrapECIESX25519AEADRatchetMessage (std::shared_ptr<const I2NPMessage> msg, const uint8_t * key, uint64_t tag);
|
std::shared_ptr<I2NPMessage> WrapECIESX25519AEADRatchetMessage (std::shared_ptr<const I2NPMessage> msg, const uint8_t * key, uint64_t tag);
|
||||||
|
@ -276,7 +276,9 @@ namespace garlic
|
|||||||
|
|
||||||
// for HTTP only
|
// for HTTP only
|
||||||
size_t GetNumIncomingTags () const { return m_Tags.size (); }
|
size_t GetNumIncomingTags () const { return m_Tags.size (); }
|
||||||
|
size_t GetNumIncomingECIESx25519Tags () const { return m_ECIESx25519Tags.size (); }
|
||||||
const decltype(m_Sessions)& GetSessions () const { return m_Sessions; };
|
const decltype(m_Sessions)& GetSessions () const { return m_Sessions; };
|
||||||
|
const decltype(m_ECIESx25519Sessions)& GetECIESx25519Sessions () const { return m_ECIESx25519Sessions; }
|
||||||
};
|
};
|
||||||
|
|
||||||
void CleanUpTagsFiles ();
|
void CleanUpTagsFiles ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user