From 37a76d75dd38a1ebd45627bb6e29e40f60917188 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 27 Aug 2014 06:10:35 -0400 Subject: [PATCH 1/3] Resume expanding abbreviations for command-line options The fix for bug 4647 accidentally removed our hack from bug 586 that rewrote HashedControlPassword to __HashedControlSessionPassword when it appears on the commandline (which allowed the user to set her own HashedControlPassword in the torrc file while the controller generates a fresh session password for each run). Fixes bug 12948; bugfix on 0.2.5.1-alpha. --- changes/bug12948 | 8 ++++++++ src/or/config.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changes/bug12948 diff --git a/changes/bug12948 b/changes/bug12948 new file mode 100644 index 000000000..431c0a101 --- /dev/null +++ b/changes/bug12948 @@ -0,0 +1,8 @@ + o Major bugfixes: + - Resume expanding abbreviations for command-line options. The fix + for bug 4647 accidentally removed our hack from bug 586 that rewrote + HashedControlPassword to __HashedControlSessionPassword when it + appears on the commandline (which allowed the user to set her + own HashedControlPassword in the torrc file while the controller + generates a fresh session password for each run). Fixes bug 12948; + bugfix on 0.2.5.1-alpha. diff --git a/src/or/config.c b/src/or/config.c index 6bb620937..921503b4b 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1932,7 +1932,8 @@ config_parse_commandline(int argc, char **argv, int ignore_errors, } param = tor_malloc_zero(sizeof(config_line_t)); - param->key = is_cmdline ? tor_strdup(argv[i]) : tor_strdup(s); + param->key = is_cmdline ? tor_strdup(argv[i]) : + tor_strdup(config_expand_abbrev(&options_format, s, 1, 1)); param->value = arg; param->command = command; param->next = NULL; From 4a6f5bb2dda188ed1d1a80455bf9c9b0b3f00066 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 29 Aug 2014 16:05:58 -0400 Subject: [PATCH 2/3] Improve "Tried to establish rendezvous on non-OR or non-edge circuit" Instead of putting it all in one warning message, log what exactly was wrong with the circuit. Resolves ticket 12997. --- changes/bug12997 | 3 +++ src/or/rendmid.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changes/bug12997 diff --git a/changes/bug12997 b/changes/bug12997 new file mode 100644 index 000000000..fb6e7a845 --- /dev/null +++ b/changes/bug12997 @@ -0,0 +1,3 @@ + o Minor features: + - Log more specific warnings when we get an ESTABLISH_RENDEZVOUS cell + on a cannibalized or non-OR circuit. Resolves ticket 12997. diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 110381680..d89cdf6be 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -224,9 +224,16 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %u", (unsigned)circ->p_circ_id); - if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { + if (circ->base_.purpose != CIRCUIT_PURPOSE_OR) { log_warn(LD_PROTOCOL, - "Tried to establish rendezvous on non-OR or non-edge circuit."); + "Tried to establish rendezvous on non-OR circuit with purpose %s", + circuit_purpose_to_string(circ->base_.purpose)); + goto err; + } + + if (circ->base_.n_chan) { + log_warn(LD_PROTOCOL, + "Tried to establish rendezvous on non-edge circuit"); goto err; } From 7a878c192f5000c5ef5d29a71924a41b6e5adf42 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Fri, 29 Aug 2014 16:38:54 -0400 Subject: [PATCH 3/3] Downgrade "Unexpected onionskin length after decryption" warning It's now a protocol-warn, since there's nothing relay operators can do about a client that sends them a malformed create cell. Resolves bug 12996; bugfix on 0.0.6rc1. --- changes/bug12996 | 5 +++++ src/or/onion_tap.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changes/bug12996 diff --git a/changes/bug12996 b/changes/bug12996 new file mode 100644 index 000000000..4b4fb0dce --- /dev/null +++ b/changes/bug12996 @@ -0,0 +1,5 @@ + o Minor bugfixes: + - Downgrade "Unexpected onionskin length after decryption" warning + to a protocol-warn, since there's nothing relay operators can do + about a client that sends them a malformed create cell. Resolves + bug 12996; bugfix on 0.0.6rc1. diff --git a/src/or/onion_tap.c b/src/or/onion_tap.c index 9a9f374b9..65f8275f7 100644 --- a/src/or/onion_tap.c +++ b/src/or/onion_tap.c @@ -122,8 +122,9 @@ onion_skin_TAP_server_handshake( "Couldn't decrypt onionskin: client may be using old onion key"); goto err; } else if (len != DH_KEY_LEN) { - log_warn(LD_PROTOCOL, "Unexpected onionskin length after decryption: %ld", - (long)len); + log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, + "Unexpected onionskin length after decryption: %ld", + (long)len); goto err; }