aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-12-17 14:39:24 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2013-02-09 16:30:16 +0000
commitfaf4f6c6d1da54b0a6b0c9946112f2e448867a8f (patch)
tree2133ca646b70e692ab704cf500e57d54af9b0d0a /src/or/connection.h
parent757b03aacbf7051194bbe9faa2bfcc59e4cc3392 (diff)
downloadtor-faf4f6c6d1da54b0a6b0c9946112f2e448867a8f.tar.gz
tor-faf4f6c6d1da54b0a6b0c9946112f2e448867a8f.zip
Validate SOCKS arguments.
Diffstat (limited to 'src/or/connection.h')
-rw-r--r--src/or/connection.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/connection.h b/src/or/connection.h
index c78fe6e652..3e656ec06e 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -89,6 +89,14 @@ int connection_connect(connection_t *conn, const char *address,
const tor_addr_t *addr,
uint16_t port, int *socket_error);
+/** Maximum size of information that we can fit into SOCKS5 username
+ or password fields. */
+#define MAX_SOCKS5_AUTH_FIELD_SIZE 255
+
+/** Total maximum size of information that we can fit into SOCKS5
+ username and password fields. */
+#define MAX_SOCKS5_AUTH_SIZE_TOTAL 2*MAX_SOCKS5_AUTH_FIELD_SIZE
+
int connection_proxy_connect(connection_t *conn, int type);
int connection_read_proxy_handshake(connection_t *conn);
void log_failed_proxy_connection(connection_t *conn);