]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket.h
Wait longer before sending data on the connect than on the accept
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket.h
index 4c8f1495709aca8fc064f262dd1f90b090499dc5..ff06f0926691a92e1f539ecb79128565d24a2885 100644 (file)
@@ -92,6 +92,9 @@ class TreeSocket : public InspSocket
        std::string ModuleList;                 /* Module list of other server from CAPAB */
        std::map<std::string,std::string> 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