summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-05-06 17:18:46 -0400
committerNick Mathewson <nickm@torproject.org>2020-05-06 17:18:46 -0400
commita58dda96b64761c1df54c1a0cb5d21e12a6a0e49 (patch)
treec1d0cf6a405ff6e813c95f0935c4203749fe3a02
parent275b9f1e416da918768e705b8e08ece9f02db8c7 (diff)
parentb444096be5ac509be1b2b68dc8e18ca1f558fef5 (diff)
downloadtor-a58dda96b64761c1df54c1a0cb5d21e12a6a0e49.tar.gz
tor-a58dda96b64761c1df54c1a0cb5d21e12a6a0e49.zip
Merge branch 'maint-0.4.3' into release-0.4.3
-rw-r--r--changes/bug341314
-rw-r--r--src/core/or/connection_edge.c6
-rw-r--r--src/core/or/connection_or.c1
-rw-r--r--src/feature/control/btrack_orconn_cevent.c1
4 files changed, 10 insertions, 2 deletions
diff --git a/changes/bug34131 b/changes/bug34131
new file mode 100644
index 0000000000..eb3a3feba2
--- /dev/null
+++ b/changes/bug34131
@@ -0,0 +1,4 @@
+ o Minor bugfixes (logging):
+ - Fix a logic error in a log message about whether an address was
+ invalid. Previously, the code would never report that onion addresses
+ were onion addresses. Fixes bug 34131; bugfix on 0.4.3.1-alpha.
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c
index 7f707a5660..37e83ba71e 100644
--- a/src/core/or/connection_edge.c
+++ b/src/core/or/connection_edge.c
@@ -1643,9 +1643,11 @@ parse_extended_hostname(char *address, hostname_type_t *type_out)
failed:
/* otherwise, return to previous state and return 0 */
*s = '.';
+ const bool is_onion = (*type_out == ONION_V2_HOSTNAME) ||
+ (*type_out == ONION_V3_HOSTNAME);
log_warn(LD_APP, "Invalid %shostname %s; rejecting",
- (*type_out == (ONION_V2_HOSTNAME || ONION_V3_HOSTNAME) ? "onion " : ""),
- safe_str_client(address));
+ is_onion ? "onion " : "",
+ safe_str_client(address));
return false;
}
diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c
index 76bfbf0b30..5571d90f8f 100644
--- a/src/core/or/connection_or.c
+++ b/src/core/or/connection_or.c
@@ -731,6 +731,7 @@ connection_or_finished_flushing(or_connection_t *conn)
}
break;
}
+ break;
case OR_CONN_STATE_OPEN:
case OR_CONN_STATE_OR_HANDSHAKING_V2:
case OR_CONN_STATE_OR_HANDSHAKING_V3:
diff --git a/src/feature/control/btrack_orconn_cevent.c b/src/feature/control/btrack_orconn_cevent.c
index c5de473d0f..d11be59280 100644
--- a/src/feature/control/btrack_orconn_cevent.c
+++ b/src/feature/control/btrack_orconn_cevent.c
@@ -147,6 +147,7 @@ bto_cevent_apconn(const bt_orconn_t *bto)
break;
case OR_CONN_STATE_OPEN:
control_event_bootstrap(BOOTSTRAP_STATUS_AP_HANDSHAKE_DONE, 0);
+ break;
default:
break;
}