1. 21 Sep, 2018 2 commits
    • Nick Mathewson's avatar
      Split main.c into main.c and mainloop.c · c7ce6b98
      Nick Mathewson authored
      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.
      c7ce6b98
    • Nick Mathewson's avatar
      Move the non-crypto parts of onion.c out of src/core/crypto · 98ef3e82
      Nick Mathewson authored
      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.
      98ef3e82
  2. 19 Sep, 2018 1 commit
  3. 16 Sep, 2018 1 commit
  4. 10 Sep, 2018 1 commit
    • Taylor Yu's avatar
      Make control_event_bootstrap() return void · eee62e13
      Taylor Yu authored
      Simplify control_event_bootstrap() by making it return void again.  It
      is currently a fairly complicated function, and it's made more
      complicated by returning an int to signal whether it logged at NOTICE
      or INFO.
      
      The callers conditionally log messages at level NOTICE based on this
      return value.  Change the callers to unconditionally log their verbose
      human-readable messages at level INFO to keep NOTICE logs less
      cluttered.
      
      This partially reverts the changes of #14950.
      eee62e13
  5. 29 Aug, 2018 1 commit
    • 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
  6. 28 Aug, 2018 1 commit
  7. 05 Jul, 2018 2 commits
    • Nick Mathewson's avatar
      Fix every include path changed in the previous commit (automated) · ef486e3c
      Nick Mathewson authored
      I am very glad to have written this script.
      ef486e3c
    • Nick Mathewson's avatar
      Move literally everything out of src/or · 63b4ea22
      Nick Mathewson authored
      This commit won't build yet -- it just puts everything in a slightly
      more logical place.
      
      The reasoning here is that "src/core" will hold the stuff that every (or
      nearly every) tor instance will need in order to do onion routing.
      Other features (including some necessary ones) will live in
      "src/feature".  The "src/app" directory will hold the stuff needed
      to have Tor be an application you can actually run.
      
      This commit DOES NOT refactor the former contents of src/or into a
      logical set of acyclic libraries, or change any code at all.  That
      will have to come in the future.
      
      We will continue to move things around and split them in the future,
      but I hope this lays a reasonable groundwork for doing so.
      63b4ea22
  8. 03 Jul, 2018 1 commit
  9. 21 Jun, 2018 1 commit
  10. 20 Jun, 2018 2 commits
  11. 15 Jun, 2018 9 commits
  12. 22 May, 2018 1 commit
  13. 09 May, 2018 2 commits
    • Nick Mathewson's avatar
      Fix some clang warnings · 15ce5a3e
      Nick Mathewson authored
      15ce5a3e
    • Nick Mathewson's avatar
      Distinguish true clock jumps from idleness · 285e7c98
      Nick Mathewson authored
      Since we're going to be disabling the second-elapsed callback, we're
      going to sometimes have long periods when no events file, and so the
      current second is not updated.  Handle that by having a better means
      to detect "clock jumps" as opposed to "being idle for a while".
      Tolerate far more of the latter.
      
      Part of #26009.
      285e7c98
  14. 01 May, 2018 5 commits
  15. 27 Apr, 2018 1 commit
  16. 22 Apr, 2018 3 commits
    • Nick Mathewson's avatar
      Rename node_has_descriptor() to node_has_any_descriptor() · 47163780
      Nick Mathewson authored
      Changing the name of this function should help keep us from misusing
      it when node_has_preferred_descriptor() would be more appropriate.
      47163780
    • Nick Mathewson's avatar
      Use router_crn_flags in more places, to pass direct-connect flag · 7915efd1
      Nick Mathewson authored
      In order to fix 25691 and 25692, we need to pass the "direct_conn"
      flag to more places -- particularly when choosing single-hop
      tunnels.  The right way to do this involves having a couple more
      functions accept router_crn_flags_t, rather than a big list of
      boolean arguments.
      
      This commit also makes sure that choose_good_exit_server_general()
      honors the direct_conn flag, to fix 25691 and 25692.
      7915efd1
    • Nick Mathewson's avatar
      Check for "the right descriptor", not just "any descriptor". · 948dd2c7
      Nick Mathewson authored
      This patch adds a new node_has_preferred_descriptor() function, and
      replaces most users of node_has_descriptor() with it.  That's an
      important change, since as of d1874b43 (our fix for #25213),
      we are willing to say that a node has _some_ descriptor, but not the
      _right_ descriptor for a particular use case.
      
      Part of a fix for 25691 and 25692.
      948dd2c7
  17. 12 Apr, 2018 1 commit
    • Nick Mathewson's avatar
      Refine extend_info_for_node's "enough info" check once again. · 2d6914e3
      Nick Mathewson authored
      In d1874b43, we adjusted this check so that we insist on
      using routerinfos for bridges.  That's almost correct... but if we
      have a bridge that is also a regular relay, then we should use
      insist on its routerinfo when connecting to it as a bridge
      (directly), and be willing to use its microdescriptor when
      connecting to it elsewhere in our circuits.
      
      This bug is a likely cause of some (all?) of the (exit_ei == NULL)
      failures we've been seeing.
      
      Fixes bug 25691; bugfix on 0.3.3.4-alpha
      2d6914e3
  18. 06 Apr, 2018 1 commit
  19. 26 Mar, 2018 1 commit
    • Nick Mathewson's avatar
      Make extend_info_from_node() more picky about node contents · d1874b43
      Nick Mathewson authored
      This update is needed to make it consistent with the behavior of
      node_awaiting_ipv6(), which doesn't believe in the addresses from
      routerinfos unless it actually plans to use those routerinfos.
      
      Fixes bug 25213; bugfix on b66b62fb in 0.3.3.1-alpha,
      which tightened up the definition of node_awaiting_ipv6().
      d1874b43
  20. 17 Mar, 2018 1 commit
    • Nick Mathewson's avatar
      Extract the cryptographic parts of crypt_path_t and or_circuit_t. · 5ecad6c9
      Nick Mathewson authored
      Additionally, this change extracts the functions that created and
      freed these elements.
      
      These structures had common "forward&reverse stream&digest"
      elements, but they were initialized and freed through cpath objects,
      and different parts of the code depended on them.  Now all that code
      is extacted, and kept in relay_crypto.c
      5ecad6c9
  21. 16 Feb, 2018 1 commit
  22. 07 Feb, 2018 1 commit