summaryrefslogtreecommitdiff
path: root/src/trunnel
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2018-05-22 12:23:32 +0200
committerNick Mathewson <nickm@torproject.org>2018-07-12 11:41:05 -0400
commit94706a427a6ea84e8124bd3bd997d6805149c39d (patch)
treec39a680b7eae74d56443e8c538453e57b095c261 /src/trunnel
parentbcbd3fb71e1a729f5b499a1452da7d07deeebf39 (diff)
downloadtor-94706a427a6ea84e8124bd3bd997d6805149c39d.tar.gz
tor-94706a427a6ea84e8124bd3bd997d6805149c39d.zip
Add CMD_RESOLVE to socks5_client_request
Diffstat (limited to 'src/trunnel')
-rw-r--r--src/trunnel/socks5.c12
-rw-r--r--src/trunnel/socks5.trunnel2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/trunnel/socks5.c b/src/trunnel/socks5.c
index 5b8d49d802..7f4702fb5d 100644
--- a/src/trunnel/socks5.c
+++ b/src/trunnel/socks5.c
@@ -3477,7 +3477,7 @@ socks5_client_request_get_command(const socks5_client_request_t *inp)
int
socks5_client_request_set_command(socks5_client_request_t *inp, uint8_t val)
{
- if (! ((val == CMD_BIND || val == CMD_CONNECT || val == CMD_RESOLVE_PTR || val == CMD_UDP_ASSOCIATE))) {
+ if (! ((val == CMD_BIND || val == CMD_CONNECT || val == CMD_RESOLVE || val == CMD_RESOLVE_PTR || val == CMD_UDP_ASSOCIATE))) {
TRUNNEL_SET_ERROR_CODE(inp);
return -1;
}
@@ -3600,7 +3600,7 @@ socks5_client_request_check(const socks5_client_request_t *obj)
return "A set function failed on this object";
if (! (obj->version == 5))
return "Integer out of bounds";
- if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
+ if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
return "Integer out of bounds";
if (! (obj->reserved == 0))
return "Integer out of bounds";
@@ -3639,7 +3639,7 @@ socks5_client_request_encoded_len(const socks5_client_request_t *obj)
/* Length of u8 version IN [5] */
result += 1;
- /* Length of u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
+ /* Length of u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
result += 1;
/* Length of u8 reserved IN [0] */
@@ -3708,7 +3708,7 @@ socks5_client_request_encode(uint8_t *output, const size_t avail, const socks5_c
trunnel_set_uint8(ptr, (obj->version));
written += 1; ptr += 1;
- /* Encode u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
+ /* Encode u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
trunnel_assert(written <= avail);
if (avail - written < 1)
goto truncated;
@@ -3817,11 +3817,11 @@ socks5_client_request_parse_into(socks5_client_request_t *obj, const uint8_t *in
if (! (obj->version == 5))
goto fail;
- /* Parse u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
+ /* Parse u8 command IN [CMD_BIND, CMD_CONNECT, CMD_RESOLVE, CMD_RESOLVE_PTR, CMD_UDP_ASSOCIATE] */
CHECK_REMAINING(1, truncated);
obj->command = (trunnel_get_uint8(ptr));
remaining -= 1; ptr += 1;
- if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
+ if (! (obj->command == CMD_BIND || obj->command == CMD_CONNECT || obj->command == CMD_RESOLVE || obj->command == CMD_RESOLVE_PTR || obj->command == CMD_UDP_ASSOCIATE))
goto fail;
/* Parse u8 reserved IN [0] */
diff --git a/src/trunnel/socks5.trunnel b/src/trunnel/socks5.trunnel
index b6b8a34f2b..d70ad639e2 100644
--- a/src/trunnel/socks5.trunnel
+++ b/src/trunnel/socks5.trunnel
@@ -30,7 +30,7 @@ struct domainname {
struct socks5_client_request {
u8 version IN [5];
- u8 command IN [CMD_CONNECT, CMD_BIND, CMD_UDP_ASSOCIATE, CMD_RESOLVE_PTR];
+ u8 command IN [CMD_CONNECT, CMD_BIND, CMD_UDP_ASSOCIATE, CMD_RESOLVE, CMD_RESOLVE_PTR];
u8 reserved IN [0];
u8 atype;
union dest_addr[atype] {