aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay
AgeCommit message (Collapse)Author
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-03Merge branch 'maint-0.3.5'Nick Mathewson
2018-12-20Add ORCONN event pubsub systemTaylor Yu
Add a publish-subscribe subsystem to publish messages about changes to OR connections. connection_or_change_state() in connection_or.c and control_event_or_conn_event() in control.c publish messages to this subsystem via helper functions. Move state constants from connection_or.h to orconn_state.h so that subscribers don't have to include all of connection_or.h to take actions based on changes in OR connection state. Move event constants from control.h for similar reasons. Part of ticket 27167.
2018-12-17Check hostname before using it in send_resolved_hostname_cell()Nick Mathewson
Also, turn an absent hostname into a BUG(), not a crash. Found by scan-build. Closes ticket 28879; bugfix on 0.1.2.7-alpha
2018-12-05Merge remote-tracking branch 'public/prop298'Nick Mathewson
2018-12-05Write tests for mark_my_descriptor_dirty_if_too_old()Nick Mathewson
2018-11-25Treat the StaleDesc flag as making our descriptor dirty.Nick Mathewson
Relay side of prop293.
2018-11-24Emit router families in canonical formNick Mathewson
This patch has routers use the same canonicalization logic as authorities when encoding their family lists. Additionally, they now warn if any router in their list is given by nickname, since that's error-prone. This patch also adds some long-overdue tests for family formatting.
2018-11-24Extract get_declared_family() into its own function.Nick Mathewson
This will help as we refactor it.
2018-11-05Move the code that knows our tor version into a lowest-level libNick Mathewson
2018-10-31Merge branch 'networkstatus_mmap' into networkstatus_mmap_mergeNick Mathewson
2018-10-31Fix memory leak (#28257, CID 1440805).Nick Mathewson
2018-10-26In configured_nameserver_address, check if tor_addr_from_sockaddr succeededrl1987
2018-10-20Exclude test and a supporting function when evdns_base_get_nameserver_addr() ↵rl1987
is not available
2018-10-20Unit test for DNS fallback in configure_nameserversrl1987
2018-10-20Fallback to local DNS when no other nameservers are knownrl1987
2018-10-01Split the authority-cert and signature/hash code from routerparseNick Mathewson
2018-10-01Move routerparse and parsecommon to their own module.Nick Mathewson
2018-09-27Extract the non-stats part of geoip into a new src/lib/geoip.Nick Mathewson
2018-09-27Split geoip from geoip-related stats.Nick Mathewson
This commit just moves the code to two separate files. The geoip code still has a few needless dependencies on core/* and features/*.
2018-09-25Remove extra includes from router.cNick Mathewson
2018-09-25Revise things that had included router.h beforeNick Mathewson
Make them only include the headers that they needed, and sort their headers while we're at it.
2018-09-25Move the "is the network disabled?" functions out of router.cNick Mathewson
Since this is completely core functionality, I'm putting it in core/mainloop, even though it depends on feature/hibernate. We'll have to sort that out in the future.
2018-09-25Move routerinfo_t functions out of router.cNick Mathewson
(It turns out that some of the functions in router.h didn't even exist any more, so I just got to delete their declarations completely.)
2018-09-25Extract nickname-checking functions from router.cNick Mathewson
2018-09-25Move the various _describe() functions out of router.cNick Mathewson
Note that I haven't separated the headers yet (there's still an
2018-09-25Extract all the "am I a server" functions from router.cNick Mathewson
2018-09-25Move all authdir_mode_*() functions into authmode.hNick Mathewson
2018-09-25Rename dirauth/mode.h to dirauth/authmode.hNick Mathewson
This is preparation for having a routermode.h as well
2018-09-25Move self-test functionality into its own file.Nick Mathewson
2018-09-25Move key-loading and crosscert-checking out of feature/relayNick Mathewson
This is also used by onion services, so it needs to go in another module.
2018-09-21Split directory.c code into several modulesNick Mathewson
Parts of this C file naturally belong in dircache, dirclient, and dircommon: so, move them there.
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-21Move the non-crypto parts of onion.c out of src/core/cryptoNick Mathewson
The parts for handling cell formats should be in src/core/or. The parts for handling onionskin queues should be in src/core/or. Only the crypto wrapper belongs in src/core/crypto.
2018-09-20Split most of dirserv.c into several new modulesNick Mathewson
In dirauth: * bwauth.c reads and uses bandwidth files * guardfraction.c reads and uses the guardfraction file * reachability.c tests relay reachability * recommend_pkg.c handles the recommended-packages lines. * recv_descs.c handles fingerprint files and processing incoming routerinfos that relays upload to us * voteflag.c computes flag thresholds and sets those thresholds on routerstatuses when computing votes In control: * fmt_serverstatus.c generates the ancient "v1 server status" format that controllers expect. In nodelist: * routerstatus_fmt.c formats routerstatus entries for a consensus, a vote, or for the controller.
2018-09-19Split routerlist.c into 4 separate modulesNick Mathewson
There are now separate modules for: * the list of router descriptors * the list of authorities and fallbacks * managing authority certificates * selecting random nodes
2018-09-11Followup: Make authority_cert_parse_from_string() take length tooNick Mathewson
2018-09-04Merge branch 'nss_squashed' into nss_mergeNick Mathewson
2018-09-04Rename crypto_pk_check_key(), use it more reasonably, add testsNick Mathewson
This function was a wrapper around RSA_check_key() in openssl, which checks for invalid RSA private keys (like those where p or q are composite, or where d is not the inverse of e, or where n != p*q). We don't need a function like this in NSS, since unlike OpenSSL, NSS won't let you import a bogus private key. I've renamed the function and changed its return type to make it more reasonable, and added a unit test for trying to read a key where n != p*q.
2018-09-04Merge branch 'bug24104_029_squashed'Nick Mathewson
2018-08-29Merge branch 'ticket27246_035_01_squashed'Nick Mathewson
2018-08-29router: Keep RSA onion public key in ASN.1 formatDavid Goulet
The OpenSSL "RSA" object is currently 408 bytes compares to the ASN.1 encoding which is 140 for a 1024 RSA key. We save 268 bytes per descriptor (routerinfo_t) *and* microdescriptor (microdesc_t). Scaling this to 6000 relays, and considering client usually only have microdescriptors, we save 1.608 MB of RAM which is considerable for mobile client. This commit makes it that we keep the RSA onion public key (used for TAP handshake) in ASN.1 format instead of an OpenSSL RSA object. Changes is done in both routerinfo_t and microdesc_t. Closes #27246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-22key: Make ed_key_init_from_file() take an or_options_tDavid Goulet
Part of #27215, we need to call the ed_key_init_from_file function during option_validate() which is before the global_options variable is set. This commit make ed_key_init_from_file() stop using get_options() and instead now has a or_options_t parameter. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-21Split X509 code out of tortls.cNick Mathewson
2018-08-11Merge remote-tracking branch 'tor-github/pr/268'Nick Mathewson
2018-08-10Merge remote-tracking branch 'tor-github/pr/239'Nick Mathewson
2018-08-08Print stacktrace when crypto_pk_get_digest() fails in ↵rl1987
router_build_fresh_descriptor()
2018-08-08Consider all routerinfo errors other than "not a server" transientrl1987
2018-07-31Merge branch 'nss_dh_squashed' into nss_dh_squashed_mergedNick Mathewson
2018-07-26Early bailout from log_addr_has_changed() if running as clientrl1987