Skip to content

Commit

Permalink
Make HTTPProxy use SIGNING_KEY_TYPE_DSA_SHA1
Browse files Browse the repository at this point in the history
  • Loading branch information
klondi committed Jan 7, 2015
1 parent 29039fd commit bcbe207
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion HTTPProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace proxy
void HandleAccept(const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket);

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_Timer (GetService ()) {};
~HTTPProxyServer() { Stop(); }
Expand Down
9 changes: 7 additions & 2 deletions I2PService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
i2p::data::IdentHash identHash;
if (i2p::client::context.GetAddressBook ().GetIdentHash (dest, identHash))
localDestination->CreateStream (streamRequestComplete, identHash, port);
m_LocalDestination->CreateStream (streamRequestComplete, identHash, port);
else
{
LogPrint (eLogWarning, "Remote destination ", dest, " not found");
Expand Down
3 changes: 2 additions & 1 deletion I2PService.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace client
{
public:
I2PService (ClientDestination * localDestination = nullptr);
I2PService (i2p::data::SigningKeyType kt);
virtual ~I2PService () { ClearHandlers (); }

inline void AddHandler (std::shared_ptr<I2PServiceHandler> conn) {
Expand Down Expand Up @@ -53,7 +54,7 @@ namespace client
class I2PServiceHandler
{
public:
I2PServiceHandler(I2PService * parent) : m_Dead(false), m_Service(parent) { }
I2PServiceHandler(I2PService * parent) : m_Service(parent), m_Dead(false) { }
virtual ~I2PServiceHandler() { }
protected:
// Call when terminating or handing over to avoid race conditions
Expand Down
2 changes: 1 addition & 1 deletion SOCKS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ namespace proxy
boost::asio::const_buffers_1 SOCKSHandler::GenerateSOCKS5Response(SOCKSHandler::errTypes error, SOCKSHandler::addrTypes type,
const SOCKSHandler::address &addr, uint16_t port)
{
size_t size;
size_t size = 6;
assert(error <= SOCKS5_ADDR_UNSUP);
m_response[0] = '\x05'; //Version
m_response[1] = error; //Response code
Expand Down

0 comments on commit bcbe207

Please sign in to comment.