Browse Source

Make HTTPProxy use SIGNING_KEY_TYPE_DSA_SHA1

pull/143/head
Francisco Blas (klondike) Izquierdo Riera 10 years ago
parent
commit
bcbe207515
  1. 2
      HTTPProxy.h
  2. 9
      I2PService.cpp
  3. 3
      I2PService.h
  4. 2
      SOCKS.cpp

2
HTTPProxy.h

@ -26,7 +26,7 @@ namespace proxy
void HandleAccept(const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket); void HandleAccept(const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket);
public: public:
HTTPProxyServer(int port) : I2PService(nullptr), HTTPProxyServer(int port) : I2PService(i2p::data::SIGNING_KEY_TYPE_DSA_SHA1),
m_Acceptor (GetService (), boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), port)), m_Acceptor (GetService (), boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), port)),
m_Timer (GetService ()) {}; m_Timer (GetService ()) {};
~HTTPProxyServer() { Stop(); } ~HTTPProxyServer() { Stop(); }

9
I2PService.cpp

@ -16,11 +16,16 @@ namespace client
{ {
} }
void ClientDestination::CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, int port) { I2PService::I2PService (i2p::data::SigningKeyType kt):
m_LocalDestination (i2p::client::context.CreateNewLocalDestination (false, kt))
{
}
void I2PService::CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, int port) {
assert(streamRequestComplete); assert(streamRequestComplete);
i2p::data::IdentHash identHash; i2p::data::IdentHash identHash;
if (i2p::client::context.GetAddressBook ().GetIdentHash (dest, identHash)) if (i2p::client::context.GetAddressBook ().GetIdentHash (dest, identHash))
localDestination->CreateStream (streamRequestComplete, identHash, port); m_LocalDestination->CreateStream (streamRequestComplete, identHash, port);
else else
{ {
LogPrint (eLogWarning, "Remote destination ", dest, " not found"); LogPrint (eLogWarning, "Remote destination ", dest, " not found");

3
I2PService.h

@ -18,6 +18,7 @@ namespace client
{ {
public: public:
I2PService (ClientDestination * localDestination = nullptr); I2PService (ClientDestination * localDestination = nullptr);
I2PService (i2p::data::SigningKeyType kt);
virtual ~I2PService () { ClearHandlers (); } virtual ~I2PService () { ClearHandlers (); }
inline void AddHandler (std::shared_ptr<I2PServiceHandler> conn) { inline void AddHandler (std::shared_ptr<I2PServiceHandler> conn) {
@ -53,7 +54,7 @@ namespace client
class I2PServiceHandler class I2PServiceHandler
{ {
public: public:
I2PServiceHandler(I2PService * parent) : m_Dead(false), m_Service(parent) { } I2PServiceHandler(I2PService * parent) : m_Service(parent), m_Dead(false) { }
virtual ~I2PServiceHandler() { } virtual ~I2PServiceHandler() { }
protected: protected:
// Call when terminating or handing over to avoid race conditions // Call when terminating or handing over to avoid race conditions

2
SOCKS.cpp

@ -172,7 +172,7 @@ namespace proxy
boost::asio::const_buffers_1 SOCKSHandler::GenerateSOCKS5Response(SOCKSHandler::errTypes error, SOCKSHandler::addrTypes type, boost::asio::const_buffers_1 SOCKSHandler::GenerateSOCKS5Response(SOCKSHandler::errTypes error, SOCKSHandler::addrTypes type,
const SOCKSHandler::address &addr, uint16_t port) const SOCKSHandler::address &addr, uint16_t port)
{ {
size_t size; size_t size = 6;
assert(error <= SOCKS5_ADDR_UNSUP); assert(error <= SOCKS5_ADDR_UNSUP);
m_response[0] = '\x05'; //Version m_response[0] = '\x05'; //Version
m_response[1] = error; //Response code m_response[1] = error; //Response code

Loading…
Cancel
Save