]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket.h
Test code that pretends to send a hashed value if its got a challenge - don't use...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket.h
index 54b506c5758e75418fd8b0d754e87f279a662315..82a066be6ebd4df8c8e7c013789ef171effc10ba 100644 (file)
@@ -1,3 +1,16 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
 #ifndef __TREESOCKET_H__
 #define __TREESOCKET_H__
 
@@ -79,6 +92,8 @@ 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 */
 
  public:
 
@@ -106,6 +121,22 @@ 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);
+
        /** Return the module which we are hooking to for I/O encapsulation
         */
        Module* GetHook();
@@ -114,6 +145,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);
+
        /** 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