diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-06-01 13:21:03 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-08-19 16:42:26 +0300 |
commit | bce18a764252c66e605680e29a27ea30375a6db1 (patch) | |
tree | 579234b52e9c012d89ba1ed3d90051038a738c93 /src/or/control.c | |
parent | 3e593f09addb210f1da39bd46f5fb904cac4e410 (diff) | |
download | tor-bce18a764252c66e605680e29a27ea30375a6db1.tar.gz tor-bce18a764252c66e605680e29a27ea30375a6db1.zip |
prop224: Refactor parse_extended_hostname() to parse v3 addrs.
We need this func so that we recognize SOCKS conns to v3 addresses.
- Also rename rend_valid_service_id() to rend_valid_v2_service_id()
- Also move parse_extended_hostname() tests to their own unittest, and
add a v3 address to the test as well.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c index 724d4b35c0..e8cbd046db 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -4132,7 +4132,7 @@ handle_control_hsfetch(control_connection_t *conn, uint32_t len, /* Extract the first argument (either HSAddress or DescID). */ arg1 = smartlist_get(args, 0); /* Test if it's an HS address without the .onion part. */ - if (rend_valid_service_id(arg1)) { + if (rend_valid_v2_service_id(arg1)) { hsaddress = arg1; } else if (strcmpstart(arg1, v2_str) == 0 && rend_valid_descriptor_id(arg1 + v2_str_len) && @@ -4771,7 +4771,7 @@ handle_control_del_onion(control_connection_t *conn, return 0; const char *service_id = smartlist_get(args, 0); - if (!rend_valid_service_id(service_id)) { + if (!rend_valid_v2_service_id(service_id)) { connection_printf_to_buf(conn, "512 Malformed Onion Service id\r\n"); goto out; } |