Skip to content
Snippets Groups Projects
  1. Oct 20, 2021
  2. Mar 12, 2021
  3. Jan 14, 2021
    • David Goulet's avatar
      relay: Don't flag that we published if descriptor build fails · 743a5ef2
      David Goulet authored
      
      In case building the descriptor would fail, we could still flag that we did in
      fact publish the descriptors leading to no more attempt at publishing it which
      in turn makes the relay silent for some hours and not try to rebuild the
      descriptor later.
      
      This has been spotted with #40231 because the operator used a localhost
      address for the ORPort and "AssumeReachable 1" leading to this code path where
      the descriptor failed to build but all conditions to "can I publish" were met.
      
      Related to #40231
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      743a5ef2
  4. Dec 21, 2020
    • David Goulet's avatar
      relay: Report the entire content of a stats file · c934fced
      David Goulet authored and Nick Mathewson's avatar Nick Mathewson committed
      
      It turns out that 9 years ago, we stopped appending data into stats file and
      rather overwrite everytime we have new stats (see commit
      a6a127c8)
      
      The load_stats_file() function was still thinking that we could have the same
      line many times in the file which turns out to be false since 9 years ago.
      However, that did not cause problem until IPv6 connection stats came along
      which introduced a new line in conn-stats: "ipv6-conn-bi-direct ...".
      
      Before, that file contained a single line starting with the tag
      "conn-bi-direct".  That very tag appears also in the IPv6 tag (see above) so
      the load_stats_file() function would consider that the IPv6 line as the last
      tag to be appeneded to the file and fail to report the line above (for IPv4).
      It would actually truncate the IPv6 line and report it (removing the "ipv6-"
      part).
      
      In other words, "conn-bi-direct" was not reported and instead
      "ipv6-conn-bi-direct" was used without the "ipv6-" part.
      
      This commit refactors the entire function so that now it looks for a
      "timestamp tag" to validate and then if everything is fine, returns the entire
      content of the file. The refactor simplifies the function, adds logging in
      case of failures and modernize it in terms of coding standard.
      
      Unit tests are also added that makes sure the loaded content matches the
      entire file if timestamp validation passes.
      
      Fixes #40226
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      c934fced
  5. Dec 09, 2020
  6. Aug 25, 2020
    • Nick Mathewson's avatar
      Validate address more carefully when checking self-reachability · 75772ea0
      Nick Mathewson authored
      Previously, we would treat *any* incoming circuit on a non-local
      channel as meaning that our ORPort was reachable.  With this patch,
      we make sure that the address that the peer _says_ we have is the
      same as the one we're trying to advertise right now.
      
      Closes 20165. Bugfix on 4f5192b2 in 0.1.0.1-rc, when
      reachability self-tests were first introduced.
      75772ea0
  7. Jul 24, 2020
  8. Jul 21, 2020
    • Nick Mathewson's avatar
      Rename router_get_advertised_*() functions. · 088100d6
      Nick Mathewson authored
      These now (or_port and dir_port) now have "find" names, since they
      look at the portcfg first, then at the actual ports from the
      listeners.
      
      This is an automated commit, generated by this command:
      
      ./scripts/maint/rename_c_identifier.py \
              router_get_advertised_or_port routerconf_find_or_port \
              router_get_advertised_ipv6_or_ap routerconf_find_ipv6_or_ap \
              router_has_advertised_ipv6_orport routerconf_has_ipv6_orport \
              router_get_advertised_dir_port routerconf_find_dir_port
      088100d6
    • Nick Mathewson's avatar
  9. Jun 26, 2020
  10. Jun 25, 2020
  11. Jun 24, 2020
  12. May 05, 2020
    • David Goulet's avatar
      relay: New file relay_resolve_addr.{c|h} · 445df9e7
      David Goulet authored
      
      This commit moves router_pick_published_address() and the related helper
      functions into the new file.
      
      The log_addr_has_changed() function has been made public in router.h so we can
      use it in relay_resolve_addr.c.
      
      This is a refactoring as part of Sponsor 55. Only code movement at this
      commit.
      
      Part of #33789
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      445df9e7
  13. Apr 29, 2020
  14. Mar 20, 2020
    • teor's avatar
      router: Stop advertising incorrect auto IPv6 ORPorts · 861337fd
      teor authored
      When IPv6 ORPorts are set to "auto", tor relays and bridges would
      advertise an incorrect port in their descriptor.
      
      This may be a low-severity memory safety issue, because the published
      port number may be derived from uninitialised or out-of-bounds memory
      reads.
      
      Fixes bug 32588; bugfix on 0.2.3.9-alpha.
      861337fd
  15. Feb 20, 2020
  16. Jan 08, 2020
  17. Oct 20, 2019
  18. Sep 05, 2019
  19. Feb 19, 2019
  20. Jan 16, 2019
  21. Dec 05, 2018
  22. Nov 24, 2018
    • Nick Mathewson's avatar
      Emit router families in canonical form · 05dee063
      Nick Mathewson authored
      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.
      05dee063
  23. Sep 25, 2018
  24. Aug 29, 2018
    • David Goulet's avatar
      router: Keep RSA onion public key in ASN.1 format · 2f6bc749
      David Goulet authored and Nick Mathewson's avatar Nick Mathewson committed
      
      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's avatarDavid Goulet <dgoulet@torproject.org>
      2f6bc749
Loading