diff options
author | Logan Dethrow <log@lindenlab.com> | 2011-07-29 15:38:20 -0400 |
---|---|---|
committer | Logan Dethrow <log@lindenlab.com> | 2011-07-29 15:38:20 -0400 |
commit | d2c72cb7e92896cb414e357ef262d91b0498a6b7 (patch) | |
tree | 6fec31cc40456a9ffe7fcbf626555418199d425e /indra/llmessage/llproxy.h | |
parent | f15d28a636da7b6d2784d9301e7a030b5bd38a8c (diff) |
STORM-1112 Input sanitization of proxy options.
Diffstat (limited to 'indra/llmessage/llproxy.h')
-rw-r--r-- | indra/llmessage/llproxy.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/llmessage/llproxy.h b/indra/llmessage/llproxy.h index df1ec9121e..ce5bdec5ad 100644 --- a/indra/llmessage/llproxy.h +++ b/indra/llmessage/llproxy.h @@ -44,11 +44,19 @@ #define SOCKS_AUTH_FAIL (-4) #define SOCKS_UDP_FWD_NOT_GRANTED (-5) #define SOCKS_HOST_CONNECT_FAILED (-6) +#define SOCKS_INVALID_HOST (-7) + #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN (255 + 1) /* socks5: 255, +1 for len. */ #endif +#define SOCKSMAXUSERNAMELEN 255 +#define SOCKSMAXPASSWORDLEN 255 + +#define SOCKSMINUSERNAMELEN 1 +#define SOCKSMINPASSWORDLEN 1 + #define SOCKS_VERSION 0x05 // we are using SOCKS 5 #define SOCKS_HEADER_SIZE 10 @@ -165,16 +173,16 @@ public: ~LLProxy(); // Start a connection to the SOCKS 5 proxy - S32 startProxy(std::string host, U32 port); + S32 startSOCKSProxy(LLHost host); // Disconnect and clean up any connection to the SOCKS 5 proxy - void stopProxy(); + void stopSOCKSProxy(); // Delete LLProxy singleton, destroying the APR pool used by the control channel. static void cleanupClass(); // Set up to use Password auth when connecting to the SOCKS proxy - void setAuthPassword(const std::string &username, const std::string &password); + bool setAuthPassword(const std::string &username, const std::string &password); // Set up to use No Auth when connecting to the SOCKS proxy void setAuthNone(); @@ -190,8 +198,8 @@ public: // Proxy HTTP packets via httpHost, which can be a SOCKS 5 or a HTTP proxy // as specified in type - void enableHTTPProxy(LLHost httpHost, LLHttpProxyType type); - void enableHTTPProxy(); + bool enableHTTPProxy(LLHost httpHost, LLHttpProxyType type); + bool enableHTTPProxy(); // Stop proxying HTTP packets void disableHTTPProxy(); |