X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Ftreesocket.h;h=ff06f0926691a92e1f539ecb79128565d24a2885;hb=715074dd10079a3ed846e8815290ba0d13cd4bd8;hp=4c8f1495709aca8fc064f262dd1f90b090499dc5;hpb=a772b4dbf594bc0a851f5d3d6594111639453a4e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 4c8f14957..ff06f0926 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -92,6 +92,9 @@ class TreeSocket : public InspSocket std::string ModuleList; /* Module list of other server from CAPAB */ std::map CapKeys; /* CAPAB keys from other server */ Module* Hook; /* I/O hooking module that we're attached to for this socket */ + std::string ourchallenge; /* Challenge sent for challenge/response */ + std::string theirchallenge; /* Challenge recv for challenge/response */ + std::string OutboundPass; /* Outbound password */ public: @@ -119,6 +122,26 @@ class TreeSocket : public InspSocket */ ServerState GetLinkState(); + /** Get challenge set in our CAPAB for challenge/response + */ + const std::string& GetOurChallenge(); + + /** Get challenge set in our CAPAB for challenge/response + */ + void SetOurChallenge(const std::string &c); + + /** Get challenge set in their CAPAB for challenge/response + */ + const std::string& GetTheirChallenge(); + + /** Get challenge set in their CAPAB for challenge/response + */ + void SetTheirChallenge(const std::string &c); + + /** Compare two passwords based on authentication scheme + */ + bool ComparePass(const std::string &ours, const std::string &theirs); + /** Return the module which we are hooking to for I/O encapsulation */ Module* GetHook(); @@ -127,6 +150,15 @@ class TreeSocket : public InspSocket */ ~TreeSocket(); + /** Generate random string used for challenge-response auth + */ + std::string RandString(unsigned int length); + + /** Construct a password, optionally hashed with the other side's + * challenge string + */ + std::string MakePass(const std::string &password, const std::string &challenge); + /** When an outbound connection finishes connecting, we receive * this event, and must send our SERVER string to the other * side. If the other side is happy, as outlined in the server