diff --git a/AddressBook.cpp b/AddressBook.cpp index 685acbc2..4dad5614 100644 --- a/AddressBook.cpp +++ b/AddressBook.cpp @@ -636,7 +636,11 @@ namespace client if (address.length () > 0) { // TODO: verify from - m_Addresses[address] = buf + 8; + i2p::data::IdentHash hash(buf + 8); + if (!hash.IsZero ()) + m_Addresses[address] = hash; + else + LogPrint (eLogInfo, "AddressBook: Lookup response: ", address, " not found"); } } diff --git a/ClientContext.h b/ClientContext.h index db74a19e..e392c8a2 100644 --- a/ClientContext.h +++ b/ClientContext.h @@ -113,6 +113,7 @@ namespace client const decltype(m_ClientForwards)& GetClientForwards () const { return m_ClientForwards; } const decltype(m_ServerForwards)& GetServerForwards () const { return m_ServerForwards; } const i2p::proxy::HTTPProxy * GetHttpProxy () const { return m_HttpProxy; } + const i2p::proxy::SOCKSProxy * GetSocksProxy () const { return m_SocksProxy; } }; extern ClientContext context; diff --git a/Config.cpp b/Config.cpp index 20036b83..610ab4aa 100644 --- a/Config.cpp +++ b/Config.cpp @@ -170,13 +170,14 @@ namespace config { "https://reseed.i2p-projekt.de/," "https://i2p.mooo.com/netDb/," "https://netdb.i2p2.no/," - "https://us.reseed.i2p2.no:444/," +// "https://us.reseed.i2p2.no:444/," // mamoth's shit // "https://uk.reseed.i2p2.no:444/," // mamoth's shit "https://i2p-0.manas.ca:8443/," "https://reseed.i2p.vzaws.com:8443/," "https://download.xxlspeed.com/," "https://reseed-ru.lngserv.ru/," - "https://reseed.atomike.ninja/" + "https://reseed.atomike.ninja/," + "https://reseed.memcpy.io/" ), "Reseed URLs, separated by comma") ; diff --git a/Crypto.cpp b/Crypto.cpp index a4a794ac..cc138923 100644 --- a/Crypto.cpp +++ b/Crypto.cpp @@ -272,10 +272,9 @@ namespace crypto } // ElGamal - - ElGamalEncryption::ElGamalEncryption (const uint8_t * key) + void ElGamalEncrypt (const uint8_t * key, const uint8_t * data, uint8_t * encrypted, bool zeroPadding) { - ctx = BN_CTX_new (); + BN_CTX * ctx = BN_CTX_new (); // select random k BIGNUM * k = BN_new (); #if defined(__x86_64__) @@ -284,6 +283,7 @@ namespace crypto BN_rand (k, ELGAMAL_SHORT_EXPONENT_NUM_BITS, -1, 1); // short exponent of 226 bits #endif // calculate a + BIGNUM * a; if (g_ElggTable) a = ElggPow (k, g_ElggTable, ctx); else @@ -295,21 +295,10 @@ namespace crypto BIGNUM * y = BN_new (); BN_bin2bn (key, 256, y); // calculate b1 - b1 = BN_new (); + BIGNUM * b1 = BN_new (); BN_mod_exp (b1, y, k, elgp, ctx); BN_free (y); BN_free (k); - } - - ElGamalEncryption::~ElGamalEncryption () - { - BN_CTX_free (ctx); - BN_free (a); - BN_free (b1); - } - - void ElGamalEncryption::Encrypt (const uint8_t * data, uint8_t * encrypted, bool zeroPadding) const - { // create m uint8_t m[255]; m[0] = 0xFF; @@ -319,6 +308,7 @@ namespace crypto BIGNUM * b = BN_new (); BN_bin2bn (m, 255, b); BN_mod_mul (b, b1, b, elgp, ctx); + BN_free (b1); // copy a and b if (zeroPadding) { @@ -333,8 +323,10 @@ namespace crypto bn2buf (b, encrypted + 256, 256); } BN_free (b); + BN_free (a); + BN_CTX_free (ctx); } - + bool ElGamalDecrypt (const uint8_t * key, const uint8_t * encrypted, uint8_t * data, bool zeroPadding) { diff --git a/Crypto.h b/Crypto.h index 9e35f073..00255a37 100644 --- a/Crypto.h +++ b/Crypto.h @@ -47,21 +47,7 @@ namespace crypto }; // ElGamal - class ElGamalEncryption - { - public: - - ElGamalEncryption (const uint8_t * key); - ~ElGamalEncryption (); - - void Encrypt (const uint8_t * data, uint8_t * encrypted, bool zeroPadding = false) const; - - private: - - BN_CTX * ctx; - BIGNUM * a, * b1; - }; - + void ElGamalEncrypt (const uint8_t * key, const uint8_t * data, uint8_t * encrypted, bool zeroPadding = false); bool ElGamalDecrypt (const uint8_t * key, const uint8_t * encrypted, uint8_t * data, bool zeroPadding = false); void GenerateElGamalKeyPair (uint8_t * priv, uint8_t * pub); diff --git a/DaemonLinux.cpp b/DaemonLinux.cpp index edd15f07..07e27e9d 100644 --- a/DaemonLinux.cpp +++ b/DaemonLinux.cpp @@ -76,12 +76,10 @@ namespace i2p return false; } -#if !defined(__OpenBSD__) // point std{in,out,err} descriptors to /dev/null - stdin = freopen("/dev/null", "r", stdin); - stdout = freopen("/dev/null", "w", stdout); - stderr = freopen("/dev/null", "w", stderr); -#endif + freopen("/dev/null", "r", stdin); + freopen("/dev/null", "w", stdout); + freopen("/dev/null", "w", stderr); } // set proc limits diff --git a/Datagram.cpp b/Datagram.cpp index 852e54f6..db29e83c 100644 --- a/Datagram.cpp +++ b/Datagram.cpp @@ -168,7 +168,8 @@ namespace datagram const i2p::data::IdentHash & remoteIdent) : m_LocalDestination(localDestination), m_RemoteIdent(remoteIdent), - m_SendQueueTimer(localDestination->GetService()) + m_SendQueueTimer(localDestination->GetService()), + m_RequestingLS(false) { m_LastUse = i2p::util::GetMillisecondsSinceEpoch (); ScheduleFlushSendQueue(); @@ -221,7 +222,10 @@ namespace datagram } if(!m_RemoteLeaseSet) { // no remote lease set - m_LocalDestination->RequestDestination(m_RemoteIdent, std::bind(&DatagramSession::HandleLeaseSetUpdated, this, std::placeholders::_1)); + if(!m_RequestingLS) { + m_RequestingLS = true; + m_LocalDestination->RequestDestination(m_RemoteIdent, std::bind(&DatagramSession::HandleLeaseSetUpdated, this, std::placeholders::_1)); + } return nullptr; } m_RoutingSession = m_LocalDestination->GetRoutingSession(m_RemoteLeaseSet, true); @@ -290,6 +294,7 @@ namespace datagram void DatagramSession::HandleLeaseSetUpdated(std::shared_ptr ls) { + m_RequestingLS = false; if(!ls) return; // only update lease set if found and newer than previous lease set uint64_t oldExpire = 0; diff --git a/Datagram.h b/Datagram.h index 8891f0cc..2eb180d6 100644 --- a/Datagram.h +++ b/Datagram.h @@ -88,7 +88,7 @@ namespace datagram boost::asio::deadline_timer m_SendQueueTimer; std::vector > m_SendQueue; uint64_t m_LastUse; - + bool m_RequestingLS; }; const size_t MAX_DATAGRAM_SIZE = 32768; diff --git a/Destination.cpp b/Destination.cpp index 491a9f29..f3cb9af8 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -844,6 +844,12 @@ namespace client return false; } + void ClientDestination::AcceptOnce (const i2p::stream::StreamingDestination::Acceptor& acceptor) + { + if (m_StreamingDestination) + m_StreamingDestination->AcceptOnce (acceptor); + } + std::shared_ptr ClientDestination::CreateStreamingDestination (int port, bool gzip) { auto dest = std::make_shared (GetSharedFromThis (), port, gzip); diff --git a/Destination.h b/Destination.h index 1ccb0a9c..7a4e0b64 100644 --- a/Destination.h +++ b/Destination.h @@ -186,7 +186,8 @@ namespace client void AcceptStreams (const i2p::stream::StreamingDestination::Acceptor& acceptor); void StopAcceptingStreams (); bool IsAcceptingStreams () const; - + void AcceptOnce (const i2p::stream::StreamingDestination::Acceptor& acceptor); + // datagram i2p::datagram::DatagramDestination * GetDatagramDestination () const { return m_DatagramDestination; }; i2p::datagram::DatagramDestination * CreateDatagramDestination (); diff --git a/Garlic.cpp b/Garlic.cpp index 81941cfc..51fa6c3b 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -187,8 +187,7 @@ namespace garlic RAND_bytes (elGamal.preIV, 32); // Pre-IV uint8_t iv[32]; // IV is first 16 bytes SHA256(elGamal.preIV, 32, iv); - i2p::crypto::ElGamalEncryption elGamalEncryption (m_Destination->GetEncryptionPublicKey ()); - elGamalEncryption.Encrypt ((uint8_t *)&elGamal, buf, true); + i2p::crypto::ElGamalEncrypt (m_Destination->GetEncryptionPublicKey (), (uint8_t *)&elGamal, buf, true); m_Encryption.SetIV (iv); buf += 514; len += 514; diff --git a/HTTPServer.cpp b/HTTPServer.cpp index 84818e8e..184e02b1 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -494,8 +494,9 @@ namespace http { auto ntcpServer = i2p::transport::transports.GetNTCPServer (); if (ntcpServer) { - s << "NTCP
\r\n"; - for (const auto& it: ntcpServer->GetNTCPSessions ()) + auto sessions = ntcpServer->GetNTCPSessions (); + s << "NTCP ( " << (int) sessions.size() << " )
\r\n"; + for (const auto& it: sessions ) { if (it.second && it.second->IsEstablished ()) { @@ -512,8 +513,9 @@ namespace http { auto ssuServer = i2p::transport::transports.GetSSUServer (); if (ssuServer) { - s << "
\r\nSSU
\r\n"; - for (const auto& it: ssuServer->GetSessions ()) + auto sessions = ssuServer->GetSessions (); + s << "
\r\nSSU ( " << (int) sessions.size() << " )
\r\n"; + for (const auto& it: sessions) { auto endpoint = it.second->GetRemoteEndpoint (); if (it.second->IsOutgoing ()) s << " ⇒ "; @@ -604,6 +606,15 @@ namespace http { s << i2p::client::context.GetAddressBook ().ToAddress(ident); s << "
\r\n"<< std::endl; } + auto socksProxy = i2p::client::context.GetSocksProxy (); + if (socksProxy) + { + auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash(); + s << ""; + s << "SOCKS Proxy" << " ⇐ "; + s << i2p::client::context.GetAddressBook ().ToAddress(ident); + s << "
\r\n"<< std::endl; + } s << "
\r\nServer Tunnels:
\r\n
\r\n"; for (auto& it: i2p::client::context.GetServerTunnels ()) { @@ -704,20 +715,22 @@ namespace http { } /* method #2: 'Authorization' header sent */ if (req.headers.count("Authorization") > 0) { + bool result = false; std::string provided = req.headers.find("Authorization")->second; std::string expected = user + ":" + pass; - char b64_creds[64]; + size_t b64_sz = i2p::data::Base64EncodingBufferSize(expected.length()) + 1; + char * b64_creds = new char[b64_sz]; std::size_t len = 0; - len = i2p::data::ByteStreamToBase64((unsigned char *)expected.c_str(), expected.length(), b64_creds, sizeof(b64_creds)); + len = i2p::data::ByteStreamToBase64((unsigned char *)expected.c_str(), expected.length(), b64_creds, b64_sz); /* if we decoded properly then check credentials */ if(len) { b64_creds[len] = '\0'; expected = "Basic "; expected += b64_creds; - return expected == provided; + result = expected == provided; } - /** we decoded wrong so it's not a correct login credential */ - return false; + delete [] b64_creds; + return result; } LogPrint(eLogWarning, "HTTPServer: auth failure from ", m_Socket->remote_endpoint().address ()); @@ -775,6 +788,7 @@ namespace http { { uint32_t token; RAND_bytes ((uint8_t *)&token, 4); + token &= 0x7FFFFFFF; // clear first bit auto ts = i2p::util::GetSecondsSinceEpoch (); for (auto it = m_Tokens.begin (); it != m_Tokens.end (); ) { diff --git a/I2PTunnel.cpp b/I2PTunnel.cpp index ff3e06a3..e94b5ed4 100644 --- a/I2PTunnel.cpp +++ b/I2PTunnel.cpp @@ -92,7 +92,8 @@ namespace client m_Stream->Close (); m_Stream.reset (); } - m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_send); // avoid RST + boost::system::error_code ec; + m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec); // avoid RST m_Socket->close (); Done(shared_from_this ()); diff --git a/Log.cpp b/Log.cpp index a38fc808..7cd4205e 100644 --- a/Log.cpp +++ b/Log.cpp @@ -72,7 +72,6 @@ namespace log { { if (!m_IsRunning) { - Reopen (); m_IsRunning = true; m_Thread = new std::thread (std::bind (&Log::Run, this)); } @@ -162,6 +161,7 @@ namespace log { void Log::Run () { + Reopen (); while (m_IsRunning) { std::shared_ptr msg; diff --git a/NTCPSession.cpp b/NTCPSession.cpp index 81cfe687..712006c4 100644 --- a/NTCPSession.cpp +++ b/NTCPSession.cpp @@ -116,16 +116,10 @@ namespace transport void NTCPSession::ServerLogin () { - boost::system::error_code ec; - auto ep = m_Socket.remote_endpoint(ec); - if (!ec) - { - m_ConnectedFrom = ep.address (); - // receive Phase1 - boost::asio::async_read (m_Socket, boost::asio::buffer(&m_Establisher->phase1, sizeof (NTCPPhase1)), boost::asio::transfer_all (), - std::bind(&NTCPSession::HandlePhase1Received, shared_from_this (), - std::placeholders::_1, std::placeholders::_2)); - } + // receive Phase1 + boost::asio::async_read (m_Socket, boost::asio::buffer(&m_Establisher->phase1, sizeof (NTCPPhase1)), boost::asio::transfer_all (), + std::bind(&NTCPSession::HandlePhase1Received, shared_from_this (), + std::placeholders::_1, std::placeholders::_2)); } void NTCPSession::HandlePhase1Sent (const boost::system::error_code& ecode, std::size_t bytes_transferred) @@ -502,8 +496,6 @@ namespace transport if (ecode) { if (ecode != boost::asio::error::operation_aborted) LogPrint (eLogDebug, "NTCP: Read error: ", ecode.message ()); - if (!m_NumReceivedBytes) - m_Server.Ban (m_ConnectedFrom); //if (ecode != boost::asio::error::operation_aborted) Terminate (); } @@ -890,18 +882,6 @@ namespace transport if (!ec) { LogPrint (eLogDebug, "NTCP: Connected from ", ep); - auto it = m_BanList.find (ep.address ()); - if (it != m_BanList.end ()) - { - uint32_t ts = i2p::util::GetSecondsSinceEpoch (); - if (ts < it->second) - { - LogPrint (eLogWarning, "NTCP: ", ep.address (), " is banned for ", it->second - ts, " more seconds"); - conn = nullptr; - } - else - m_BanList.erase (it); - } if (conn) conn->ServerLogin (); } @@ -927,18 +907,6 @@ namespace transport if (!ec) { LogPrint (eLogDebug, "NTCP: Connected from ", ep); - auto it = m_BanList.find (ep.address ()); - if (it != m_BanList.end ()) - { - uint32_t ts = i2p::util::GetSecondsSinceEpoch (); - if (ts < it->second) - { - LogPrint (eLogWarning, "NTCP: ", ep.address (), " is banned for ", it->second - ts, " more seconds"); - conn = nullptr; - } - else - m_BanList.erase (it); - } if (conn) conn->ServerLogin (); } @@ -996,13 +964,6 @@ namespace transport } } - void NTCPServer::Ban (const boost::asio::ip::address& addr) - { - uint32_t ts = i2p::util::GetSecondsSinceEpoch (); - m_BanList[addr] = ts + NTCP_BAN_EXPIRATION_TIMEOUT; - LogPrint (eLogWarning, "NTCP: ", addr, " has been banned for ", NTCP_BAN_EXPIRATION_TIMEOUT, " seconds"); - } - void NTCPServer::ScheduleTermination () { m_TerminationTimer.expires_from_now (boost::posix_time::seconds(NTCP_TERMINATION_CHECK_TIMEOUT)); diff --git a/NTCPSession.h b/NTCPSession.h index 639942f2..b02543be 100644 --- a/NTCPSession.h +++ b/NTCPSession.h @@ -122,8 +122,6 @@ namespace transport bool m_IsSending; std::vector > m_SendQueue; - - boost::asio::ip::address m_ConnectedFrom; // for ban }; // TODO: move to NTCP.h/.cpp @@ -145,8 +143,7 @@ namespace transport bool IsBoundV4() const { return m_NTCPAcceptor != nullptr; }; bool IsBoundV6() const { return m_NTCPV6Acceptor != nullptr; }; - boost::asio::io_service& GetService () { return m_Service; }; - void Ban (const boost::asio::ip::address& addr); + boost::asio::io_service& GetService () { return m_Service; }; private: @@ -169,7 +166,6 @@ namespace transport boost::asio::deadline_timer m_TerminationTimer; boost::asio::ip::tcp::acceptor * m_NTCPAcceptor, * m_NTCPV6Acceptor; std::map > m_NTCPSessions; // access from m_Thread only - std::map m_BanList; // IP -> ban expiration time in seconds public: diff --git a/Profiling.cpp b/Profiling.cpp index 890a2620..34e0681f 100644 --- a/Profiling.cpp +++ b/Profiling.cpp @@ -12,8 +12,8 @@ namespace data { i2p::fs::HashedStorage m_ProfilesStorage("peerProfiles", "p", "profile-", "txt"); - RouterProfile::RouterProfile (const IdentHash& identHash): - m_IdentHash (identHash), m_LastUpdateTime (boost::posix_time::second_clock::local_time()), + RouterProfile::RouterProfile (): + m_LastUpdateTime (boost::posix_time::second_clock::local_time()), m_NumTunnelsAgreed (0), m_NumTunnelsDeclined (0), m_NumTunnelsNonReplied (0), m_NumTimesTaken (0), m_NumTimesRejected (0) { @@ -29,7 +29,7 @@ namespace data m_LastUpdateTime = GetTime (); } - void RouterProfile::Save () + void RouterProfile::Save (const IdentHash& identHash) { // fill sections boost::property_tree::ptree participation; @@ -46,7 +46,7 @@ namespace data pt.put_child (PEER_PROFILE_SECTION_USAGE, usage); // save to file - std::string ident = m_IdentHash.ToBase64 (); + std::string ident = identHash.ToBase64 (); std::string path = m_ProfilesStorage.Path(ident); try { @@ -57,51 +57,64 @@ namespace data } } - void RouterProfile::Load () + void RouterProfile::Load (const IdentHash& identHash) { - std::string ident = m_IdentHash.ToBase64 (); + std::string ident = identHash.ToBase64 (); std::string path = m_ProfilesStorage.Path(ident); boost::property_tree::ptree pt; - if (!i2p::fs::Exists(path)) { + if (!i2p::fs::Exists(path)) + { LogPrint(eLogWarning, "Profiling: no profile yet for ", ident); return; } - try { + try + { boost::property_tree::read_ini (path, pt); - } catch (std::exception& ex) { + } catch (std::exception& ex) + { /* boost exception verbose enough */ LogPrint (eLogError, "Profiling: ", ex.what ()); return; } - try { + try + { auto t = pt.get (PEER_PROFILE_LAST_UPDATE_TIME, ""); if (t.length () > 0) m_LastUpdateTime = boost::posix_time::time_from_string (t); - if ((GetTime () - m_LastUpdateTime).hours () < PEER_PROFILE_EXPIRATION_TIMEOUT) { - try { + if ((GetTime () - m_LastUpdateTime).hours () < PEER_PROFILE_EXPIRATION_TIMEOUT) + { + try + { // read participations auto participations = pt.get_child (PEER_PROFILE_SECTION_PARTICIPATION); m_NumTunnelsAgreed = participations.get (PEER_PROFILE_PARTICIPATION_AGREED, 0); m_NumTunnelsDeclined = participations.get (PEER_PROFILE_PARTICIPATION_DECLINED, 0); m_NumTunnelsNonReplied = participations.get (PEER_PROFILE_PARTICIPATION_NON_REPLIED, 0); - } catch (boost::property_tree::ptree_bad_path& ex) { + } + catch (boost::property_tree::ptree_bad_path& ex) + { LogPrint (eLogWarning, "Profiling: Missing section ", PEER_PROFILE_SECTION_PARTICIPATION, " in profile for ", ident); } - try { + try + { // read usage auto usage = pt.get_child (PEER_PROFILE_SECTION_USAGE); m_NumTimesTaken = usage.get (PEER_PROFILE_USAGE_TAKEN, 0); m_NumTimesRejected = usage.get (PEER_PROFILE_USAGE_REJECTED, 0); - } catch (boost::property_tree::ptree_bad_path& ex) { + } + catch (boost::property_tree::ptree_bad_path& ex) + { LogPrint (eLogWarning, "Missing section ", PEER_PROFILE_SECTION_USAGE, " in profile for ", ident); } - } else { - *this = RouterProfile (m_IdentHash); - } - } catch (std::exception& ex) { + } + else + *this = RouterProfile (); + } + catch (std::exception& ex) + { LogPrint (eLogError, "Profiling: Can't read profile ", ident, " :", ex.what ()); } } @@ -149,8 +162,8 @@ namespace data std::shared_ptr GetRouterProfile (const IdentHash& identHash) { - auto profile = std::make_shared (identHash); - profile->Load (); // if possible + auto profile = std::make_shared (); + profile->Load (identHash); // if possible return profile; } diff --git a/Profiling.h b/Profiling.h index 26d5c2f7..34ed4f72 100644 --- a/Profiling.h +++ b/Profiling.h @@ -26,11 +26,11 @@ namespace data { public: - RouterProfile (const IdentHash& identHash); + RouterProfile (); RouterProfile& operator= (const RouterProfile& ) = default; - void Save (); - void Load (); + void Save (const IdentHash& identHash); + void Load (const IdentHash& identHash); bool IsBad (); @@ -48,7 +48,6 @@ namespace data private: - IdentHash m_IdentHash; boost::posix_time::ptime m_LastUpdateTime; // participation uint32_t m_NumTunnelsAgreed; diff --git a/Reseed.cpp b/Reseed.cpp index adba530b..b4eaa76c 100644 --- a/Reseed.cpp +++ b/Reseed.cpp @@ -444,6 +444,7 @@ namespace data s.lowest_layer().connect (*it, ecode); if (!ecode) { + SSL_set_tlsext_host_name(s.native_handle(), url.host.c_str ()); s.handshake (boost::asio::ssl::stream_base::client, ecode); if (!ecode) { diff --git a/RouterInfo.h b/RouterInfo.h index e8a4ea75..c51d3ce4 100644 --- a/RouterInfo.h +++ b/RouterInfo.h @@ -168,7 +168,7 @@ namespace data bool SaveToFile (const std::string& fullPath); std::shared_ptr GetProfile () const; - void SaveProfile () { if (m_Profile) m_Profile->Save (); }; + void SaveProfile () { if (m_Profile) m_Profile->Save (GetIdentHash ()); }; void Update (const uint8_t * buf, int len); void DeleteBuffer () { delete[] m_Buffer; m_Buffer = nullptr; }; diff --git a/SAM.cpp b/SAM.cpp index c61e8577..cb704ebd 100644 --- a/SAM.cpp +++ b/SAM.cpp @@ -54,7 +54,11 @@ namespace client case eSAMSocketTypeAcceptor: { if (m_Session) + { m_Session->DelSocket (shared_from_this ()); + if (m_Session->localDestination) + m_Session->localDestination->StopAcceptingStreams (); + } break; } default: @@ -285,11 +289,6 @@ namespace client dest->SetReceiver (std::bind (&SAMSocket::HandleI2PDatagramReceive, shared_from_this (), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); } - else - { - // start accepting streams because we're not a datagram session - m_Session->localDestination->AcceptStreams (std::bind (&SAMSession::AcceptI2P, m_Session, std::placeholders::_1)); - } if (m_Session->localDestination->IsReady ()) SendSessionCreateReplyOk (); @@ -401,26 +400,17 @@ namespace client m_ID = id; m_Session = m_Owner.FindSession (id); if (m_Session) - { + { m_SocketType = eSAMSocketTypeAcceptor; m_Session->AddSocket (shared_from_this ()); + if (!m_Session->localDestination->IsAcceptingStreams ()) + m_Session->localDestination->AcceptOnce (std::bind (&SAMSocket::HandleI2PAccept, shared_from_this (), std::placeholders::_1)); SendMessageReply (SAM_STREAM_STATUS_OK, strlen(SAM_STREAM_STATUS_OK), false); } else SendMessageReply (SAM_STREAM_STATUS_INVALID_ID, strlen(SAM_STREAM_STATUS_INVALID_ID), true); } - void SAMSocket::Accept(std::shared_ptr stream) - { - if(stream) { - m_SocketType = eSAMSocketTypeStream; - HandleI2PAccept(stream); - } else { - SendMessageReply (SAM_STREAM_STATUS_I2P_ERROR, strlen(SAM_STREAM_STATUS_I2P_ERROR), true); - auto s = shared_from_this (); - m_Owner.GetService ().post ([s] { s->Terminate (); }); - } - } size_t SAMSocket::ProcessDatagramSend (char * buf, size_t len, const char * data) { LogPrint (eLogDebug, "SAM: datagram send: ", buf, " ", len); @@ -663,8 +653,20 @@ namespace client if (stream) { LogPrint (eLogDebug, "SAM: incoming I2P connection for session ", m_ID); + m_SocketType = eSAMSocketTypeStream; m_Stream = stream; context.GetAddressBook ().InsertAddress (stream->GetRemoteIdentity ()); + auto session = m_Owner.FindSession (m_ID); + if (session) + { + // find more pending acceptors + for (auto it: session->ListSockets ()) + if (it->m_SocketType == eSAMSocketTypeAcceptor) + { + session->localDestination->AcceptOnce (std::bind (&SAMSocket::HandleI2PAccept, it, std::placeholders::_1)); + break; + } + } if (!m_IsSilent) { // get remote peer address @@ -706,76 +708,26 @@ namespace client } SAMSession::SAMSession (std::shared_ptr dest): - localDestination (dest), - m_BacklogPumper(dest->GetService()) - { - PumpBacklog(); - } - - void SAMSession::AcceptI2P(std::shared_ptr stream) - { - if(!stream) return; // fail - std::unique_lock lock(m_SocketsMutex); - if(m_Backlog.size() > SAM_MAX_ACCEPT_BACKLOG) { - stream->Close(); - return; - } - m_Backlog.push_back(stream); - } - - void SAMSession::PumpBacklog() - { - // pump backlog every 100ms - boost::posix_time::milliseconds dlt(100); - m_BacklogPumper.expires_from_now(dlt); - m_BacklogPumper.async_wait(std::bind(&SAMSession::HandlePumpBacklog, this, std::placeholders::_1)); - } - - std::shared_ptr SAMSession::FindAcceptor() + localDestination (dest) { - for (auto & sock : m_Sockets) { - auto t = sock->GetSocketType(); - if(t == eSAMSocketTypeAcceptor) { - return sock; - } - } - return nullptr; } - - void SAMSession::HandlePumpBacklog(const boost::system::error_code & ec) + + SAMSession::~SAMSession () { - if(ec) return; - { - std::unique_lock lock(m_SocketsMutex); - auto itr = m_Backlog.begin(); - while(itr != m_Backlog.end()) { - auto sock = FindAcceptor(); - if (sock) { - sock->Accept(*itr); - itr = m_Backlog.erase(itr); - } else { - ++itr; - } - } - } - PumpBacklog(); + CloseStreams(); + i2p::client::context.DeleteLocalDestination (localDestination); } void SAMSession::CloseStreams () { - m_BacklogPumper.cancel(); - localDestination->GetService().post([&] () { + { std::lock_guard lock(m_SocketsMutex); for (auto& sock : m_Sockets) { sock->CloseStream(); } - for(auto & stream : m_Backlog) { - stream->Close(); - } - m_Sockets.clear(); - m_Backlog.clear(); - i2p::client::context.DeleteLocalDestination (localDestination); - }); + } + // XXX: should this be done inside locked parts? + m_Sockets.clear(); } SAMBridge::SAMBridge (const std::string& address, int port): @@ -886,9 +838,8 @@ namespace client auto session = std::make_shared(localDestination); std::unique_lock l(m_SessionsMutex); auto ret = m_Sessions.insert (std::make_pair(id, session)); - if (!ret.second) { + if (!ret.second) LogPrint (eLogWarning, "SAM: Session ", id, " already exists"); - } return ret.first->second; } return nullptr; diff --git a/SAM.h b/SAM.h index 7d7d6d3a..db08c5a0 100644 --- a/SAM.h +++ b/SAM.h @@ -20,8 +20,7 @@ namespace client { const size_t SAM_SOCKET_BUFFER_SIZE = 8192; const int SAM_SOCKET_CONNECTION_MAX_IDLE = 3600; // in seconds - const int SAM_SESSION_READINESS_CHECK_INTERVAL = 20; // in seconds - const int SAM_MAX_ACCEPT_BACKLOG = 50; + const int SAM_SESSION_READINESS_CHECK_INTERVAL = 20; // in seconds const char SAM_HANDSHAKE[] = "HELLO VERSION"; const char SAM_HANDSHAKE_REPLY[] = "HELLO REPLY RESULT=OK VERSION=%s\n"; const char SAM_HANDSHAKE_I2P_ERROR[] = "HELLO REPLY RESULT=I2P_ERROR\n"; @@ -85,8 +84,6 @@ namespace client void SetSocketType (SAMSocketType socketType) { m_SocketType = socketType; }; SAMSocketType GetSocketType () const { return m_SocketType; }; - void Accept(std::shared_ptr stream); - private: void Terminate (); @@ -137,8 +134,6 @@ namespace client struct SAMSession { std::shared_ptr localDestination; - boost::asio::deadline_timer m_BacklogPumper; - std::list > m_Backlog; std::list > m_Sockets; std::mutex m_SocketsMutex; @@ -163,15 +158,9 @@ namespace client } return l; } - - SAMSession (std::shared_ptr dest); - - void AcceptI2P(std::shared_ptr stream); - - std::shared_ptr FindAcceptor(); - - void PumpBacklog(); - void HandlePumpBacklog(const boost::system::error_code & ec); + + SAMSession (std::shared_ptr dest); + ~SAMSession (); void CloseStreams (); }; diff --git a/SSU.cpp b/SSU.cpp index 198fed4b..9f74185f 100644 --- a/SSU.cpp +++ b/SSU.cpp @@ -154,16 +154,26 @@ namespace transport } } - void SSUServer::AddRelay (uint32_t tag, const boost::asio::ip::udp::endpoint& relay) + void SSUServer::AddRelay (uint32_t tag, std::shared_ptr relay) { m_Relays[tag] = relay; } + void SSUServer::RemoveRelay (uint32_t tag) + { + m_Relays.erase (tag); + } + std::shared_ptr SSUServer::FindRelaySession (uint32_t tag) { auto it = m_Relays.find (tag); if (it != m_Relays.end ()) - return FindSession (it->second); + { + if (it->second->GetState () == eSessionStateEstablished) + return it->second; + else + m_Relays.erase (it); + } return nullptr; } diff --git a/SSU.h b/SSU.h index 9d8e2878..adbed739 100644 --- a/SSU.h +++ b/SSU.h @@ -57,7 +57,8 @@ namespace transport boost::asio::io_service& GetServiceV6 () { return m_ServiceV6; }; const boost::asio::ip::udp::endpoint& GetEndpoint () const { return m_Endpoint; }; void Send (const uint8_t * buf, size_t len, const boost::asio::ip::udp::endpoint& to); - void AddRelay (uint32_t tag, const boost::asio::ip::udp::endpoint& relay); + void AddRelay (uint32_t tag, std::shared_ptr relay); + void RemoveRelay (uint32_t tag); std::shared_ptr FindRelaySession (uint32_t tag); void NewPeerTest (uint32_t nonce, PeerTestParticipant role, std::shared_ptr session = nullptr); @@ -119,7 +120,7 @@ namespace transport m_TerminationTimer, m_TerminationTimerV6; std::list m_Introducers; // introducers we are connected to std::map > m_Sessions, m_SessionsV6; - std::map m_Relays; // we are introducer + std::map > m_Relays; // we are introducer std::map m_PeerTests; // nonce -> creation time in milliseconds public: diff --git a/SSUSession.cpp b/SSUSession.cpp index 0e277432..a47295fa 100644 --- a/SSUSession.cpp +++ b/SSUSession.cpp @@ -16,7 +16,7 @@ namespace transport TransportSession (router, SSU_TERMINATION_TIMEOUT), m_Server (server), m_RemoteEndpoint (remoteEndpoint), m_ConnectTimer (GetService ()), m_IsPeerTest (peerTest),m_State (eSessionStateUnknown), m_IsSessionKey (false), - m_RelayTag (0),m_Data (*this), m_IsDataReceived (false) + m_RelayTag (0), m_SentRelayTag (0), m_Data (*this), m_IsDataReceived (false) { if (router) { @@ -458,14 +458,12 @@ namespace transport else s.Insert (address->host.to_v6 ().to_bytes ().data (), 16); // our IP V6 s.Insert (htobe16 (address->port)); // our port - uint32_t relayTag = 0; if (sendRelayTag && i2p::context.GetRouterInfo ().IsIntroducer () && !IsV6 ()) { - RAND_bytes((uint8_t *)&relayTag, 4); - if (!relayTag) relayTag = 1; - m_Server.AddRelay (relayTag, m_RemoteEndpoint); + RAND_bytes((uint8_t *)&m_SentRelayTag, 4); + if (!m_SentRelayTag) m_SentRelayTag = 1; } - htobe32buf (payload, relayTag); + htobe32buf (payload, m_SentRelayTag); payload += 4; // relay tag htobe32buf (payload, i2p::util::GetSecondsSinceEpoch ()); // signed on time payload += 4; @@ -870,6 +868,8 @@ namespace transport transports.PeerDisconnected (shared_from_this ()); m_Data.Stop (); m_ConnectTimer.cancel (); + if (m_SentRelayTag) + m_Server.RemoveRelay (m_SentRelayTag); // relay tag is not valid anymore } void SSUSession::Done () @@ -886,6 +886,8 @@ namespace transport transports.PeerConnected (shared_from_this ()); if (m_IsPeerTest) SendPeerTest (); + if (m_SentRelayTag) + m_Server.AddRelay (m_SentRelayTag, shared_from_this ()); m_LastActivityTimestamp = i2p::util::GetSecondsSinceEpoch (); } diff --git a/SSUSession.h b/SSUSession.h index 4838be2a..b25beeae 100644 --- a/SSUSession.h +++ b/SSUSession.h @@ -141,7 +141,8 @@ namespace transport bool m_IsPeerTest; SessionState m_State; bool m_IsSessionKey; - uint32_t m_RelayTag; + uint32_t m_RelayTag; // received from peer + uint32_t m_SentRelayTag; // sent by us i2p::crypto::CBCEncryption m_SessionKeyEncryption; i2p::crypto::CBCDecryption m_SessionKeyDecryption; i2p::crypto::AESKey m_SessionKey; diff --git a/Streaming.cpp b/Streaming.cpp index 762dd9d6..ff14aadb 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -1037,6 +1037,29 @@ namespace stream m_Acceptor = nullptr; } + void StreamingDestination::AcceptOnce (const Acceptor& acceptor) + { + m_Owner->GetService ().post([acceptor, this](void) + { + if (!m_PendingIncomingStreams.empty ()) + { + acceptor (m_PendingIncomingStreams.front ()); + m_PendingIncomingStreams.pop_front (); + if (m_PendingIncomingStreams.empty ()) + m_PendingIncomingTimer.cancel (); + } + else // we must save old acceptor and set it back + { + auto oldAcceptor = m_Acceptor; + m_Acceptor = [acceptor, oldAcceptor, this](std::shared_ptr stream) + { + acceptor (stream); + m_Acceptor = oldAcceptor; + }; + } + }); + } + void StreamingDestination::HandlePendingIncomingTimer (const boost::system::error_code& ecode) { if (ecode != boost::asio::error::operation_aborted) diff --git a/Streaming.h b/Streaming.h index 65a8d8b4..1593f961 100644 --- a/Streaming.h +++ b/Streaming.h @@ -223,6 +223,8 @@ namespace stream void SetAcceptor (const Acceptor& acceptor); void ResetAcceptor (); bool IsAcceptorSet () const { return m_Acceptor != nullptr; }; + void AcceptOnce (const Acceptor& acceptor); + std::shared_ptr GetOwner () const { return m_Owner; }; void SetOwner (std::shared_ptr owner) { m_Owner = owner; }; uint16_t GetLocalPort () const { return m_LocalPort; }; diff --git a/Transports.cpp b/Transports.cpp index 1b9d52a1..163a7da9 100644 --- a/Transports.cpp +++ b/Transports.cpp @@ -108,8 +108,8 @@ namespace transport Transports transports; Transports::Transports (): - m_IsOnline (true), m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service), - m_PeerCleanupTimer (m_Service), m_PeerTestTimer (m_Service), + m_IsOnline (true), m_IsRunning (false), m_Thread (nullptr), m_Service (nullptr), + m_Work (nullptr), m_PeerCleanupTimer (nullptr), m_PeerTestTimer (nullptr), m_NTCPServer (nullptr), m_SSUServer (nullptr), m_DHKeysPairSupplier (5), // 5 pre-generated keys m_TotalSentBytes(0), m_TotalReceivedBytes(0), m_InBandwidth (0), m_OutBandwidth (0), m_LastInBandwidthUpdateBytes (0), m_LastOutBandwidthUpdateBytes (0), m_LastBandwidthUpdateTime (0) @@ -119,10 +119,25 @@ namespace transport Transports::~Transports () { Stop (); + if (m_Service) + { + delete m_PeerCleanupTimer; m_PeerCleanupTimer = nullptr; + delete m_PeerTestTimer; m_PeerTestTimer = nullptr; + delete m_Work; m_Work = nullptr; + delete m_Service; m_Service = nullptr; + } } void Transports::Start (bool enableNTCP, bool enableSSU) { + if (!m_Service) + { + m_Service = new boost::asio::io_service (); + m_Work = new boost::asio::io_service::work (*m_Service); + m_PeerCleanupTimer = new boost::asio::deadline_timer (*m_Service); + m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service); + } + m_DHKeysPairSupplier.Start (); m_IsRunning = true; m_Thread = new std::thread (std::bind (&Transports::Run, this)); @@ -167,16 +182,16 @@ namespace transport LogPrint (eLogError, "Transports: SSU server already exists"); } } - m_PeerCleanupTimer.expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); - m_PeerCleanupTimer.async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); - m_PeerTestTimer.expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); - m_PeerTestTimer.async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); + m_PeerCleanupTimer->expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); + m_PeerCleanupTimer->async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); + m_PeerTestTimer->expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); + m_PeerTestTimer->async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); } void Transports::Stop () { - m_PeerCleanupTimer.cancel (); - m_PeerTestTimer.cancel (); + if (m_PeerCleanupTimer) m_PeerCleanupTimer->cancel (); + if (m_PeerTestTimer) m_PeerTestTimer->cancel (); m_Peers.clear (); if (m_SSUServer) { @@ -193,7 +208,7 @@ namespace transport m_DHKeysPairSupplier.Stop (); m_IsRunning = false; - m_Service.stop (); + if (m_Service) m_Service->stop (); if (m_Thread) { m_Thread->join (); @@ -204,11 +219,11 @@ namespace transport void Transports::Run () { - while (m_IsRunning) + while (m_IsRunning && m_Service) { try { - m_Service.run (); + m_Service->run (); } catch (std::exception& ex) { @@ -251,7 +266,7 @@ namespace transport #ifdef WITH_EVENTS EmitEvent({{"type" , "transport.sendmsg"}, {"ident", ident.ToBase64()}, {"number", std::to_string(msgs.size())}}); #endif - m_Service.post (std::bind (&Transports::PostMessages, this, ident, msgs)); + m_Service->post (std::bind (&Transports::PostMessages, this, ident, msgs)); } void Transports::PostMessages (i2p::data::IdentHash ident, std::vector > msgs) @@ -369,7 +384,7 @@ namespace transport } } } - LogPrint (eLogError, "Transports: No NTCP or SSU addresses available"); + LogPrint (eLogInfo, "Transports: No NTCP or SSU addresses available"); peer.Done (); std::unique_lock l(m_PeersMutex); m_Peers.erase (ident); @@ -386,7 +401,7 @@ namespace transport void Transports::RequestComplete (std::shared_ptr r, const i2p::data::IdentHash& ident) { - m_Service.post (std::bind (&Transports::HandleRequestComplete, this, r, ident)); + m_Service->post (std::bind (&Transports::HandleRequestComplete, this, r, ident)); } void Transports::HandleRequestComplete (std::shared_ptr r, i2p::data::IdentHash ident) @@ -411,7 +426,7 @@ namespace transport void Transports::NTCPResolve (const std::string& addr, const i2p::data::IdentHash& ident) { - auto resolver = std::make_shared(m_Service); + auto resolver = std::make_shared(*m_Service); resolver->async_resolve (boost::asio::ip::tcp::resolver::query (addr, ""), std::bind (&Transports::HandleNTCPResolve, this, std::placeholders::_1, std::placeholders::_2, ident, resolver)); @@ -454,7 +469,7 @@ namespace transport void Transports::SSUResolve (const std::string& addr, const i2p::data::IdentHash& ident) { - auto resolver = std::make_shared(m_Service); + auto resolver = std::make_shared(*m_Service); resolver->async_resolve (boost::asio::ip::tcp::resolver::query (addr, ""), std::bind (&Transports::HandleSSUResolve, this, std::placeholders::_1, std::placeholders::_2, ident, resolver)); @@ -497,7 +512,7 @@ namespace transport void Transports::CloseSession (std::shared_ptr router) { if (!router) return; - m_Service.post (std::bind (&Transports::PostCloseSession, this, router)); + m_Service->post (std::bind (&Transports::PostCloseSession, this, router)); } void Transports::PostCloseSession (std::shared_ptr router) @@ -584,7 +599,7 @@ namespace transport void Transports::PeerConnected (std::shared_ptr session) { - m_Service.post([session, this]() + m_Service->post([session, this]() { auto remoteIdentity = session->GetRemoteIdentity (); if (!remoteIdentity) return; @@ -632,7 +647,7 @@ namespace transport void Transports::PeerDisconnected (std::shared_ptr session) { - m_Service.post([session, this]() + m_Service->post([session, this]() { auto remoteIdentity = session->GetRemoteIdentity (); if (!remoteIdentity) return; @@ -679,7 +694,7 @@ namespace transport if (profile) { profile->TunnelNonReplied(); - profile->Save(); + profile->Save(it->first); } std::unique_lock l(m_PeersMutex); it = m_Peers.erase (it); @@ -690,8 +705,8 @@ namespace transport UpdateBandwidth (); // TODO: use separate timer(s) for it if (i2p::context.GetStatus () == eRouterStatusTesting) // if still testing, repeat peer test DetectExternalIP (); - m_PeerCleanupTimer.expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); - m_PeerCleanupTimer.async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); + m_PeerCleanupTimer->expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); + m_PeerCleanupTimer->async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); } } @@ -700,8 +715,8 @@ namespace transport if (ecode != boost::asio::error::operation_aborted) { PeerTest (); - m_PeerTestTimer.expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); - m_PeerTestTimer.async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); + m_PeerTestTimer->expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); + m_PeerTestTimer->async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); } } diff --git a/Transports.h b/Transports.h index d83c0370..a68838e2 100644 --- a/Transports.h +++ b/Transports.h @@ -84,7 +84,7 @@ namespace transport bool IsOnline() const { return m_IsOnline; }; void SetOnline (bool online) { m_IsOnline = online; }; - boost::asio::io_service& GetService () { return m_Service; }; + boost::asio::io_service& GetService () { return *m_Service; }; std::shared_ptr GetNextDHKeysPair (); void ReuseDHKeysPair (std::shared_ptr pair); @@ -144,9 +144,9 @@ namespace transport bool m_IsOnline, m_IsRunning; std::thread * m_Thread; - boost::asio::io_service m_Service; - boost::asio::io_service::work m_Work; - boost::asio::deadline_timer m_PeerCleanupTimer, m_PeerTestTimer; + boost::asio::io_service * m_Service; + boost::asio::io_service::work * m_Work; + boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer; NTCPServer * m_NTCPServer; SSUServer * m_SSUServer; diff --git a/Tunnel.cpp b/Tunnel.cpp index e1f5c035..84c4979f 100644 --- a/Tunnel.cpp +++ b/Tunnel.cpp @@ -19,36 +19,11 @@ namespace i2p { namespace tunnel -{ - - void TunnelLatency::AddSample(Sample s) - { - std::unique_lock l(m_access); - m_samples.push_back(s); - } - - bool TunnelLatency::HasSamples() const - { - std::unique_lock l(m_access); - return m_samples.size() > 0; - } - - TunnelLatency::Latency TunnelLatency::GetMeanLatency() const - { - std::unique_lock lock(m_access); - if (m_samples.size() > 0) { - Latency l = 0; - for(auto s : m_samples) - l += s; - return l / m_samples.size(); - } - return 0; - } - - +{ Tunnel::Tunnel (std::shared_ptr config): TunnelBase (config->GetTunnelID (), config->GetNextTunnelID (), config->GetNextIdentHash ()), - m_Config (config), m_Pool (nullptr), m_State (eTunnelStatePending), m_IsRecreated (false) + m_Config (config), m_Pool (nullptr), m_State (eTunnelStatePending), m_IsRecreated (false), + m_Latency (0) { } diff --git a/Tunnel.h b/Tunnel.h index f3c31461..08533ec4 100644 --- a/Tunnel.h +++ b/Tunnel.h @@ -78,21 +78,6 @@ namespace tunnel eTunnelStateFailed, eTunnelStateExpiring }; - - /** @brief for storing latency history */ - struct TunnelLatency - { - typedef uint64_t Sample; - typedef uint64_t Latency; - - - void AddSample(Sample s); - bool HasSamples() const; - Latency GetMeanLatency() const; - - std::vector m_samples; - mutable std::mutex m_access; - }; class OutboundTunnel; class InboundTunnel; @@ -133,14 +118,14 @@ namespace tunnel void SendTunnelDataMsg (std::shared_ptr msg); void EncryptTunnelMsg (std::shared_ptr in, std::shared_ptr out); - /** @brief add latency sample */ - void AddLatencySample(const uint64_t ms) { m_Latency.AddSample(ms); } - /** @brief get this tunnel's estimated latency */ - uint64_t GetMeanLatency() const { return m_Latency.GetMeanLatency(); } - /** @breif return true if this tunnel's latency fits in range [lowerbound, upperbound] */ - bool LatencyFitsRange(uint64_t lowerbound, uint64_t upperbound) const; + /** @brief add latency sample */ + void AddLatencySample(const uint64_t ms) { m_Latency = (m_Latency + ms) >> 1; } + /** @brief get this tunnel's estimated latency */ + uint64_t GetMeanLatency() const { return m_Latency; } + /** @breif return true if this tunnel's latency fits in range [lowerbound, upperbound] */ + bool LatencyFitsRange(uint64_t lowerbound, uint64_t upperbound) const; - bool LatencyIsKnown() const { return m_Latency.HasSamples(); } + bool LatencyIsKnown() const { return m_Latency > 0; } protected: void PrintHops (std::stringstream& s) const; @@ -152,7 +137,7 @@ namespace tunnel std::shared_ptr m_Pool; // pool, tunnel belongs to, or null TunnelState m_State; bool m_IsRecreated; - TunnelLatency m_Latency; + uint64_t m_Latency; // in milliseconds }; class OutboundTunnel: public Tunnel diff --git a/TunnelConfig.h b/TunnelConfig.h index cb31243f..c131059c 100644 --- a/TunnelConfig.h +++ b/TunnelConfig.h @@ -101,8 +101,7 @@ namespace tunnel htobe32buf (clearText + BUILD_REQUEST_RECORD_REQUEST_TIME_OFFSET, i2p::util::GetHoursSinceEpoch ()); htobe32buf (clearText + BUILD_REQUEST_RECORD_SEND_MSG_ID_OFFSET, replyMsgID); RAND_bytes (clearText + BUILD_REQUEST_RECORD_PADDING_OFFSET, BUILD_REQUEST_RECORD_CLEAR_TEXT_SIZE - BUILD_REQUEST_RECORD_PADDING_OFFSET); - i2p::crypto::ElGamalEncryption elGamalEncryption (ident->GetEncryptionPublicKey ()); - elGamalEncryption.Encrypt (clearText, record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET); + i2p::crypto::ElGamalEncrypt (ident->GetEncryptionPublicKey (), clearText, record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET); memcpy (record + BUILD_REQUEST_RECORD_TO_PEER_OFFSET, (const uint8_t *)ident->GetIdentHash (), 16); } }; diff --git a/TunnelGateway.cpp b/TunnelGateway.cpp index ad423fc0..9f13d84c 100644 --- a/TunnelGateway.cpp +++ b/TunnelGateway.cpp @@ -20,6 +20,7 @@ namespace tunnel TunnelGatewayBuffer::~TunnelGatewayBuffer () { + ClearTunnelDataMsgs (); } void TunnelGatewayBuffer::PutI2NPMsg (const TunnelMessageBlock& block) @@ -48,7 +49,7 @@ namespace tunnel di[0] = block.deliveryType << 5; // set delivery type // create fragments - std::shared_ptr msg = block.data; + const std::shared_ptr & msg = block.data; size_t fullMsgLen = diLen + msg->GetLength () + 2; // delivery instructions + payload + 2 bytes length if (fullMsgLen <= m_RemainingSize) { @@ -115,9 +116,13 @@ namespace tunnel m_CurrentTunnelDataMsg->len += s+7; if (isLastFragment) { - m_RemainingSize -= s+7; - if (!m_RemainingSize) - CompleteCurrentTunnelDataMessage (); + if(m_RemainingSize < (s+7)) { + LogPrint (eLogError, "TunnelGateway: remaining size overflow: ", m_RemainingSize, " < ", s+7); + } else { + m_RemainingSize -= s+7; + if (m_RemainingSize == 0) + CompleteCurrentTunnelDataMessage (); + } } else CompleteCurrentTunnelDataMessage (); @@ -138,10 +143,12 @@ namespace tunnel void TunnelGatewayBuffer::ClearTunnelDataMsgs () { m_TunnelDataMsgs.clear (); + m_CurrentTunnelDataMsg = nullptr; } void TunnelGatewayBuffer::CreateCurrentTunnelDataMessage () { + m_CurrentTunnelDataMsg = nullptr; m_CurrentTunnelDataMsg = NewI2NPShortMessage (); m_CurrentTunnelDataMsg->Align (12); // we reserve space for padding @@ -196,7 +203,7 @@ namespace tunnel void TunnelGateway::SendBuffer () { m_Buffer.CompleteCurrentTunnelDataMessage (); - auto tunnelMsgs = m_Buffer.GetTunnelDataMsgs (); + const auto & tunnelMsgs = m_Buffer.GetTunnelDataMsgs (); for (auto& tunnelMsg : tunnelMsgs) { m_Tunnel->EncryptTunnelMsg (tunnelMsg, tunnelMsg); diff --git a/android/project.properties b/android/project.properties index 7ce68660..f72b9716 100644 --- a/android/project.properties +++ b/android/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-24 +target=android-25 diff --git a/android/res/drawable/icon.png b/android/res/drawable/icon.png index a5dc7b68..9a2f7404 100644 Binary files a/android/res/drawable/icon.png and b/android/res/drawable/icon.png differ diff --git a/android/res/drawable/itoopie_notification_icon.png b/android/res/drawable/itoopie_notification_icon.png index 8fbe2468..d055bc8f 100644 Binary files a/android/res/drawable/itoopie_notification_icon.png and b/android/res/drawable/itoopie_notification_icon.png differ diff --git a/contrib/certificates/reseed/cheezybudz_at_mail.i2p.crt b/contrib/certificates/reseed/cheezybudz_at_mail.i2p.crt deleted file mode 100644 index fecdf0b9..00000000 --- a/contrib/certificates/reseed/cheezybudz_at_mail.i2p.crt +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFhTCCA22gAwIBAgIEeCJXkjANBgkqhkiG9w0BAQ0FADBzMQswCQYDVQQGEwJY -WDELMAkGA1UECBMCWFgxCzAJBgNVBAcTAlhYMR4wHAYDVQQKExVJMlAgQW5vbnlt -b3VzIE5ldHdvcmsxDDAKBgNVBAsTA0kyUDEcMBoGA1UEAwwTY2hlZXp5YnVkekBt -YWlsLmkycDAeFw0xNDEyMTYyMTU3MTZaFw0yNDEyMTUyMTU3MTZaMHMxCzAJBgNV -BAYTAlhYMQswCQYDVQQIEwJYWDELMAkGA1UEBxMCWFgxHjAcBgNVBAoTFUkyUCBB -bm9ueW1vdXMgTmV0d29yazEMMAoGA1UECxMDSTJQMRwwGgYDVQQDDBNjaGVlenli -dWR6QG1haWwuaTJwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgLkj -Jsp8pjRi5N/JHHz+MXisgbI9G0vpd3yDhHvae3oF87iiQbxflcdcoH0l5RZL0cAn -w4amhqoOk2qhf+NSAEkiPWhk7CzPBRwDExEM/gmHYLWXbfnoHGaEls9ORGuDlDmN -hCFJVrxaZocIOi/7gZ4A+tC8wq+1aoe0Yhr381OW59w9AdUAWjBWibO3V59dEklL -7HqfOc2v7AMKDLJWgPekj8ZbqA9lRxHM6Djtjz4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hiPi1pudFWFJFWk4WOjrK/juwHHfHNgFVyziva4q6wPKrPno0gO5pCpfRUld -QAoSPgo8LAB3dugt5Xfsuone2GhLi1SLQlWFJWHswd/ypWa0FB+xn6Edkc1noOWY -06dwfEP/gTCAnSplLyrFWxnyHManBxq/bQ== ------END CERTIFICATE----- diff --git a/contrib/certificates/reseed/hottuna_at_mail.i2p.crt b/contrib/certificates/reseed/hottuna_at_mail.i2p.crt new file mode 100644 index 00000000..d0ff7c33 --- /dev/null +++ b/contrib/certificates/reseed/hottuna_at_mail.i2p.crt @@ -0,0 +1,33 @@ +-----BEGIN CERTIFICATE----- +MIIFxzCCA6+gAwIBAgIQZfqn0yiJL3dGgCjeOeWS6DANBgkqhkiG9w0BAQsFADBw +MQswCQYDVQQGEwJYWDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR4wHAYDVQQK +ExVJMlAgQW5vbnltb3VzIE5ldHdvcmsxDDAKBgNVBAsTA0kyUDEZMBcGA1UEAwwQ +aG90dHVuYUBtYWlsLmkycDAeFw0xNjExMDkwMzE1MzJaFw0yNjExMDkwMzE1MzJa +MHAxCzAJBgNVBAYTAlhYMQswCQYDVQQHEwJYWDELMAkGA1UECRMCWFgxHjAcBgNV +BAoTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEMMAoGA1UECxMDSTJQMRkwFwYDVQQD +DBBob3R0dW5hQG1haWwuaTJwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC +AgEA21Bfgcc9VVH4l2u1YvYlTw2OPUyQb16X2IOW0PzdsUO5W78Loueu974BkiKi +84lQZanLr0OwEopdfutGc6gegSLmwaWx5YCG5uwpLOPkDiObfX+nptH6As/B1cn+ +mzejYdVKRnWd7EtHW0iseSsILBK1YbGw4AGpXJ8k18DJSzUt2+spOkpBW6XqectN +8y2JDSTns8yiNxietVeRN/clolDXT9ZwWHkd+QMHTKhgl3Uz1knOffU0L9l4ij4E +oFgPfQo8NL63kLM24hF1hM/At7XvE4iO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j1BXpeBWUBQgluFv+lNMVNPJxc2OMELR1EtEwXD7mTuuUEtF5Pi63IerQ5LzD3G +KBvXhMB0XhpE6WG6pBwAvkGf5zVv/CxClJH4BQbdZwj9HYddfEQlPl0z/XFR2M0+ +9/8nBfGSPYIt6KeHBCeyQWTdE9gqSzMwTMFsennXmaT8gyc7eKqKF6adqw== +-----END CERTIFICATE----- diff --git a/contrib/certificates/reseed/j_at_torontocrypto.org.crt b/contrib/certificates/reseed/j_at_torontocrypto.org.crt deleted file mode 100644 index 4a2789ec..00000000 --- a/contrib/certificates/reseed/j_at_torontocrypto.org.crt +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF7TCCA9egAwIBAgIQJpzITX40IacsYOr3X98gPzALBgkqhkiG9w0BAQswczEL -MAkGA1UEBhMCWFgxHjAcBgNVBAoTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEMMAoG -A1UECxMDSTJQMQswCQYDVQQHEwJYWDELMAkGA1UECRMCWFgxHDAaBgNVBAMME2pA -dG9yb250b2NyeXB0by5vcmcwHhcNMTUwOTIyMjIxNTMzWhcNMjUwOTIyMjIxNTMz -WjBzMQswCQYDVQQGEwJYWDEeMBwGA1UEChMVSTJQIEFub255bW91cyBOZXR3b3Jr -MQwwCgYDVQQLEwNJMlAxCzAJBgNVBAcTAlhYMQswCQYDVQQJEwJYWDEcMBoGA1UE -AwwTakB0b3JvbnRvY3J5cHRvLm9yZzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC -AgoCggIBAKbQH61RibAeLRemYah/071wPid99vpPoVxJMwFc/42kbnpSFHUiXRYP -WMkzqPmdZRkr9BNqt3Fa19IiMQbJ49yKRh9+HPJ09b88r2Z75wo71b4eq4Ohd8/4 -pSfn7zPCxtqvBh79N0e6O1jC7I01WkXaQfRN1BpIpRT/80H7muWOHoN/AFbJL2KK -eRx+G1hsHqn3pBcsq5QV+bAQdpzxYYYKHn/EPFYk9LM3p1F2uWOQDN0UU+rINvp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ZIJSD+L0lKiMw1klbaYYPp2mjwbo42DhsezcJX3TKXhMe3qkYZ3I -E0a9Kq4TmoWAkdycT1oH51wmybwWc3ix7rXbUe8h6KgBEXqJV60ybX7iacrq9WgG -xIr5hnSUEGZtMcdhEA4oD319h+8j/UjXKgWwuuNExpSnARbwQTbPJ/PLD6mQVpHv -jL2S9nbb1r/GmRdzCpHVwLGczUJvwfjAZ8bDCONSGHzuzw8lgpdRpdeWCLfQzXyo -mjh0U8QNpeHEMdQhmnaYa8WJ83DTnO7pwaoYqjeDQ9yM ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/download.xxlspeed.com.crt b/contrib/certificates/ssl/download.xxlspeed.com.crt deleted file mode 100644 index 253c0509..00000000 --- a/contrib/certificates/ssl/download.xxlspeed.com.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDLDCCArKgAwIBAgIJAMOgj4vE9qpcMAoGCCqGSM49BAMEMIHTMQswCQYDVQQG -EwJERTEeMBwGA1UECAwVZG93bmxvYWQueHhsc3BlZWQuY29tMR4wHAYDVQQHDBVk -b3dubG9hZC54eGxzcGVlZC5jb20xHjAcBgNVBAoMFWRvd25sb2FkLnh4bHNwZWVk -LmNvbTEeMBwGA1UECwwVZG93bmxvYWQueHhsc3BlZWQuY29tMR4wHAYDVQQDDBVk -b3dubG9hZC54eGxzcGVlZC5jb20xJDAiBgkqhkiG9w0BCQEWFWRvd25sb2FkLnh4 -bHNwZWVkLmNvbTAeFw0xNTEyMzAxMTI4NDJaFw0yMTA2MjExMTI4NDJaMIHTMQsw -CQYDVQQGEwJERTEeMBwGA1UECAwVZG93bmxvYWQueHhsc3BlZWQuY29tMR4wHAYD -VQQHDBVkb3dubG9hZC54eGxzcGVlZC5jb20xHjAcBgNVBAoMFWRvd25sb2FkLnh4 -bHNwZWVkLmNvbTEeMBwGA1UECwwVZG93bmxvYWQueHhsc3BlZWQuY29tMR4wHAYD -VQQDDBVkb3dubG9hZC54eGxzcGVlZC5jb20xJDAiBgkqhkiG9w0BCQEWFWRvd25s -b2FkLnh4bHNwZWVkLmNvbTB2MBAGByqGSM49AgEGBSuBBAAiA2IABFObW+pRshVD -gvMPvGdPGji2DAfdvkl3gvpyiQ0PUqxuTxwtBlwBo6cz2cMnkKdActuvE/VOTRG5 -/z7CcvG7b0+qgrHDffg7C2wWlAN0dSjuoV2Av7VoN1vEU96TCtheSqNQME4wHQYD -VR0OBBYEFPbEZH9oidjadUfvsnsh23b1jZnVMB8GA1UdIwQYMBaAFPbEZH9oidja -dUfvsnsh23b1jZnVMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwQDaAAwZQIwT1py -AV2hLFL/5ZgwmybdaCBBUsj3cGYroXb/Z2BHLDYmH8enK0DhhWyPdN1a7eCsAjEA -oQRU7lhXrisckjA2911Q5mA8y2sFAN/PDPrUeU9PI5vDF/ezTi20zULMOqbU1uRz ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/i2p.mooo.com.crt b/contrib/certificates/ssl/i2p.mooo.com.crt deleted file mode 100644 index 839767b3..00000000 --- a/contrib/certificates/ssl/i2p.mooo.com.crt +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDvTCCAqWgAwIBAgIJAOeW0ejPrHimMA0GCSqGSIb3DQEBCwUAMHUxCzAJBgNV -BAYTAlVTMQ0wCwYDVQQIDARub25lMQ0wCwYDVQQHDARub25lMQ0wCwYDVQQKDARu -b25lMQ0wCwYDVQQLDARub25lMRUwEwYDVQQDDAxpMnAubW9vby5jb20xEzARBgkq -hkiG9w0BCQEWBG5vbmUwHhcNMTUwMjA4MTczMzA5WhcNMTkwMzE5MTczMzA5WjB1 -MQswCQYDVQQGEwJVUzENMAsGA1UECAwEbm9uZTENMAsGA1UEBwwEbm9uZTENMAsG -A1UECgwEbm9uZTENMAsGA1UECwwEbm9uZTEVMBMGA1UEAwwMaTJwLm1vb28uY29t -MRMwEQYJKoZIhvcNAQkBFgRub25lMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAqxej7oRl9GOb8benIBCENrJXoow1iWhI9M+2nU0SaonrCDql5M2YMlwd -HzYUWtFbRjz2NinjB0fgFq9cfzHfr1Sc8k/OeGg1jvNfqt8wWo9tryQNjiHtDQUZ -6lQ5T13I+lj0CBasowgbApKQfrYjvaeuTaVYTfP8IVA60hoUQ+sy9JN+Unsx3/0Y -PLLd98+bT27qYuBNRB1g/ifUTd9Wosj2PevGBlCxYDaUjmCG4Q8kcQr87KvM6RTu -3AV61s/Wyy1j2YemlGG/ZhJ44YnlVMSu1vTjt9HInVf3lRRx/+RzbQO3lqeVC8LC -Bq3KbSlfJVx4vHslfHwBFw9A4rmD1QIDAQABo1AwTjAdBgNVHQ4EFgQUsSUvX0ED -yivB67iksVwZ+b8vLtQwHwYDVR0jBBgwFoAUsSUvX0EDyivB67iksVwZ+b8vLtQw -DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAde4wts7Q8TylFEc38ftJ -2f285fFIR7P1SSbBcHPK2eBwLEg0zJyFrCeiHuEpPrn+d5GqL2zOskjfcESGmDBT -aFajj8jPBJj/AmpkdWJG6a1YKro5tu9wrlenGwHOHu2/Cl0IJvafxrOs2x4G+2Nl -5Hcw/FIy8mK7eIch4pACfi0zNMZ6KMCKfX9bxPrQo78WdBfVjbrIBlgyOQJ5NJEF -JlWvS7Butv7eERi4I2huN5VRJSCFzjbuO+tjP3I8IB6WgdBmTeqq8ObtXRgahBuD -ZmkvqVSfIzK5JN4GjO8FOdCBomuwm9A92kgmAptwQwAHM9qCDJpH8L07/7poxlGb -iA== ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/i2pseed.zarrenspry.info.crt b/contrib/certificates/ssl/i2pseed.zarrenspry.info.crt deleted file mode 100644 index e855d6ed..00000000 --- a/contrib/certificates/ssl/i2pseed.zarrenspry.info.crt +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN CERTIFICATE----- -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9Vo5h+Vj6FHJAJJcb+YW6wLKBkJVGLF4UCAwEA -AaNQME4wHQYDVR0OBBYEFL538Fr1l/9YQgG+iZvJUuOzAaVaMB8GA1UdIwQYMBaA -FL538Fr1l/9YQgG+iZvJUuOzAaVaMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL -BQADggEBAKq7KEnR0V43PsA5D23Lhawy5W/BDs4RO3LkYSxi+zR4EAMC8RhafrmG -6IZVp+ykplZtFK3Kkw1osakcvmHRLoPCXPWLibXtWMEpmH4GhWJKf5Ct1kY0VkEE -ALP7vCtjDm5l6WBaNOZYv25wwg5wgjyhzfJtLxzyRRPOjUuv0M3FFwJEAauzoo+4 -nle91IHNcWPIq1kgWUwWBHpLgZ2RpSOZS9MBOCkjHwQhoebhpgwSPgUHvBJ7FoLb -AeAdwpgPdIQ9gZEZEPfCPfG/Qp60yLAhkT2CF7F1h47VYe8LGBDbd1HGpSwjulq/ -lnvV4zDIoKhbQhUpxwgHo79nxcgddOA= ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/netdb.i2p2.no.crt b/contrib/certificates/ssl/netdb.i2p2.no.crt deleted file mode 100644 index 7c792d99..00000000 --- a/contrib/certificates/ssl/netdb.i2p2.no.crt +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID1TCCAr2gAwIBAgIJAOd9wIt+w/I5MA0GCSqGSIb3DQEBCwUAMIGAMQswCQYD -VQQGEwJOTzENMAsGA1UECAwET3NsbzENMAsGA1UEBwwET3NsbzEMMAoGA1UECgwD -STJQMQwwCgYDVQQLDANJMlAxFjAUBgNVBAMMDW5ldGRiLmkycDIubm8xHzAdBgkq -hkiG9w0BCQEWEG1lZWhAaTJwbWFpbC5vcmcwHhcNMTQxMjA2MjM1OTM1WhcNMjAw -NTI4MjM1OTM1WjCBgDELMAkGA1UEBhMCTk8xDTALBgNVBAgMBE9zbG8xDTALBgNV -BAcMBE9zbG8xDDAKBgNVBAoMA0kyUDEMMAoGA1UECwwDSTJQMRYwFAYDVQQDDA1u -ZXRkYi5pMnAyLm5vMR8wHQYJKoZIhvcNAQkBFhBtZWVoQGkycG1haWwub3JnMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmtRtAALMImh0G0X+AtMpJNBa -HduNkg5t+0juitKRboXXAp5k7yN9qnimlBxlAicNb+QubcDuL+WV91NKz43dd6Xp -SAewqMFRPUAki8uYzoh+hQEfzyd3NmadUKquYZsYwomhHnraOmLZLbxD6ED3FEwl -hGBJwYnhyMZUCgB5+DEEHg8RdLz+H0bMrwz3e7/0lMtH6lM1lIHz0KBULWLp7Om0 -sk3rmmhPUIXqfoY8X3vClI74o0KcslMVaF4rt3lAHdoi3lwA6Qbdqq9nC9rPWHUS -USQQ/MKsNfDTGsHkbW2l0VgNvJkw92DwHTXSJrsEqgkdV/B1hHxCKgL44c/CbwID -AQABo1AwTjAdBgNVHQ4EFgQUCkebDZE05yKMbXORa6gO+aLdCscwHwYDVR0jBBgw -FoAUCkebDZE05yKMbXORa6gO+aLdCscwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B -AQsFAAOCAQEAfHO0g5M//X5xDIuXGCeqQMUrF3r1N45a+0kqo2b/rd9USueNGrJl -KE7MfDgShy2d4strZ1m0M4StW0RlUUZ4V4FYwzcknF6VXbOQK3BTrAeOwuxsrHoT -abrMZ36ABYur5WakOYtPyQ5oXFUAIpGBe9LH7q3XLegSOfftvc2xdJ+VK0n4MEfY -GfaRGMNW/pxGYLWvao3soOJMtp6cQ5KIYGuX92DMon/UgPBqEygeUj7aIqjhRss0 -b0dUZQyHccAG+e5NeTF2ifHCEh2rZY18VGxPL7KLrCQigu5lif1TTv5CDO5rKrHl -TuTOsnooMxUH4ThIVI9cxXk6bzRMehLghA== ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/reseed.i2p-projekt.de.crt b/contrib/certificates/ssl/reseed.i2p-projekt.de.crt deleted file mode 100644 index 75f43dd6..00000000 --- a/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AUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAupUg3ZTBSE7iRebjcZ+y -zgnRaClmgrv8Mpa1/weTuXKhJZ65k6+G5mplI5hN/crKi/3b6oyfRrYhgdTdb0rD -2CbrhBkPGGlubhkjkxWjAhibzU6Kt3a7WOjykGnslpCZhwS/hiVB7ZE2JGdphFld -aJTKt12CytyP3GyIQyyX7O2t92dk8cW4tlxRVpaPNr59lk0V50qpvNmNyhxv3yDz -taop/etfjHStq1YrltHWH0d4Dxy8ubb7nV19uvPcE0+MrR2xm7jvOBfGjAf1bQ7Z -rk7RMHio4xWFJZO7TSzL5/8EH2jX6ZqpH+hZ6sV8TmzuRWsPkm0doXWr+HBZ/gMt -5w== ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/reseed.i2p.vzaws.com.crt b/contrib/certificates/ssl/reseed.i2p.vzaws.com.crt deleted file mode 100644 index 25f9e369..00000000 --- a/contrib/certificates/ssl/reseed.i2p.vzaws.com.crt +++ /dev/null @@ -1,33 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFyDCCA7KgAwIBAgIRAJD+6g+eAsWKlwas0Ymsq24wCwYJKoZIhvcNAQELMHQx -CzAJBgNVBAYTAlhYMR4wHAYDVQQKExVJMlAgQW5vbnltb3VzIE5ldHdvcmsxDDAK -BgNVBAsTA0kyUDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR0wGwYDVQQDExRy -ZXNlZWQuaTJwLnZ6YXdzLmNvbTAeFw0xNTA1MTkyMDIwNTRaFw0xNzA1MTgyMDIw -NTRaMHQxCzAJBgNVBAYTAlhYMR4wHAYDVQQKExVJMlAgQW5vbnltb3VzIE5ldHdv -cmsxDDAKBgNVBAsTA0kyUDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR0wGwYD -VQQDExRyZXNlZWQuaTJwLnZ6YXdzLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAJCAUT9WD2kLPgh5tK5Pb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meVdduxn81WdgnlZ -ToYEEgh68i2sehDUQ+1ro/oLCISDP+hZF3OIUDmz13x7peFFpMb4lKbyoc1siOlV -7/e+XboYKDsTb6fb/mTVL4GjnRvdmXx4cOAkGM2LHbGSIZKGkIEvQWrXwRol3WUn -AcEMWY8KGaee23Syg4fG/4ejVuRZYz8fbk8es6Z6W1vw6gnra434dnYmCrEO6hQl -/77LntLODSgAkus6polZ5O1c7Aj0USMNDW/EFP98APVokT1RGK1wStZVxSUDqBDF -RRPSpEsOGJ6qA7GJuAWi9I3Msy2lBlKMK6Xgk3l/e7ZPU0he95JfxySldl0JzR2N -EGvUCRPDXAMVnp3eP/41MrODdyGo2wBf/0IutfkpJf+Xmbu4ZbgkdPDEwG1+4VZH -MMsGAo3fOR4sI0Wu9W92rXEbzkxwekfnG6D7QQI64AAr0p4w2yO1ALbqW2A= ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/uk.reseed.i2p2.no.crt b/contrib/certificates/ssl/uk.reseed.i2p2.no.crt deleted file mode 100644 index 84f3f073..00000000 --- a/contrib/certificates/ssl/uk.reseed.i2p2.no.crt +++ /dev/null @@ -1,33 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFsTCCA5mgAwIBAgIJANgzPow6thRuMA0GCSqGSIb3DQEBBQUAMG8xCzAJBgNV -BAYTAk5PMQ0wCwYDVQQIDARPc2xvMQswCQYDVQQHDAJVSzETMBEGA1UECgwKSTJQ -IFJlc2VlZDETMBEGA1UECwwKSTJQIFJlc2VlZDEaMBgGA1UEAwwRdWsucmVzZWVk -LmkycDIubm8wHhcNMTQwNjI4MjA0OTA3WhcNMjQwNjI1MjA0OTA3WjBvMQswCQYD -VQQGEwJOTzENMAsGA1UECAwET3NsbzELMAkGA1UEBwwCVUsxEzARBgNVBAoMCkky -UCBSZXNlZWQxEzARBgNVBAsMCkkyUCBSZXNlZWQxGjAYBgNVBAMMEXVrLnJlc2Vl -ZC5pMnAyLm5vMIICIjANBgkqhkiG9w0BAQEFAA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DKqopa3bbO7MWJ3mKkS4rua42j8GG3Q3q -UWPGh4zm+2+Ncjmz0Ho73RyYDDcp9IjwlAEv+NW86rz/5Pdkhoy+SzQwFYAwNgaQ -FRKb6ltpslxmu3tUdZ7Ydrj6MBGQyH2gRVm9qByro7WGI4UsyzsjP009Iu6dbhdC -2ddTGMisXF3dOmdRWh8dlggmW6gV4iaVgZkzLtrc9S0SK66utKMVXa4EUTm6XogX -F5ImPnVzIMo2qF2pP31aGDzKqJF3GNjGj+xHRVau5whz0a4ESY6V14PLTEL4Vc/H -J9uLCySifvqN+jzs5iY2QvNXjg2zPaTJbnjxxpYQJVSQHX6SyRcszhChqQzxnbyo -+S19BRclqzufRq6pp6VcOiID0BB7qPcrUHM9h1ingMXcZZlGBgHew9cY7tb5TAox -o+aTNc4k/7E543FVbs40dpOD2Fcr ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/us.reseed.i2p2.no.crt b/contrib/certificates/ssl/us.reseed.i2p2.no.crt deleted file mode 100644 index eae724e9..00000000 --- a/contrib/certificates/ssl/us.reseed.i2p2.no.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDUDCCAjgCCQCkTcCJMdZV7zANBgkqhkiG9w0BAQUFADBqMQswCQYDVQQGEwJO -TzENMAsGA1UECAwET3NsbzENMAsGA1UEBwwET3NsbzENMAsGA1UECgwET3NsbzES -MBAGA1UECwwJTm9yZGNsb3VkMRowGAYDVQQDDBF1cy5yZXNlZWQuaTJwMi5ubzAe -Fw0xNDA2MjcyMjQxMjFaFw0yNDA2MjQyMjQxMjFaMGoxCzAJBgNVBAYTAk5PMQ0w -CwYDVQQIDARPc2xvMQ0wCwYDVQQHDARPc2xvMQ0wCwYDVQQKDARPc2xvMRIwEAYD -VQQLDAlOb3JkY2xvdWQxGjAYBgNVBAMMEXVzLnJlc2VlZC5pMnAyLm5vMIIBIjAN -BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAomVoBEc53jzy3xGMfgRaKyX6MaGG -KAmwu0uMTX6bVzGjy56JMMq3luoxOrpvgrNZF52lu7i36Tejo0HM75AHoea1es55 -DNLmrlDeqzlBU2WibOnizbB8G+tlMEbx8eAGAWk/Wv/vH8CAKmxjImslmbajzZC2 -LEH7inp3J5T2sVV7zmXeL9OEPKNyohbu6Mrno2IAlEOr8cu+lWAaFWzpknnR1gBX -NkB/8+7vK5Fq4MT7B0qnXPxmaWDbUOepPPni8u+2L9+qt19vZH4/6KNuH7xd7JLz -FfIdol6jy2cBQyAK7cVKWDHNk7ceB4Dl0mjBDbBIRTtLK+rfdnVmfWn8aQIDAQAB -MA0GCSqGSIb3DQEBBQUAA4IBAQCQH4QJMp5xneh2ah7fiuVdtKbiv6QNunRz7nb/ -mWYyqmBX7EHL8jOG5qmPELDgDt58HmnaYMo05nEJb9JhAoviEDXSYw0s6eN4n4nc -MKqgR/HLLSiXPwT+Wi1MI57OYim5AFTUCYTSaWFUT+dZKYb0QPE1XjGpQXi3ppsJ -3TJG71tOzJmZT6vRPmdTHJO70v6ZEhr5w4SiGx07gNmcgO8WRyb5ajOwSHiGKrj6 -UsuRNhtCyZaAEmelR9mfKBR1J2Nb+9jTz6mJtpT82WY3bst6mFk+A+mMWBQy7Hjt -gpdSDBCcFx9if+AKINGLgFvFKV2q8UzbfXms19NsVt9Hu7W3 ------END CERTIFICATE----- diff --git a/contrib/certificates/ssl/user.mx24.eu.crt b/contrib/certificates/ssl/user.mx24.eu.crt deleted file mode 100644 index 38c68ab5..00000000 --- a/contrib/certificates/ssl/user.mx24.eu.crt +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICwDCCAkagAwIBAgIJAKXCoCBjd/C0MAoGCCqGSM49BAMEMIGdMQswCQYDVQQG -EwJERTEVMBMGA1UECAwMdXNlci5teDI0LmV1MRUwEwYDVQQHDAx1c2VyLm14MjQu -ZXUxFTATBgNVBAoMDHVzZXIubXgyNC5ldTEVMBMGA1UECwwMdXNlci5teDI0LmV1 -MRUwEwYDVQQDDAx1c2VyLm14MjQuZXUxGzAZBgkqhkiG9w0BCQEWDHVzZXIubXgy -NC5ldTAeFw0xNTA5MDMxNjMyNDVaFw0yMTAyMjMxNjMyNDVaMIGdMQswCQYDVQQG -EwJERTEVMBMGA1UECAwMdXNlci5teDI0LmV1MRUwEwYDVQQHDAx1c2VyLm14MjQu -ZXUxFTATBgNVBAoMDHVzZXIubXgyNC5ldTEVMBMGA1UECwwMdXNlci5teDI0LmV1 -MRUwEwYDVQQDDAx1c2VyLm14MjQuZXUxGzAZBgkqhkiG9w0BCQEWDHVzZXIubXgy -NC5ldTB2MBAGByqGSM49AgEGBSuBBAAiA2IABPlKs5fYTqVhIOMiR6U9U4TimxS3 -P5NBDVzeeIAgbw5KBC8UImScZVt9g4V1wQe5kPs7TxA2BfanAPZ+ekQiRRvMVQxD -bSlRYupEWhq5BrJI6Lq/HDc7VJe9UUWffWKUoKNQME4wHQYDVR0OBBYEFBGJ0Yr+ -PZXnrk5RafQEALUpAU6ZMB8GA1UdIwQYMBaAFBGJ0Yr+PZXnrk5RafQEALUpAU6Z -MAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwQDaAAwZQIxAPcovePHMCosrAQNzS5i -VDUiyPNLOxHyRBm79yKXGl13LxysB6OK+2M7t8j8E/udBwIwXVVjxN6aSgXYTJ7d -p+Hg/2CuBMwf41/ENRcYQA+oGS9bU6A+7U9KJ1xTWWoqsUEs ------END CERTIFICATE----- diff --git a/qt/i2pd_qt/README.md b/qt/i2pd_qt/README.md new file mode 100644 index 00000000..94186ecf --- /dev/null +++ b/qt/i2pd_qt/README.md @@ -0,0 +1,3 @@ +# Build Requirements + + * Qt 5 is necessary (because Qt4 lacks QtWidgets/ folder) diff --git a/util.cpp b/util.cpp index ca2b61c2..5cc1fdb5 100644 --- a/util.cpp +++ b/util.cpp @@ -275,14 +275,15 @@ namespace net if (cur_ifname == ifname && cur->ifa_addr && cur->ifa_addr->sa_family == af) { // match - char * addr = new char[INET6_ADDRSTRLEN]; - bzero(addr, INET6_ADDRSTRLEN); - if(af == AF_INET) - inet_ntop(af, &((sockaddr_in *)cur->ifa_addr)->sin_addr, addr, INET6_ADDRSTRLEN); - else - inet_ntop(af, &((sockaddr_in6 *)cur->ifa_addr)->sin6_addr, addr, INET6_ADDRSTRLEN); - freeifaddrs(addrs); - std::string cur_ifaddr(addr); + char * addr = new char[INET6_ADDRSTRLEN]; + bzero(addr, INET6_ADDRSTRLEN); + if(af == AF_INET) + inet_ntop(af, &((sockaddr_in *)cur->ifa_addr)->sin_addr, addr, INET6_ADDRSTRLEN); + else + inet_ntop(af, &((sockaddr_in6 *)cur->ifa_addr)->sin6_addr, addr, INET6_ADDRSTRLEN); + freeifaddrs(addrs); + std::string cur_ifaddr(addr); + delete[] addr; return boost::asio::ip::address::from_string(cur_ifaddr); } cur = cur->ifa_next;