aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
AgeCommit message (Collapse)Author
2018-03-06Refactor: suppress duplicated functions from router.c and encapsulate ↵Caio Valente
NODE_DESC_BUF_LEN constant. Also encapsulates format_node_description(). Closes ticket 25432.
2018-02-15Merge remote-tracking branch 'ffmancera-1/bug18918'Nick Mathewson
2018-02-12Tweaks into router_should_be_dirserver() log msg.Fernando Fernandez Mancera
Fixed log message that has been changed in commit 5ea993fa5a. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-31refactor: using get_uptime() (and reset_uptime()) consistently.Caio Valente
Using get_uptime() and reset_uptime() instead of accessing stats_n_seconds_working directly. stats_n_seconds_working is not extern anymore. Ticket #25081
2018-01-24Clarify directory and ORPort checking functions.Fernando Fernandez Mancera
In order to make the OR and dir checking functions in router.c less confusing we renamed some functions and splitted consider_testing_reachability() into router_should_check_reachability() and router_do_reachability_checks(). Also we improved the documentation. Fixes #18918. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Change the free macro convention in the rest of src/or/*.hNick Mathewson
2017-12-05Merge branch 'more_directories_squashed'Nick Mathewson
2017-12-05New accessors for keydir/cachedir accessNick Mathewson
This patch is a result of auditing all of our uses of get_datadir_fname() and its kin, and dividing them into cache vs keys vs other data. The new get_keydir_fname() and get_cachedir_fname() functions don't actually do anything new yet.
2017-12-05Extract common code for creating the keys directory.Nick Mathewson
This had somehow gotten duplicated between router.c and routerkeys.c
2017-11-27Merge branch 'ticket23856_025_01' into maint-0.3.2Nick Mathewson
2017-11-27relay: Change bandwidth stats interval to 24 hoursDavid Goulet
Going from 4 hours to 24 hours in order to try reduce the efficiency of guard discovery attacks. Closes #23856 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-17Make all the free() functions from container.h clear their targetsNick Mathewson
2017-11-13Minimal implementation of bridge-distribution-requestNick Mathewson
Just advertise the line when we're a bridge, using "any" if we're published or "none" if we aren't. This is done in lieu of a full backport of #18329.
2017-10-24Merge branch 'feature18329_029_squashed' into maint-0.3.2Nick Mathewson
2017-10-24Always set bridge-distribution-request on bridges' descriptors.Nick Mathewson
Also, warn the user if the BridgeDistribution option is unrecognized, and reject the value if it is invalid.
2017-10-24Add new BridgeDistribution config optionRoger Dingledine
Bridge relays can use it to add a "bridge-distribution-request" line to their bridge descriptor, which tells BridgeDB how they'd like their bridge address to be given out. Implements tickets 18329.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-13fix a copy-pasta issue from long agoRoger Dingledine
2017-09-12Remove named_map and unnamed_map from networkstatus.cNick Mathewson
2017-09-08Merge branch 'ed25519_lookup'Nick Mathewson
2017-08-25Merge branch 'maint-0.3.1'Nick Mathewson
2017-08-25Merge branch 'bug19418_029' into maint-0.3.1Nick Mathewson
2017-08-22Refactor node lookup APIs to take flagsNick Mathewson
Right now there's a single warn_if_unnamed flag for router_get_consensus_status_by_nickname() and node_get_by_nickname(), that is nearly always 1. I've turned it into an 'unsigned' bitfield, and inverted its sense. I've added the flags argument to node_get_by_hex_id() too, though it does nothing there right now. I've removed the router_get_consensus_status_by_nickname() function, since it was only used in once place. This patch changes the warning behavior of GETINFO ns/name/<name>, since all other name lookups from the controller currently warn. Later I'm going to add more flags, for ed25519 support.
2017-08-09Make sure we always wind up checking i2d_*'s output.Nick Mathewson
The biggest offender here was sometimes not checking the output of crypto_pk_get_digest. Fixes bug 19418. Reported by Guido Vranken.
2017-08-03Merge branch 'bug22885_squashed'Nick Mathewson
2017-08-03Don't send missing X-Desc-Gen-Reason on startupNick Mathewson
Since we start with desc_clean_since = 0, we should have been starting with non-null desc_dirty_reason. Fixes bug 22884; bugfix on 0.2.3.4-alpha when X-Desc-Gen-Reason was added.
2017-07-13rephist: Remove unused crypto_pk statistics.Isis Lovecruft
These statistics were largely ununsed, and kept track of statistical information on things like how many time we had done TLS or how many signatures we had verified. This information is largely not useful, and would only be logged after receiving a SIGUSR1 signal (but only if the logging severity level was less than LOG_INFO). * FIXES #19871. * REMOVES note_crypto_pk_op(), dump_pk_op(), and pk_op_counts from src/or/rephist.c. * REMOVES every external call to these functions.
2017-06-21Call it a BUG to use -1 in authdir_mode_handles_descsNick Mathewson
2017-06-21Remove obsolete authdir_mode_any_nonhidserv()huyvq
- Replace it with authdir_mode()
2017-06-21Convert authdir_mode_handles_descs() to alternative wrappershuyvq
-authdir_mode_handles_descs(options, ROUTER_PURPOSE_BRIDGE) to authdir_mode_bridge(options). - authdir_mode_handles_descs(options, ROUTER_PURPOSE_GENERAL) to authdir_mode_v3(options).
2017-06-21Convert authdir_mode_handles_descs(options, -1) with authdir_mode(options)huyvq
2017-06-21Remove obsolete authdir_mode_any_main()huyvq
2017-06-05Merge branch 'maint-0.3.0'Nick Mathewson
2017-05-31Bugfix: Regenerate more certificates when appropriateNick Mathewson
Previously we could sometimes change our signing key, but not regenerate the certificates (signing->link and signing->auth) that were signed with it. Also, we would regularly replace our TLS x.509 link certificate (by rotating our TLS context) but not replace our signing->link ed25519 certificate. In both cases, the resulting inconsistency would make other relays reject our link handshakes. Fixes two cases of bug 22460; bugfix on 0.3.0.1-alpha.
2017-05-24get rid of some dead code (leftover from commit fa04fe1)Roger Dingledine
2017-05-24add copy of MyFamily element to the descriptor, not the element itselfRoger Dingledine
If we add the element itself, we will later free it when we free the descriptor, and the next time we go to look at MyFamily, things will go badly. Fixes the rest of bug 22368; bugfix on 0.3.1.1-alpha.
2017-05-24don't free the values in options->MyFamily when we make a descriptorRoger Dingledine
If we free them here, we will still attempt to access the freed memory later on, and also we will double-free when we are freeing the config. Fixes part of bug 22368.
2017-05-10Merge remote-tracking branch 'public/my-family-list-fix-4498'Nick Mathewson
2017-05-09Merge branch 'dgoulet_ticket22060_031_01_squashed'Nick Mathewson
2017-05-09config: Remove {Control,DNS,Dir,Socks,Trans,NATD,OR}ListenAddress optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-09config: Remove TLSECGroup optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-09config: Remove AllowSingleHopExits optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-08Merge branch 'netflow_padding-v6-rebased2-squashed'Nick Mathewson
2017-05-08Netflow record collapsing defense.Mike Perry
This defense will cause Cisco, Juniper, Fortinet, and other routers operating in the default configuration to collapse netflow records that would normally be split due to the 15 second flow idle timeout. Collapsing these records should greatly reduce the utility of default netflow data for correlation attacks, since all client-side records should become 30 minute chunks of total bytes sent/received, rather than creating multiple separate records for every webpage load/ssh command interaction/XMPP chat/whatever else happens to be inactive for more than 15 seconds. The defense adds consensus parameters to govern the range of timeout values for sending padding packets, as well as for keeping connections open. The defense only sends padding when connections are otherwise inactive, and it does not pad connections used solely for directory traffic at all. By default it also doesn't pad inter-relay connections. Statistics on the total padding in the last 24 hours are exported to the extra-info descriptors.
2017-04-21Replace remaining directory_initiate_command_* instancesNick Mathewson
2017-04-14MyFamily config string is now a list. #4998Daniel Pinto
2017-03-17Merge branch 'ahf_bugs_21641_squashed'Nick Mathewson
2017-03-17Add periodic timer for expiring old onion keys.Alexander Færøy
This patch adds a new timer that is executed when it is time to expire our current set of old onion keys. Because of proposal #274 this can no longer be assumed to be at the same time we rotate our onion keys since they will be updated less frequently. See: https://bugs.torproject.org/21641
2017-03-17Add API to query the current onion key grace period.Alexander Færøy
This patch adds an API to get the current grace period, in days, defined as the consensus parameter "onion-key-grace-period-days". As per proposal #274 the values for "onion-key-grace-period-days" is a default value of 7 days, a minimum value of 1 day, and a maximum value defined by other consensus parameter "onion-key-rotation-days" also defined in days. See: https://bugs.torproject.org/21641