summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-01 10:22:21 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-01 10:22:21 -0400
commitc00527b3aee015eed559da89c6e4a1c096e50c56 (patch)
tree036d5248ca4fab7af7e1b0e3ca2daad3400b0119
parent3223e303f4d87ad6fa9ece31b55a9bd87afa779d (diff)
parentcf8c3abff179b4550404bb9978a9d2b5ad18fc34 (diff)
downloadtor-c00527b3aee015eed559da89c6e4a1c096e50c56.tar.gz
tor-c00527b3aee015eed559da89c6e4a1c096e50c56.zip
Merge branch 'maint-0.3.4' into release-0.3.4
-rw-r--r--changes/bug265235
-rw-r--r--src/or/control.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/changes/bug26523 b/changes/bug26523
new file mode 100644
index 0000000000..a739d240e9
--- /dev/null
+++ b/changes/bug26523
@@ -0,0 +1,5 @@
+ o Minor bugfixes (hidden service, control port):
+ - The HSPOST command wasn't parsing properly the HSADDRESS= parameter and
+ thus not using it. It now handles it correctly. Fixes bug 26523; bugfix on
+ 0.3.3.1-alpha. Patch by "akwizgran".
+
diff --git a/src/or/control.c b/src/or/control.c
index bb68925f8c..09cf833e37 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4449,8 +4449,10 @@ handle_control_hspost(control_connection_t *conn,
smartlist_t *args = smartlist_new();
- /* If any SERVER= options were specified, try parse the options line */
- if (!strcasecmpstart(argline, opt_server)) {
+ /* If any SERVER= or HSADDRESS= options were specified, try to parse
+ * the options line. */
+ if (!strcasecmpstart(argline, opt_server) ||
+ !strcasecmpstart(argline, opt_hsaddress)) {
/* encoded_desc begins after a newline character */
cp = cp + 1;
encoded_desc = cp;
@@ -4473,11 +4475,12 @@ handle_control_hspost(control_connection_t *conn,
hs_dirs = smartlist_new();
smartlist_add(hs_dirs, node->rs);
} else if (!strcasecmpstart(arg, opt_hsaddress)) {
- if (!hs_address_is_valid(arg)) {
+ const char *address = arg + strlen(opt_hsaddress);
+ if (!hs_address_is_valid(address)) {
connection_printf_to_buf(conn, "512 Malformed onion address\r\n");
goto done;
}
- onion_address = arg;
+ onion_address = address;
} else {
connection_printf_to_buf(conn, "512 Unexpected argument \"%s\"\r\n",
arg);
@@ -4492,6 +4495,8 @@ handle_control_hspost(control_connection_t *conn,
read_escaped_data(encoded_desc, encoded_desc_len, &desc_str);
if (hs_control_hspost_command(desc_str, onion_address, hs_dirs) < 0) {
connection_printf_to_buf(conn, "554 Invalid descriptor\r\n");
+ } else {
+ send_control_done(conn);
}
tor_free(desc_str);
goto done;