[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Add CMD_RESOLVE to socks5_client_request
commit 94706a427a6ea84e8124bd3bd997d6805149c39d
Author: rl1987 <rl1987@xxxxxxxxxxxxxxxx>
Date: Tue May 22 12:23:32 2018 +0200
Add CMD_RESOLVE to socks5_client_request
---
src/trunnel/socks5.c | 12 ++++++------
src/trunnel/socks5.trunnel | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/trunnel/socks5.c b/src/trunnel/socks5.c
index 5b8d49d80..7f4702fb5 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 b6b8a34f2..d70ad639e 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] {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits