diff options
-rw-r--r-- | changes/bug20065 | 5 | ||||
-rw-r--r-- | doc/tor.1.txt | 4 | ||||
-rw-r--r-- | src/common/container.c | 2 | ||||
-rw-r--r-- | src/or/circuitbuild.c | 1 | ||||
-rw-r--r-- | src/or/rendservice.c | 3 | ||||
-rw-r--r-- | src/or/router.c | 5 | ||||
-rw-r--r-- | src/test/log_test_helpers.c | 2 | ||||
-rw-r--r-- | src/test/test_config.c | 2 | ||||
-rw-r--r-- | src/test/test_util.c | 1 |
9 files changed, 17 insertions, 8 deletions
diff --git a/changes/bug20065 b/changes/bug20065 new file mode 100644 index 0000000000..cdeb698991 --- /dev/null +++ b/changes/bug20065 @@ -0,0 +1,5 @@ + o Minor bugfixes (directory authorities): + - Die with a useful error when the operator forgets to place the + authority_signing_key file into the keys directory. This avoids an + uninformative assert & traceback about having an invalid key. + Fixes bug 20065; bugfix on 0.2.0.1-alpha. diff --git a/doc/tor.1.txt b/doc/tor.1.txt index cbd11a5322..2e7a3537b1 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -321,7 +321,7 @@ GENERAL OPTIONS specify one or more of **HashedControlPassword** or **CookieAuthentication**, setting this option will cause Tor to allow any process on the local host to control it. (Setting both authentication - methods means eithermethod is sufficient to authenticate to Tor.) This + methods means either method is sufficient to authenticate to Tor.) This option is required for many Tor controllers; most use the value of 9051. Set it to "auto" to have Tor pick a port for you. (Default: 0) + + @@ -2111,7 +2111,7 @@ on the public Tor network. When this option is set in addition to **AuthoritativeDirectory**, Tor generates version 3 network statuses and serves descriptors, etc as described in dir-spec.txt file of https://spec.torproject.org/[torspec] - (for Tor clients and servers running atleast 0.2.0.x). + (for Tor clients and servers running at least 0.2.0.x). [[VersioningAuthoritativeDirectory]] **VersioningAuthoritativeDirectory** **0**|**1**:: When this option is set to 1, Tor adds information on which versions of diff --git a/src/common/container.c b/src/common/container.c index ddf3bafa91..ec59dccf62 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -544,7 +544,7 @@ smartlist_sort(smartlist_t *sl, int (*compare)(const void **a, const void **b)) /** Given a smartlist <b>sl</b> sorted with the function <b>compare</b>, * return the most frequent member in the list. Break ties in favor of * later elements. If the list is empty, return NULL. If count_out is - * non-null, set it to the most frequent member. + * non-null, set it to the count of the most frequent member. */ void * smartlist_get_most_frequent_(const smartlist_t *sl, diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index aa2b0b2426..12c75530e2 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2547,3 +2547,4 @@ extend_info_has_preferred_onion_key(const extend_info_t* ei) tor_assert(ei); return extend_info_supports_ntor(ei); } + diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 4ad35059f1..8d3a7d704c 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -508,7 +508,7 @@ rend_config_services(const or_options_t *options, int validate_only) if (!strcasecmp(line->key, "HiddenServiceDir")) { if (service) { /* register the one we just finished parsing */ if (validate_only) - rend_service_free(service); + rend_service_free(service); else rend_add_service(service); } @@ -3904,3 +3904,4 @@ rend_service_allow_direct_connection(const or_options_t *options) (void)options; return 0; } + diff --git a/src/or/router.c b/src/or/router.c index b664a88760..8fa5799896 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -452,7 +452,8 @@ init_key_from_file(const char *fname, int generate, int severity, goto error; } } else { - log_info(LD_GENERAL, "No key found in \"%s\"", fname); + tor_log(severity, LD_GENERAL, "No key found in \"%s\"", fname); + goto error; } return prkey; case FN_FILE: @@ -560,7 +561,7 @@ load_authority_keyset(int legacy, crypto_pk_t **key_out, fname = get_datadir_fname2("keys", legacy ? "legacy_signing_key" : "authority_signing_key"); - signing_key = init_key_from_file(fname, 0, LOG_INFO, 0); + signing_key = init_key_from_file(fname, 0, LOG_ERR, 0); if (!signing_key) { log_warn(LD_DIR, "No version 3 directory key found in %s", fname); goto done; diff --git a/src/test/log_test_helpers.c b/src/test/log_test_helpers.c index 2c99da8583..1ad008aa50 100644 --- a/src/test/log_test_helpers.c +++ b/src/test/log_test_helpers.c @@ -145,7 +145,6 @@ mock_saved_log_has_message_containing(const char *msg) return 0; } - /** Return true iff the saved logs have any messages with <b>severity</b> */ int mock_saved_log_has_severity(int severity) @@ -210,3 +209,4 @@ mock_saving_logv(int severity, log_domain_mask_t domain, smartlist_add(saved_logs, e); } + diff --git a/src/test/test_config.c b/src/test/test_config.c index 90ea4da87d..1e6d2adf57 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -3832,6 +3832,8 @@ test_config_parse_port_config__listenaddress(void *data) tt_int_op(ret, OP_EQ, 0); // Test warning nonlocal other + SMARTLIST_FOREACH(slout,port_cfg_t *,pf,port_cfg_free(pf)); + smartlist_clear(slout); ret = parse_port_config(slout, config_port2, config_listen_address, "DNS", 0, NULL, 0, CL_PORT_WARN_NONLOCAL); tt_int_op(ret, OP_EQ, 0); diff --git a/src/test/test_util.c b/src/test/test_util.c index 445abb9237..6839db9b5c 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -2216,7 +2216,6 @@ test_util_gzip_compression_bomb(void *arg) size_t result_len = 0; tor_zlib_state_t *state = NULL; - /* Make sure we can't produce a compression bomb */ const int prev_level = setup_full_capture_of_logs(LOG_WARN); tt_int_op(-1, OP_EQ, tor_gzip_compress(&result, &result_len, |