mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
Make HTTPProxy use SIGNING_KEY_TYPE_DSA_SHA1
This commit is contained in:
parent
29039fd039
commit
bcbe207515
4 changed files with 11 additions and 5 deletions
|
@ -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(); }
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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…
Add table
Reference in a new issue